[{"problem_id":"p00001","input":"1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n","output":"3776\n2848\n2840\n"},{"problem_id":"p00002","input":"5 7\n1 99\n1000 999\n","output":"2\n3\n4\n"},{"problem_id":"p00003","input":"3\n4 3 5\n4 3 6\n8 8 8\n","output":"YES\nNO\nNO\n"},{"problem_id":"p00004","input":"1 2 3 4 5 6\n2 -1 -2 -1 -1 -5\n","output":"-1.000 2.000\n1.000 4.000\n"},{"problem_id":"p00005","input":"8 6\n50000000 30000000\n","output":"2 24\n10000000 150000000\n"},{"problem_id":"p00006","input":"w32nimda\n","output":"admin23w\n"},{"problem_id":"p00007","input":"5\n","output":"130000\n"},{"problem_id":"p00008","input":"35\n1\n","output":"4\n4\n"},{"problem_id":"p00009","input":"10\n3\n11\n","output":"4\n2\n5\n"},{"problem_id":"p00010","input":"1\n0.0 0.0 2.0 0.0 2.0 2.0\n","output":"1.000 1.000 1.414\n"},{"problem_id":"p00011","input":"5\n4\n2,4\n3,5\n1,2\n3,4\n","output":"4\n1\n2\n5\n3\n"},{"problem_id":"p00012","input":"0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5\n0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0\n","output":"YES\nNO\n"},{"problem_id":"p00013","input":"1\n6\n0\n8\n10\n0\n0\n0\n","output":"6\n10\n8\n1\n"},{"problem_id":"p00014","input":"20\n10\n","output":"68440000\n70210000\n"},{"problem_id":"p00015","input":"6\n1000\n800\n9999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n0\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n1\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n","output":"1800\n10000000000000000000000000000000000000000\noverflow\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\noverflow\noverflow\n"},{"problem_id":"p00016","input":"56,65\n97,54\n64,-4\n55,76\n42,-27\n43,80\n87,-86\n55,-6\n89,34\n95,5\n0,0\n","output":"171\n-302\n"},{"problem_id":"p00017","input":"xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.\n","output":"this is the picture that i took in the trip.\n"},{"problem_id":"p00018","input":"3 6 9 7 5\n","output":"9 7 6 5 3\n"},{"problem_id":"p00019","input":"5\n","output":"120\n"},{"problem_id":"p00020","input":"this is a pen.\n","output":"THIS IS A PEN.\n"},{"problem_id":"p00021","input":"2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n","output":"YES\nNO\n"},{"problem_id":"p00022","input":"7\n-5\n-1\n6\n4\n9\n-6\n-7\n13\n1\n2\n3\n2\n-2\n-1\n1\n2\n3\n2\n1\n-2\n1\n3\n1000\n-200\n201\n0\n","output":"19\n14\n1001\n"},{"problem_id":"p00023","input":"2\n0.0 0.0 5.0 0.0 0.0 4.0\n0.0 0.0 2.0 4.1 0.0 2.0\n","output":"2\n0\n"},{"problem_id":"p00024","input":"25.4\n25.4\n","output":"8\n8\n"},{"problem_id":"p00025","input":"9 1 8 2\n4 1 5 9\n4 6 8 2\n4 6 3 2\n","output":"1 1\n3 0\n"},{"problem_id":"p00026","input":"2,5,3\n3,6,1\n3,4,2\n4,5,2\n3,6,3\n2,4,1\n","output":"77\n5\n"},{"problem_id":"p00027","input":"1 1\n2 29\n0 0\n","output":"Thursday\nSunday\n"},{"problem_id":"p00028","input":"5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n","output":"3\n5\n"},{"problem_id":"p00029","input":"Thank you for your mail and your lectures\n","output":"your lectures\n"},{"problem_id":"p00030","input":"3 6\n3 1\n0 0\n","output":"3\n0\n"},{"problem_id":"p00031","input":"5\n7\n127\n","output":"1 4\n1 2 4\n1 2 4 8 16 32 64\n"},{"problem_id":"p00032","input":"3,4,5\n5,5,8\n4,4,4\n5,4,3\n","output":"1\n2\n"},{"problem_id":"p00033","input":"2\n3 1 4 2 5 6 7 8 9 10\n10 9 8 7 6 5 4 3 2 1\n","output":"YES\nNO\n"},{"problem_id":"p00034","input":"1,1,1,1,1,1,1,1,1,1,40,60\n1,1,1,1,1,3,3,3,3,3,50,50\n10,10,10,10,10,10,10,10,10,10,50,49\n","output":"4\n7\n6\n"},{"problem_id":"p00035","input":"0.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0\n0.0,0.0,3.0,0.0,1.0,1.0,1.0,3.0\n","output":"YES\nNO\n"},{"problem_id":"p00036","input":"00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n","output":"E\nC\nA\n"},{"problem_id":"p00037","input":"1111\n00001\n0110\n01011\n0010\n01111\n0010\n01001\n0111\n","output":"RRRRDDDDLLLUUURRDDLURULLDDDRRRUUUULLLL\n"},{"problem_id":"p00038","input":"1,2,3,4,1\n2,3,2,3,12\n12,13,11,12,12\n7,6,7,6,7\n3,3,2,3,3\n6,7,8,9,10\n11,12,10,1,13\n11,12,13,1,2\n","output":"one pair\ntwo pair\nthree card\nfull house\nfour card\nstraight\nstraight\nnull\n"},{"problem_id":"p00039","input":"IV\nCCCCLXXXXVIIII\nCDXCIX\n","output":"4\n499\n499\n"},{"problem_id":"p00040","input":"1\ny eazqyp pnop pngtg ye obmpngt xmybp mr lygw\n","output":"i submit that there is another point of view\n"},{"problem_id":"p00041","input":"8 7 9 9\n4 4 4 4\n5 5 7 5\n0 0 0 0\n","output":"((9 * (9 - 7)) - 8)\n0\n((7 * 5) - (5 * 5))\n"},{"problem_id":"p00042","input":"50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0\n","output":"Case 1:\n220\n49\nCase 2:\n220\n49\n"},{"problem_id":"p00043","input":"3649596966777\n6358665788577\n9118992346175\n9643871425498\n7755542764533\n1133557799246\n","output":"2 3 5 8\n3 4\n1 2 3 4 5 6 7 8 9\n7 8 9\n1 2 3 4 6 7 8\n0\n"},{"problem_id":"p00044","input":"19\n3517\n","output":"17 23\n3511 3527\n"},{"problem_id":"p00045","input":"100,20\n50,10\n70,35\n","output":"4950\n22\n"},{"problem_id":"p00046","input":"3776.0\n1819.0\n645.2\n2004.1\n1208.6\n","output":"3130.8\n"},{"problem_id":"p00047","input":"B,C\nA,C\nC,B\nA,B\nC,B\n","output":"A\n"},{"problem_id":"p00048","input":"60.2\n70.2\n48.0\n80.2\n","output":"light welter\nlight middle\nlight fly\nmiddle\n"},{"problem_id":"p00049","input":"1,B\n2,A\n3,B\n4,AB\n5,B\n6,O\n7,A\n8,O\n9,AB\n10,A\n11,A\n12,B\n13,AB\n14,A\n","output":"5\n4\n3\n2\n"},{"problem_id":"p00050","input":"the cost of one peach is higher than that of one apple.\n","output":"the cost of one apple is higher than that of one peach.\n"},{"problem_id":"p00051","input":"2\n65539010\n65539010\n","output":"96417531\n96417531\n"},{"problem_id":"p00052","input":"2\n12\n10000\n0\n","output":"0\n2\n2499\n"},{"problem_id":"p00053","input":"2\n9\n0\n","output":"5\n100\n"},{"problem_id":"p00054","input":"1 2 3\n2 3 4\n5 4 3\n4 3 2\n","output":"5\n24\n7\n6\n"},{"problem_id":"p00055","input":"1.0\n2.0\n3.0\n","output":"7.81481481\n15.62962963\n23.44444444\n"},{"problem_id":"p00056","input":"10\n11\n0\n","output":"2\n0\n"},{"problem_id":"p00057","input":"1\n3\n","output":"2\n7\n"},{"problem_id":"p00058","input":"1.0 1.0 2.0 2.0 0.0 0.0 1.0 -1.0\n0.0 0.0 2.0 0.0 -1.0 2.0 2.0 2.0\n10.0 6.0 3.4 5.2 6.8 9.5 4.3 2.1\n2.5 3.5 2.5 4.5 -3.3 -2.3 6.8 -2.3\n","output":"YES\nNO\nNO\nYES\n"},{"problem_id":"p00059","input":"0.0 0.0 5.0 5.0 1.0 1.0 4.0 4.0\n0.0 0.0 4.0 5.0 1.0 1.0 5.0 5.0\n0.0 0.0 4.0 4.0 -3.0 -5.0 2.0 -1.0\n","output":"YES\nYES\nNO\n"},{"problem_id":"p00060","input":"1 2 3\n5 6 9\n8 9 10\n","output":"YES\nYES\nNO\n"},{"problem_id":"p00061","input":"1,20\n2,20\n3,30\n4,10\n5,10\n6,20\n0,0\n1\n2\n4\n5\n","output":"2\n2\n3\n3\n"},{"problem_id":"p00062","input":"4823108376\n1234567890\n0123456789\n","output":"5\n6\n4\n"},{"problem_id":"p00063","input":"abcba\nsx\nabcddcba\nrttrd\n","output":"2\n"},{"problem_id":"p00064","input":"Thereare100yenonthetable.Iam17yearsold.\nIshouldgohomeat6pm.\n","output":"123\n"},{"problem_id":"p00065","input":"123,10\n56,12\n34,14\n\n123,3\n56,4\n123,5\n","output":"56 2\n123 3\n"},{"problem_id":"p00066","input":"ooosxssxs\nxoosxsosx\nooxxxooxo\n","output":"o\nx\nd\n"},{"problem_id":"p00067","input":"111100001111\n111000001111\n110000001111\n100000001111\n000100010000\n000000111000\n000001111100\n100011111110\n110001111100\n111000111000\n111100010000\n000000000000\n\n010001111100\n110010000010\n010010000001\n010000000001\n010000000110\n010000111000\n010000000100\n010000000010\n010000000001\n010010000001\n010010000010\n111001111100\n\n000000000000\n111111111111\n100010100001\n100010100001\n100010100001\n100010100001\n100100100101\n101000011101\n100000000001\n100000000001\n111111111111\n100000000001\n","output":"5\n13\n4\n"},{"problem_id":"p00068","input":"4\n1.0,0.0\n0.0,1.0\n2.0,1.0\n1.0,2.0\n9\n-509.94,892.63\n567.62,639.99\n-859.32,-64.84\n-445.99,383.69\n667.54,430.49\n551.12,828.21\n-940.2,-877.2\n-361.62,-970\n-125.42,-178.48\n0\n","output":"0\n3\n"},{"problem_id":"p00069","input":"5\n2\n3\n9\n1010\n1001\n0100\n1001\n0010\n1000\n0100\n0101\n1010\n0\n","output":"6 4\n"},{"problem_id":"p00070","input":"3 10\n3 1\n","output":"8\n0\n"},{"problem_id":"p00071","input":"2\n\n00010010\n00000100\n10001001\n00100010\n01000000\n00001000\n10100010\n01010010\n2\n5\n\n00010010\n00000100\n10001001\n00100010\n01000000\n00001000\n10100010\n01010010\n2\n5\n","output":"Data 1:\n00000000\n00000100\n10001001\n00100000\n00000000\n00001000\n10100000\n00000000\nData 2:\n00000000\n00000100\n10001001\n00100000\n00000000\n00001000\n10100000\n00000000\n"},{"problem_id":"p00072","input":"4\n4\n0,1,1500\n0,2,2000\n1,2,600\n1,3,500\n0\n","output":"23\n"},{"problem_id":"p00073","input":"6\n4\n7\n9\n0\n0\n","output":"96.000000\n184.192455\n"},{"problem_id":"p00074","input":"1 30 0\n-1 -1 -1\n","output":"00:30:00\n01:30:00\n"},{"problem_id":"p00075","input":"1001,50.0,1.60\n1002,60.0,1.70\n1003,70.0,1.80\n1004,80.0,1.70\n1005,90.0,1.60\n","output":"1004\n1005\n"},{"problem_id":"p00076","input":"3\n6\n-1\n","output":"0.29\n1.71\n-2.31\n0.80\n"},{"problem_id":"p00077","input":"ab@5C1@8050\n@99+1=1@90\n","output":"abCCCCC10000000050\n999999999+1=1000000000\n"},{"problem_id":"p00078","input":"3\n5\n0\n","output":"   4   9   2\n   3   5   7\n   8   1   6\n  11  24   7  20   3\n   4  12  25   8  16\n  17   5  13  21   9\n  10  18   1  14  22\n  23   6  19   2  15\n"},{"problem_id":"p00079","input":"0.0,0.0\n0.0,1.0\n1.0,1.0\n2.0,0.0\n1.0,-1.0\n","output":"2.500000\n"},{"problem_id":"p00080","input":"15\n15\n-1\n","output":"2.466212\n2.466212\n"},{"problem_id":"p00081","input":"1.0,0.0,-1.0,0.0,1.0,1.0\n1.0,0.0,0.0,-1.0,3.0,0.0\n0.0,1.0,0.0,-1.0,1.0,1.0\n","output":"1.000000 -1.000000\n1.000000 2.000000\n-1.000000 1.000000\n"},{"problem_id":"p00082","input":"2 3 1 4 0 1 0 1\n4 2 3 2 2 2 1 1\n","output":"1 4 1 4 1 2 1 2\n4 1 4 1 2 1 2 1\n"},{"problem_id":"p00083","input":"2005 9 3\n1868 12 2\n1868 9 7\n","output":"heisei 17 9 3\nmeiji 1 12 2\npre-meiji\n"},{"problem_id":"p00084","input":"Rain, rain, go to Spain.\n","output":"Rain rain Spain\n"},{"problem_id":"p00085","input":"41 3\n30 9\n0 0\n","output":"31\n21\n"},{"problem_id":"p00086","input":"1 3\n3 4\n3 5\n3 6\n4 6\n4 7\n4 7\n5 6\n6 7\n5 8\n5 8\n6 8\n6 9\n7 9\n8 9\n9 2\n0 0\n1 3\n3 4\n3 4\n4 2\n0 0\n","output":"OK\nNG\n"},{"problem_id":"p00087","input":"10 2 12 - \/\n3 4 - 7 2 3 * + *\n-1 -2 3 + +\n","output":"-1.000000\n-13.000000\n0.000000\n"},{"problem_id":"p00088","input":"PETER POTTER\n","output":"?D-C'KOPUA\n"},{"problem_id":"p00089","input":"7\n3,8\n8,1,0\n2,7,4,4\n4,5,2,6,5\n2,7,4,4\n8,1,0\n3,8\n7\n","output":"55\n"},{"problem_id":"p00090","input":"15\n3.14979,8.51743\n2.39506,3.84915\n2.68432,5.39095\n5.61904,9.16332\n7.85653,4.75593\n2.84021,5.41511\n1.79500,8.59211\n7.55389,8.17604\n4.70665,4.66125\n1.63470,4.42538\n7.34959,4.61981\n5.09003,8.11122\n5.24373,1.30066\n0.13517,1.83659\n7.57313,1.58150\n0\n","output":"4\n"},{"problem_id":"p00091","input":"2\n0 0 0 0 0 0 0 0 0 0\n0 0 0 1 0 0 0 0 0 0\n0 0 1 1 1 0 0 0 0 0\n0 0 0 1 0 0 0 1 1 1\n0 0 0 0 0 0 0 1 1 1\n0 0 0 0 0 0 0 1 1 1\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n","output":"3 2 1\n8 4 2\n"},{"problem_id":"p00092","input":"10\n...*....**\n..........\n**....**..\n........*.\n..*.......\n..........\n.*........\n..........\n....*..***\n.*....*...\n10\n****.*****\n*..*.*....\n****.*....\n*....*....\n*....*****\n..........\n****.*****\n*..*...*..\n****...*..\n*..*...*..\n0\n","output":"5\n3\n"},{"problem_id":"p00093","input":"2001 2010\n2005 2005\n2001 2010\n0 0\n","output":"2004\n2008\n\nNA\n\n2004\n2008\n"},{"problem_id":"p00094","input":"15 25\n","output":"113.437508\n"},{"problem_id":"p00095","input":"6\n1 14\n2 25\n3 42\n4 11\n5 40\n6 37\n","output":"3 42\n"},{"problem_id":"p00096","input":"2\n3\n35\n","output":"10\n20\n8436\n"},{"problem_id":"p00097","input":"3 6\n3 1\n0 0\n","output":"3\n0\n"},{"problem_id":"p00098","input":"3\n1 -2 3\n-4 5 6\n7 8 -9\n","output":"16\n"},{"problem_id":"p00099","input":"3 5\n1 4\n2 5\n1 3\n3 6\n2 7\n","output":"1 4\n2 5\n1 7\n1 7\n2 12\n"},{"problem_id":"p00100","input":"4\n1001 2000 520\n1002 1800 450\n1003 1600 625\n1001 200 1220\n2\n1001 100 3\n1005 1000 100\n2\n2013 5000 100\n2013 5000 100\n0\n","output":"1001\n1003\nNA\n2013\n"},{"problem_id":"p00101","input":"3\nHoshino\nHashino\nMasayuki Hoshino was the grandson of Ieyasu Tokugawa.\n","output":"Hoshina\nHashino\nMasayuki Hoshina was the grandson of Ieyasu Tokugawa.\n"},{"problem_id":"p00102","input":"4\n52 96 15 20\n86 22 35 45\n45 78 54 36\n16 86 74 55\n4\n52 96 15 20\n86 22 35 45\n45 78 54 36\n16 86 74 55\n0\n","output":"   52   96   15   20  183\n   86   22   35   45  188\n   45   78   54   36  213\n   16   86   74   55  231\n  199  282  178  156  815\n   52   96   15   20  183\n   86   22   35   45  188\n   45   78   54   36  213\n   16   86   74   55  231\n  199  282  178  156  815\n"},{"problem_id":"p00103","input":"2\nHIT\nOUT\nHOMERUN\nHIT\nHIT\nHOMERUN\nHIT\nOUT\nHIT\nHIT\nHIT\nHIT\nOUT\nHIT\nHIT\nOUT\nHIT\nOUT\nOUT\n","output":"7\n0\n"},{"problem_id":"p00104","input":"10 10\n>>>v..>>>v\n...v..^..v\n>>>>>>^..v\n.........v\n.v\n","output":"5 7\nLOOP\n"},{"problem_id":"p00105","input":"style 12\neven 25\nintroduction 3\neasy 9\nstyle 7\ndocument 13\nstyle 21\neven 18\n","output":"document\n13\neasy\n9\neven\n18 25\nintroduction\n3\nstyle\n7 12 21\n"},{"problem_id":"p00106","input":"500\n2200\n0\n","output":"850\n3390\n"},{"problem_id":"p00107","input":"10 6 8\n5\n4\n8\n6\n2\n5\n0 0 0\n","output":"NA\nOK\nOK\nNA\nNA\n"},{"problem_id":"p00108","input":"10\n4 5 1 1 4 5 12 3 5 4\n0\n","output":"3\n6 6 4 4 6 6 4 4 6 6\n"},{"problem_id":"p00109","input":"2\n4-2*3=\n4*(8+4+3)=\n","output":"-2\n60\n"},{"problem_id":"p00110","input":"123+4X6=X79\n12X+4X6=X79\nXX22+89=X2XX\n","output":"5\nNA\n1\n"},{"problem_id":"p00111","input":"?D-C'KOPUA\n","output":"PETER POTTER\n"},{"problem_id":"p00112","input":"5\n2\n6\n4\n3\n9\n0\n","output":"31\n"},{"problem_id":"p00113","input":"1 12\n10000 32768\n1 11100\n1 459550\n","output":"083\n  ^\n30517578125\n00009\n  ^^^\n00000217604178\n  ^^^^^^^^^^^^\n"},{"problem_id":"p00114","input":"2 5 3 7 6 13\n517 1024 746 6561 4303 3125\n0 0 0 0 0 0\n","output":"12\n116640000\n"},{"problem_id":"p00115","input":"-10 0 0\n10 0 0\n0 10 0\n0 10 10\n0 0 10\n","output":"HIT\n"},{"problem_id":"p00116","input":"10 10\n...*....**\n..........\n**....**..\n........*.\n..*.......\n**........\n.*........\n..........\n....*..***\n.*....*...\n10 10\n..*....*..\n.*.*...*..\n*****..*..\n*...*..*..\n*...*..*..\n..........\n****.*...*\n..*..*...*\n.*...*...*\n****..***.\n2 3\n...\n...\n0 0\n","output":"28\n12\n6\n"},{"problem_id":"p00117","input":"6\n8\n1,2,2,2\n1,3,4,3\n1,4,4,2\n2,5,3,2\n3,4,4,2\n3,6,1,2\n4,6,1,1\n5,6,1,2\n2,4,50,30\n","output":"11\n"},{"problem_id":"p00118","input":"10 10\n####*****@\n@#@@@@#*#*\n@##***@@@*\n#****#*@**\n##@*#@@*##\n*@@@@*@@@#\n***#@*@##*\n*@@@*@@##@\n*@*#*@##**\n@****#@@#@\n0 0\n","output":"33\n"},{"problem_id":"p00119","input":"6\n7\n5 2\n1 4\n3 5\n4 2\n1 6\n6 4\n3 4\n","output":"3\n5\n1\n6\n4\n2\n"},{"problem_id":"p00120","input":"30 4 5 6\n30 5 5 5\n50 3 3 3 10 10\n49 3 3 3 10 10\n","output":"OK\nOK\nOK\nNA\n"},{"problem_id":"p00121","input":"0 1 2 3 4 5 6 7\n1 0 2 3 4 5 6 7\n7 6 5 4 3 2 1 0\n","output":"0\n1\n28\n"},{"problem_id":"p00122","input":"6 1\n10\n6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 8 3\n6 1\n10\n6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 9 0\n0 0\n","output":"OK\nNA\n"},{"problem_id":"p00123","input":"40.0 70.0\n72.5 140.51\n","output":"B\nNA\n"},{"problem_id":"p00124","input":"4\nJapan 1 0 2\nEgypt 1 2 0\nCanada 0 2 1\nSpain 2 0 1\n3\nIndia 0 2 0\nPoland 1 0 1\nItaly 1 0 1\n0\n","output":"Spain,7\nJapan,5\nEgypt,3\nCanada,1\n\nPoland,4\nItaly,4\nIndia,0\n"},{"problem_id":"p00125","input":"2006 9 2 2006 9 3\n2006 9 2 2006 11 11\n2004 1 1 2005 1 1\n2000 1 1 2006 1 1\n2000 1 1 2101 1 1\n-1 -1 -1 -1 -1 -1\n","output":"1\n70\n366\n2192\n36890\n"},{"problem_id":"p00126","input":"2\n2 1 3 4 5 6 7 8 9\n4 5 6 7 8 9 1 2 3\n7 8 9 1 2 3 4 5 6\n2 3 4 5 6 7 8 9 1\n5 6 7 8 9 1 2 3 4\n8 9 1 2 3 4 5 6 7\n3 4 5 6 7 8 9 1 2\n6 7 8 9 1 2 3 4 5\n9 1 2 3 4 5 6 7 8\n2 1 3 4 5 6 7 8 9\n4 5 6 7 8 9 1 2 3\n7 8 9 1 2 3 4 5 6\n2 3 4 5 6 7 8 9 1\n5 6 7 8 9 1 2 3 4\n8 9 1 2 3 4 5 6 7\n3 4 5 6 7 8 9 1 2\n6 7 8 9 1 2 3 4 5\n9 1 2 3 4 5 6 7 8\n","output":"*2*1 3 4 5 6 7 8 9\n 4 5 6 7 8 9 1 2 3\n 7 8 9 1 2 3 4 5 6\n*2 3 4 5 6 7 8 9 1\n 5 6 7 8 9 1 2 3 4\n 8 9 1 2 3 4 5 6 7\n 3 4 5 6 7 8 9 1 2\n 6 7 8 9 1 2 3 4 5\n 9*1 2 3 4 5 6 7 8\n\n*2*1 3 4 5 6 7 8 9\n 4 5 6 7 8 9 1 2 3\n 7 8 9 1 2 3 4 5 6\n*2 3 4 5 6 7 8 9 1\n 5 6 7 8 9 1 2 3 4\n 8 9 1 2 3 4 5 6 7\n 3 4 5 6 7 8 9 1 2\n 6 7 8 9 1 2 3 4 5\n 9*1 2 3 4 5 6 7 8\n"},{"problem_id":"p00127","input":"341143514535\n314\n143565553551655311343411652235654535651124615163\n551544654451431564\n4\n3411\n6363636363\n153414\n","output":"naruto\nNA\ndo you wanna go to aizu?\nyes sure!\nNA\nna\n?????\nend\n"},{"problem_id":"p00128","input":"2006\n1111\n","output":"****\n    *\n=====\n *  *\n****\n* ***\n*****\n*****\n\n*****\n\n=====\n ****\n*\n*****\n*****\n*****\n"},{"problem_id":"p00129","input":"3\n6 6 3\n19 7 4\n21 8 1\n6\n5 4 2 11\n12 4 2 11\n11 9 2 11\n14 3 20 5\n17 9 20 5\n20 10 20 5\n0\n","output":"Safe\nSafe\nDanger\nSafe\nDanger\nSafe\n"},{"problem_id":"p00130","input":"4\na->e->c->b->d\nb\n","output":"aecbd\nedacb\nbacde\nbcdae\n"},{"problem_id":"p00131","input":"1\n0 1 0 0 0 0 0 0 0 0\n1 1 1 0 0 0 0 0 0 0\n0 1 0 0 0 0 0 0 0 0\n0 0 0 0 1 1 0 0 0 0\n0 0 0 1 0 0 1 0 0 0\n0 0 0 0 1 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 0 0 1 1 1\n0 0 0 0 0 0 0 0 1 0\n","output":"0 0 0 0 0 0 0 0 0 0\n0 1 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 1 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 0 0 0 0 0\n"},{"problem_id":"p00132","input":"14 20\n####################\n###.............####\n####..........######\n#######.....########\n########.....#######\n###..###......######\n###..####......#####\n#########......#####\n###########.....####\n############.....###\n###.########......##\n###.#######...###.##\n##...###....#####.##\n####################\n10\n12 15\n#############..\n.##########....\n....#####......\n.....#####.....\n.....######....\n......######...\n......######...\n........#####..\n.........#####.\n.........######\n........###...#\n.....####.....#\n3 3\n#..\n###\n#..\n2 2\n##\n##\n4 10\n....#####.\n....######\n...###...#\n####.....#\n6 5\n....#\n..###\n#####\n##.##\n#..##\n#..#.\n6 4\n...#\n.###\n####\n##.#\n##.#\n#...\n2 6\n######\n.#####\n2 7\n..#####\n#######\n2 13\n#############\n.##########..\n6 9\n#####....\n.######..\n.######..\n..######.\n...#####.\n....#####\n8\n3 1 2 3\n4 1 2 3 4\n7 2 3 4 5 6 7 8\n5 2 3 10 7 8\n6 2 3 9 5 6 4\n8 2 3 4 6 9 5 4 10\n4 4 5 6 9\n5 10 2 3 4 9\n0 0\n","output":"YES\nNO\nYES\nNO\nYES\nNO\nNO\nYES\n"},{"problem_id":"p00133","input":"#*******\n#*******\n#*******\n#*******\n#*******\n#*******\n#*******\n########\n","output":"90\n########\n#*******\n#*******\n#*******\n#*******\n#*******\n#*******\n#*******\n180\n########\n*******#\n*******#\n*******#\n*******#\n*******#\n*******#\n*******#\n270\n*******#\n*******#\n*******#\n*******#\n*******#\n*******#\n*******#\n########\n"},{"problem_id":"p00134","input":"6\n12300\n5600\n33800\n0\n26495\n52000\n","output":"21699\n"},{"problem_id":"p00135","input":"4\n02:15\n06:01\n11:55\n10:40\n","output":"alert\nsafe\nalert\nwarning\n"},{"problem_id":"p00136","input":"4\n180.3\n168.2\n165.5\n175.3\n","output":"1:\n2:**\n3:\n4:*\n5:*\n6:\n"},{"problem_id":"p00137","input":"2\n123\n567\n","output":"Case 1:\n151\n228\n519\n2693\n2522\n3604\n9888\n7725\n6756\n6435\nCase 2:\n3214\n3297\n8702\n7248\n5335\n4622\n3628\n1623\n6341\n2082\n"},{"problem_id":"p00138","input":"18 25.46\n16 26.23\n3 23.00\n10 24.79\n5 22.88\n11 23.87\n19 23.90\n1 25.11\n23 23.88\n4 23.46\n7 24.12\n12 22.91\n13 21.99\n14 22.86\n21 23.12\n9 24.09\n17 22.51\n22 23.49\n6 23.02\n20 22.23\n24 21.89\n15 24.14\n8 23.77\n2 23.42\n","output":"5 22.88\n3 23.00\n13 21.99\n14 22.86\n24 21.89\n20 22.23\n17 22.51\n12 22.91\n"},{"problem_id":"p00139","input":"3\n>'======#======~\n>^Q=Q=Q=Q=Q=Q=Q=Q=Q=~~\n>'===#====~\n","output":"A\nB\nNA\n"},{"problem_id":"p00140","input":"2\n2 4\n4 2\n","output":"2 3 4\n4 3 2\n"},{"problem_id":"p00141","input":"2\n5\n6\n","output":"#####\n#   #\n# # #\n# # #\n# ###\n\n######\n#    #\n# ## #\n# #  #\n# #  #\n# ####\n"},{"problem_id":"p00142","input":"11\n15\n0\n","output":"4\n4\n4\n4\n4\n2\n2\n4\n2\n4\n4\n2\n"},{"problem_id":"p00143","input":"5\n2 5 9 2 8 9 2 11 6 5\n2 5 9 2 8 9 2 11 12 6\n2 5 9 2 8 9 2 11 11 9\n14 1 25 7 17 12 17 9 20 5\n14 1 25 7 17 12 22 13 20 5\n","output":"OK\nNG\nNG\nNG\nOK\n"},{"problem_id":"p00144","input":"7\n1 4 2 5 4 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 1\n7 0\n6\n1 2 2\n1 5 3\n1 2 1\n5 1 3\n6 3 3\n1 7 4\n","output":"2\n2\nNA\n3\n3\n3\n"},{"problem_id":"p00145","input":"3\n3 5\n2 8\n5 4\n","output":"440\n"},{"problem_id":"p00146","input":"2\n1 100 1\n2 200 2\n","output":"1 2\n"},{"problem_id":"p00147","input":"5\n6\n7\n8\n","output":"0\n14\n9\n4\n"},{"problem_id":"p00148","input":"50\n5576\n5577\n5578\n","output":"3C11\n3C38\n3C39\n3C01\n"},{"problem_id":"p00149","input":"1.0 1.2\n0.8 1.5\n1.2 0.7\n2.0 2.0\n","output":"2 3\n2 1\n0 0\n0 0\n"},{"problem_id":"p00150","input":"12\n100\n200\n300\n0\n","output":"5 7\n71 73\n197 199\n281 283\n"},{"problem_id":"p00151","input":"5\n00011\n00101\n01000\n10101\n00010\n8\n11000001\n10110111\n01100111\n01111010\n11111111\n01011010\n10100010\n10000001\n2\n01\n00\n3\n000\n000\n000\n0\n","output":"4\n8\n1\n0\n"},{"problem_id":"p00152","input":"3\n1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0\n1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9\n1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n4\n3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10\n3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1\n3335 10 10 10 10 10 10 10 10 10 10 10 10\n3340 8 2 7 3 6 4 8 2 8 2 9 1 7 3 6 4 8 2 9 1 7\n0\n","output":"1200 127\n1010 123\n1101 60\n3335 300\n3321 200\n3340 175\n3332 122\n"},{"problem_id":"p00153","input":"1 1\n3 1\n3 3\n3 2\n3\n3 12\n9 3\n11 12\n8 7\n5\n15 3\n17 7\n22 5\n7 6\n4\n6 11\n8 2\n16 9\n10 8\n2\n0 0\n","output":"b\nc\nd\na\n"},{"problem_id":"p00154","input":"5\n1 10\n5 3\n10 3\n25 2\n50 2\n4\n120\n500\n100\n168\n7\n1 10\n3 10\n5 10\n10 10\n25 10\n50 10\n100 10\n3\n452\n574\n787\n0\n","output":"16\n0\n12\n7\n9789\n13658\n17466\n"},{"problem_id":"p00155","input":"4\n1 0 0\n2 30 0\n3 60 40\n4 0 60\n2\n1 3\n1 4\n22\n1 0 0\n2 150 40\n3 30 20\n4 180 150\n5 40 80\n6 130 130\n7 72 28\n8 172 118\n9 50 50\n10 160 82\n11 90 105\n12 144 131\n13 130 64\n14 80 140\n15 38 117\n16 190 90\n17 60 100\n18 100 70\n19 130 100\n20 71 69\n21 200 110\n22 120 150\n1\n1 22\n0\n","output":"1 2 3\nNA\n1 3 9 20 11 6 22\n"},{"problem_id":"p00156","input":"5 5\n.###.\n#...#\n#.&.#\n#...#\n.###.\n18 15\n..####....####....\n####..####....####\n#...............##\n.#.############.##\n#..#..........#.##\n.#.#.########.#.##\n#..#.#......#.#.##\n.#.#....&...#.#.##\n#..#........#.#.##\n.#.#.########.#.##\n#..#..........#.##\n.#.############.##\n#...............##\n.#################\n##################\n9 10\n#########\n........#\n#######.#\n#.....#.#\n#.###.#.#\n#.#&#.#.#\n#.#...#.#\n#.#####.#\n#.......#\n#########\n9 3\n###...###\n#.#.&.#.#\n###...###\n0 0\n","output":"1\n2\n0\n0\n"},{"problem_id":"p00157","input":"6\n1 1\n4 3\n6 5\n8 6\n10 10\n14 14\n5\n2 2\n5 4\n6 6\n9 8\n15 10\n4\n1 1\n4 3\n6 5\n8 6\n3\n2 2\n5 4\n6 6\n4\n1 1\n4 3\n6 5\n8 6\n4\n10 10\n12 11\n18 15\n24 20\n0\n","output":"9\n6\n8\n"},{"problem_id":"p00158","input":"3\n10\n0\n","output":"7\n6\n"},{"problem_id":"p00159","input":"6\n1 165 66\n2 178 60\n3 180 72\n4 160 65\n5 185 62\n6 182 62\n3\n3 160 65\n2 180 70\n1 170 75\n0\n","output":"3\n2\n"},{"problem_id":"p00160","input":"2\n50 25 5 5\n80 60 10 30\n3\n10 15 25 24\n5 8 12 5\n30 30 30 18\n0\n","output":"800\n3800\n"},{"problem_id":"p00161","input":"8\n34001 3 20 3 8 6 27 2 25\n20941 3 5 2 41 7 19 2 42\n90585 4 8 3 12 6 46 2 34\n92201 3 28 2 47 6 37 2 58\n10001 3 50 2 42 7 12 2 54\n63812 4 11 3 11 6 53 2 22\n54092 3 33 2 54 6 18 2 19\n25012 3 44 2 58 6 45 2 46\n4\n1 3 23 1 23 1 34 4 44\n2 5 12 2 12 3 41 2 29\n3 5 24 1 24 2 0 3 35\n4 4 49 2 22 4 41 4 23\n0\n","output":"54092\n34001\n10001\n1\n3\n2\n"},{"problem_id":"p00162","input":"3 8\n1 27\n1 86\n0\n","output":"5\n17\n31\n"},{"problem_id":"p00163","input":"2\n17 25\n4\n17 45\n4\n17 25\n7\n19 35\n0\n","output":"250\n1300\n"},{"problem_id":"p00164","input":"4\n3 1 4 2\n3\n4 3 2\n0\n","output":"31\n28\n26\n25\n21\n17\n16\n14\n11\n8\n6\n5\n1\n0\n31\n27\n26\n23\n21\n19\n16\n12\n11\n8\n6\n4\n1\n0\n"},{"problem_id":"p00165","input":"4\n5 0\n9 1\n3 10\n11 3\n1\n999983 20\n0\n","output":"5\n1\n"},{"problem_id":"p00166","input":"4\n30\n125\n75\n4\n30\n125\n75\n5\n30\n125\n75\n65\n4\n30\n125\n75\n4\n30\n125\n75\n6\n30\n50\n50\n25\n75\n0\n","output":"0\n1\n2\n"},{"problem_id":"p00167","input":"5\n5\n3\n2\n1\n4\n6\n1\n2\n3\n4\n5\n6\n3\n3\n2\n1\n0\n","output":"7\n0\n3\n"},{"problem_id":"p00168","input":"1\n10\n20\n25\n0\n","output":"1\n1\n34\n701\n"},{"problem_id":"p00169","input":"1\n7 7 7\n7 7 8\n12 1\n10 1 1\n0\n","output":"11\n21\n0\n21\n12\n"},{"problem_id":"p00170","input":"4\nsandwich 80 120\napple 50 200\ncheese 20 40\ncake 100 100\n9\nonigiri 80 300\nonigiri 80 300\nanpan 70 280\nmikan 50 80\nkanzume 100 500\nchocolate 50 350\ncookie 30 80\npurin 40 400\ncracker 40 160\n0\n","output":"apple\ncake\nsandwich\ncheese\nkanzume\npurin\nchocolate\nonigiri\nonigiri\nanpan\nmikan\ncracker\ncookie\n"},{"problem_id":"p00171","input":"zabZNq\nBCxmAi\nZcbBCj\naizXCm\nQgmABC\nJHzMop\nImoXGz\nMZTOhp\nzabZnQ\nBCxmAi\nZcbBCj\naizXCm\nQgmABC\nJHzMop\nImoXGz\nMZTOhp\nabcdef\nABDCFE\nFBDCAE\nabcdef\nBEACDF\nbfcaed\nfabcde\nDEABCF\nUnivOf\nAizuaH\nzTXZYW\npiglIt\nGRULNP\nhigGtH\nuAzIXZ\nFizmKZ\nUnivOf\nAizuaH\npiglIt\nhigGtH\nGRULNP\nuAzIXZ\nFizmKZ\nZTXzYW\n0\n","output":"YES\nNO\nYES\nYES\nNO\n"},{"problem_id":"p00172","input":"4 3\n1 2\n2 3\n2 4\n1 0 0 0\n2 2 3\n0\n3 1 2 4\n2 2 3\n4 3\n1 2\n2 3\n2 4\n1 0 0 0\n2 2 3\n0\n3 1 2 4\n1 3\n4 3\n1 2\n2 3\n2 4\n1 0 0 0\n2 2 3\n0\n2 1 2\n2 2 3\n0 0\n","output":"You can go home in 10 steps.\nSwitch on room 2.\nSwitch on room 3.\nMove to room 2.\nMove to room 3.\nSwitch off room 1.\nSwitch on room 4.\nMove to room 2.\nMove to room 4.\nSwitch off room 2.\nSwitch off room 3.\nYou can not switch off all lights.\nHelp me!\n"},{"problem_id":"p00173","input":"1a 132 243\n1c 324 183\n1f 93 199\n2b 372 163\n2c 229 293\n2e 391 206\n3a 118 168\n3b 263 293\n3d 281 102\n","output":"1a 375 99300\n1c 507 119700\n1f 292 78300\n2b 535 123300\n2c 522 133700\n2e 597 140000\n3a 286 74000\n3b 556 140500\n3d 383 86800\n"},{"problem_id":"p00174","input":"ABAABBBAABABAAABBAA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBABAA\nAAAAAAAAAAA\nABBBBBBBBBB\n0\n","output":"11 8\n10 12\n11 7\n11 8\n11 0\n0 11\n"},{"problem_id":"p00175","input":"7\n4\n0\n12\n10\n10000\n-1\n","output":"13\n10\n0\n30\n22\n2130100\n"},{"problem_id":"p00176","input":"#ffe085\n#787878\n#decade\n#ff55ff\n0\n","output":"white\nblack\nwhite\nfuchsia\n"},{"problem_id":"p00177","input":"35.68 139.77 51.15 359.82\n1.37 103.92 41.78 272.25\n51.15 359.82 -34.58 301.52\n-1 -1 -1 -1\n","output":"9609\n15092\n11112\n"},{"problem_id":"p00178","input":"4\n1 4 1\n1 3 1\n2 2 4\n2 3 5\n1\n1 5 1\n7\n2 2 2\n1 4 1\n2 1 3\n1 4 1\n1 1 1\n2 5 5\n1 4 2\n0\n","output":"2\n0\n6\n"},{"problem_id":"p00179","input":"rbgrg\nrbbgbbr\nbgr\nbgrbrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n","output":"5\n7\n1\n6\nNA\n8\n0\n4\n"},{"problem_id":"p00180","input":"5 6\n0 2 1\n2 1 3\n2 3 8\n1 3 2\n3 4 5\n1 4 4\n3 3\n1 2 3\n2 0 3\n0 1 3\n0 0\n","output":"10\n6\n"},{"problem_id":"p00181","input":"3 9\n500\n300\n800\n200\n100\n600\n900\n700\n400\n4 3\n1000\n1000\n1000\n0 0\n","output":"1800\n1000\n"},{"problem_id":"p00182","input":"10\n11 2 23 4 2 12 8 5 2 10\n8\n2 1 3 11 2 3 1 4\n9\n5 9 1 2 4 8 17 1 8\n8\n3 38 9 4 18 14 19 5\n1\n1\n0\n","output":"YES\nYES\nYES\nNO\nYES\n"},{"problem_id":"p00183","input":"bbw\nwbw\n+b+\nbwb\nwbw\nwbw\n0\n","output":"b\nNA\n"},{"problem_id":"p00184","input":"8\n71\n34\n65\n11\n41\n39\n6\n5\n4\n67\n81\n78\n65\n0\n","output":"2\n1\n0\n2\n1\n0\n2\n0\n0\n0\n0\n0\n0\n4\n"},{"problem_id":"p00185","input":"134\n4330\n34808\n98792\n0\n","output":"6\n72\n274\n607\n"},{"problem_id":"p00186","input":"48 9297 240 126 32\n20 3010 157 141 7\n30 117002 5680 962 15\n8 1673 1712 190 22\n64 8478 87 54 307\n23 5477 117 92 12\n50 7558 1396 187 17\n279 88677 4522 514 14\n0\n","output":"28 20\n7 13\n15 33\nNA\n97 0\n12 44\nNA\nNA\n"},{"problem_id":"p00187","input":"-3 -2 9 6\n3 -2 7 6\n-1 0 5 0\n2 2 -1 -1\n0 1 2 1\n-3 -1 3 1\n0 0 0 0\n","output":"syo-kichi\nkyo\n"},{"problem_id":"p00188","input":"7\n11\n15\n23\n36\n51\n61\n86\n51\n4\n1\n2\n3\n5\n4\n0\n","output":"3\n3\n"},{"problem_id":"p00189","input":"6\n0 1 80\n1 2 20\n0 2 60\n2 3 50\n3 4 60\n1 4 90\n2\n0 1 1\n1 2 1\n0\n","output":"2 240\n1 2\n"},{"problem_id":"p00190","input":"2\n1 0 3\n4 5 6 7 8\n9 0 11\n10\n0\n1 2 3\n4 5 6 7 8\n9 10 11\n0\n0\n11 10 9\n8 7 6 5 4\n3 2 1\n0\n-1\n","output":"2\n0\nNA\n"},{"problem_id":"p00191","input":"3 3\n1.3 3.0 0.5\n2.4 2.1 1.0\n3.0 0.8 1.2\n2 2\n1.0 1.0\n1.0 1.0\n0 0\n","output":"9.00\n1.00\n"},{"problem_id":"p00192","input":"3 5\n90\n52\n82\n84\n70\n2 4\n10\n30\n40\n60\n0 0\n","output":"2 5 1 4 3\n1 2 4 3\n"},{"problem_id":"p00193","input":"6 6\n6\n1 1\n6 1\n3 2\n3 5\n1 6\n5 6\n2\n1 3\n5 3\n6 6\n6\n3 2\n3 5\n6 1\n1 1\n1 6\n5 6\n2\n2 3\n5 3\n0 0\n","output":"4\n4\n"},{"problem_id":"p00194","input":"4 5\n1\n3\nb-2 3\nc-3 2\nc-4 1\n3\na-2 b-2\nb-3 c-3\nd-3 d-4\n2\nb-3 b-4 1\nc-1 d-1 1\nd-1 b-4\n4 5\n1\n3\nb-2 3\nc-3 2\nc-4 1\n3\na-2 b-2\nb-3 c-3\nd-3 d-4\n2\nb-3 b-4 1\nc-1 d-1 1\nd-2 b-4\n4 5\n1\n3\nb-2 3\nc-3 2\nc-4 1\n3\na-2 b-2\nb-3 c-3\nd-3 d-4\n2\nb-3 b-4 1\nc-1 d-1 1\nd-3 b-4\n0 0\n","output":"7\n4\n8\n"},{"problem_id":"p00195","input":"1593 4311\n4321 2155\n1256 6421\n5310 1455\n2152 5421\n1549 3386\n4528 3719\n1234 4321\n3330 3109\n2739 2199\n0 0\n","output":"C 7677\nB 8247\n"},{"problem_id":"p00196","input":"6\nA 1 0 0 2 0\nB 0 0 1 1 0\nC 1 1 1 1 1\nD 1 0 0 1 2\nE 2 0 0 0 0\nF 1 1 0 2 1\n4\ng 1 1 1\nh 0 1 2\nw 0 0 0\nb 0 2 1\n0\n","output":"E\nA\nB\nD\nF\nC\nw\nh\nb\ng\n"},{"problem_id":"p00197","input":"1071 1029\n5 5\n0 0\n","output":"21 3\n5 1\n"},{"problem_id":"p00198","input":"3\nCyan Yellow Red Magenta Green Blue\nCyan Yellow Red Magenta Green Blue\nRed Yellow Magenta Blue Green Cyan\n4\nRed Magenta Blue Green Yellow Cyan\nRed Yellow Magenta Blue Green Cyan\nMagenta Green Red Cyan Yellow Blue\nCyan Green Yellow Blue Magenta Red\n0\n","output":"1\n1\n"},{"problem_id":"p00199","input":"5 4\nA\nB\nC\nD\n5 4\nD\nC\nB\nA\n0 0\n","output":"ACD#B\nDCA#B\n"},{"problem_id":"p00200","input":"6 5\n1 2 200 10\n1 4 400 15\n1 3 250 25\n2 4 100 10\n4 5 150 20\n3 5 300 20\n2\n1 5 0\n1 5 1\n0 0\n","output":"450\n35\n"},{"problem_id":"p00201","input":"8\nwood 3000\nstring 800\nrice 36\nwater 0\nracket 5000\nmicrophone 9800\nonigiri 140\nguitar 98000\n3\nracket 2 wood string\nonigiri 2 rice water\nguitar 3 racket microphone onigiri\nguitar\n1\ncomputer 300000\n0\ncomputer\n0\n","output":"13636\n300000\n"},{"problem_id":"p00202","input":"4 15000\n305\n260\n129\n500\n3 400\n10\n20\n30\n3 200909\n5\n9\n12\n0 0\n","output":"14983\nNA\n200909\n"},{"problem_id":"p00203","input":"5 5\n0 0 0 0 1\n2 1 0 2 0\n1 0 0 1 1\n0 2 1 2 0\n0 1 0 0 0\n5 5\n0 0 1 0 0\n2 1 0 2 0\n1 0 0 1 1\n0 2 1 2 0\n0 1 0 0 0\n15 15\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0\n","output":"8\n6\n52694573\n"},{"problem_id":"p00204","input":"100 5\n101 101 5 5\n110 110 2 3\n-112 -100 9 11\n-208 160 82 90\n-110 108 10 2\n10 11\n15 0 5 1\n25 0 5 1\n35 0 5 1\n45 0 5 1\n55 0 5 1\n65 0 5 1\n75 0 5 1\n85 0 5 1\n95 0 5 1\n-20 0 5 20\n-30 0 500 5\n0 0\n","output":"1\n1\n"},{"problem_id":"p00205","input":"1\n2\n3\n2\n1\n1\n2\n2\n2\n1\n0\n","output":"3\n3\n3\n3\n3\n1\n2\n2\n2\n1\n"},{"problem_id":"p00206","input":"10000\n5000 3150\n5000 5000\n0 0\n5000 1050\n5000 3980\n5000 210\n5000 5000\n5000 5000\n0 0\n5000 2100\n5000 2100\n5000 2100\n29170\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 70831\n0\n","output":"6\nNA\n"},{"problem_id":"p00207","input":"20 20\n1 1\n9 9\n7\n2 0 1 1\n5 1 1 3\n2 1 3 3\n1 1 5 2\n5 1 7 3\n2 0 2 7\n2 0 6 8\n20 20\n9 9\n1 1\n6\n2 0 1 1\n1 0 5 1\n2 1 1 3\n5 0 1 7\n3 1 5 5\n4 1 8 5\n0 0\n","output":"OK\nNG\n"},{"problem_id":"p00208","input":"15\n100\n1000000000\n3\n0\n","output":"19\n155\n9358757000\n3\n"},{"problem_id":"p00209","input":"8 4\n2 1 3 1 1 5 1 3\n2 3 2 4 1 0 2 1\n0 3 1 2 1 1 4 2\n1 2 3 2 1 1 5 4\n0 2 0 1 1 3 2 1\n1 3 1 2 2 4 3 2\n5 1 2 1 4 1 1 5\n4 1 1 0 1 2 2 1\n2 -1 -1 -1\n0 3 -1 -1\n-1 2 2 4\n-1 1 -1  1\n5 3\n1 0 2 3 5\n2 3 7 2 1\n2 5 4 2 2\n8 9 0 3 3\n3 6 0 4 7\n-1 -1 2\n-1 3 5\n0 4 -1\n0 0\n","output":"4 2\nNA\n"},{"problem_id":"p00210","input":"10 3\n##########\n#E.......X\n##########\n4 4\n####\n#N.#\n#..X\n####\n5 5\n#####\n#N..#\n###.X\n#S..#\n#####\n6 6\n######\n#..#X#\n#.EE.#\n####N#\n#....#\n######\n8 8\n##X#####\n#....E.#\n#####.##\n#.#...##\n#.W.#..#\n#.#.N#.X\n#X##.#.#\n########\n0 0\n","output":"8\nNA\n9\n16\n10\n"},{"problem_id":"p00211","input":"2\n4 3\n5 4\n5\n789 289\n166 46\n9 4\n617 252\n972 303\n2\n8 5\n32 20\n0\n","output":"15\n16\n1598397732\n1209243492\n1939462992\n1782294192\n1360317793\n1\n1\n"},{"problem_id":"p00212","input":"1 3 3 1 3\n1 3 2000\n1 2 1000\n2 3 1000\n2 3 3 1 3\n1 3 2300\n1 2 1000\n2 3 1200\n2 6 6 5 1\n1 2 1500\n1 3 4500\n2 6 2000\n5 4 1000\n6 4 2200\n3 5 3000\n0 0 0 0 0\n","output":"1000\n1100\n3750\n"},{"problem_id":"p00213","input":"5 4 6\n1 6\n2 4\n3 3\n4 4\n5 1\n6 2\n0 0 1 0 0\n0 0 0 2 0\n0 0 0 3 0\n0 4 5 0 6\n3 3 1\n1 9\n0 0 1\n0 0 0\n0 0 0\n4 4 4\n1 6\n2 2\n3 4\n4 4\n0 1 0 0\n0 0 0 2\n0 0 3 0\n0 4 0 0\n0 0 0\n","output":"1 1 1 2 2\n1 1 1 2 2\n4 4 3 3 3\n4 4 5 6 6\n1 1 1\n1 1 1\n1 1 1\nNA\n"},{"problem_id":"p00214","input":"3\n1\n0 0 0 1 1 1 1 0\n2\n0 0 0 1 1 1 1 0\n100 100 100 200 200 200 200 100\n2\n0 0 0 100 100 100 100 0\n10 10 10 20 20 20 20 10\n2\n1\n30 40 40 50 40 20 20 10\n1\n30 40 40 50 40 20 20 10\n0\n","output":"1\n2\n1\n1\n1\n"},{"problem_id":"p00215","input":"6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n","output":"2 10\nNA\n"},{"problem_id":"p00216","input":"29\n40\n0\n-1\n","output":"620\n-1120\n3130\n"},{"problem_id":"p00217","input":"5\n263 2345 2504\n1 3210 1985\n5000 1501 4132\n10000 503 3107\n51 1758 2690\n3\n345 5000 2396\n7 3910 1590\n6789 2525 3616\n0\n","output":"5000 5633\n345 7396\n"},{"problem_id":"p00218","input":"4\n100 70 20\n98 86 55\n80 34 36\n65 79 65\n2\n99 81 20\n66 72 90\n0\n","output":"A\nA\nB\nC\nA\nB\n"},{"problem_id":"p00219","input":"15\n2\n6\n7\n0\n1\n9\n8\n7\n3\n8\n9\n4\n8\n2\n2\n3\n9\n1\n5\n0\n","output":"*\n*\n***\n*\n*\n-\n*\n**\n***\n**\n-\n*\n-\n-\n-\n*\n-\n-\n-\n*\n"},{"problem_id":"p00220","input":"23.5\n158.1\n-1.0\n","output":"00010111.1000\nNA\n"},{"problem_id":"p00221","input":"5 7\n1\n2\nFizz\n4\nBuzz\n6\n7\n3 5\n1\n2\n3\n4\n5\n0 0\n","output":"2 3 4 5\n1\n"},{"problem_id":"p00222","input":"13\n14\n15\n16\n17\n18\n19\n20\n10000\n0\n","output":"13\n13\n13\n13\n13\n13\n19\n19\n9439\n"},{"problem_id":"p00223","input":"6 6\n2 4\n6 2\n0 0 0 0 1 0\n0 1 0 0 0 0\n0 1 0 0 0 0\n0 0 0 1 0 0\n0 0 0 0 0 1\n0 0 0 0 0 0\n3 3\n1 1\n3 3\n0 0 0\n0 1 0\n0 0 0\n0 0\n","output":"3\nNA\n"},{"problem_id":"p00224","input":"1 1 2 5\n35\nH L1 5\nC1 D 6\nC1 H 12\nL1 D 10\nC1 L1 20\n2 1 4 6\n100 70\nH L1 5\nC1 L1 12\nC1 D 11\nC2 L1 7\nC2 D 15\nL1 D 8\n0 0 0 0\n","output":"1\n-2\n"},{"problem_id":"p00225","input":"5\napple\nyellow\ngeorgia\nking\nemail\n7\napple\nyellow\ngeorgia\nking\nemail\nwink\nlucky\n0\n","output":"NG\nOK\n"},{"problem_id":"p00226","input":"1234 5678\n1234 1354\n1234 1234\n1230 1023\n0123 1234\n0 0\n","output":"0 0\n2 1\n4 0\n1 3\n0 3\n"},{"problem_id":"p00227","input":"4 2\n50 40 100 80\n7 3\n400 300 100 700 200 600 500\n0 0\n","output":"150\n2100\n"},{"problem_id":"p00228","input":"3\n0\n5\n1\n1\n0\n-1\n","output":"0111111\n1010010\n1101011\n0111111\n"},{"problem_id":"p00229","input":"3 2 30 3 26 226\n9 0 18 3 20 118\n5 5 12 2 15 203\n7 4 19 2 22 197\n7 4 24 4 17 209\n0 0 0 0 0 0\n","output":"127\n793\n414\n629\n617\n"},{"problem_id":"p00230","input":"8\n0 0 0 2 2 2 0 0\n1 1 1 1 0 0 0 0\n4\n1 1 2 2\n0 0 2 2\n0\n","output":"4\nNA\n"},{"problem_id":"p00231","input":"3\n80 0 30\n50 5 25\n90 27 50\n3\n80 0 30\n70 5 25\n71 30 50\n0\n","output":"NG\nOK\n"},{"problem_id":"p00232","input":"1 2 0\n1\n1 2 1\n1\n1 2 100\n1 2 1\n2\n1 2 100\n2 2 1\n1 2\n1 2 100\n4 5 3\n1 2 3 4\n1 1 2\n2 2 100\n4 3 60\n0 0 0\n","output":"0\n100\n0\n50\n20\n"},{"problem_id":"p00233","input":"9\n10\n-10\n-1944\n-305432133\n0\n","output":"9\n190\n10\n2156\n1715573947\n"},{"problem_id":"p00234","input":"3 3\n100 10 10\n-100 -20 -100\n-100 -20 -100\n-100 -20 -100\n3 3\n100 10 10\n-100 -20 -100\n-100 -20 -20\n-100 -60 -20\n3 3\n100 10 3\n-100 -20 -100\n-20 -20 -20\n-20 -100 -20\n3 3\n100 3 3\n-100 -20 -30\n-100 -20 2\n-100 -20 -20\n4 5\n1500 5 4\n-10 -380 -250 -250\n-90 2 -80 8\n-250 -130 -330 -120\n-120 -40 -50 -20\n-250 -10 -20 -150\n0 0\n","output":"60\n80\nNA\n50\n390\n"},{"problem_id":"p00235","input":"7\n1 2 5\n2 3 2\n3 4 3\n2 5 3\n5 6 3\n5 7 8\n0\n","output":"12\n"},{"problem_id":"p00236","input":"5 4\n0 0 0 0 0\n0 1 1 0 0\n0 0 1 0 1\n1 0 0 0 1\n5 4\n0 0 0 0 0\n0 1 1 0 0\n0 0 0 0 1\n1 0 0 0 1\n0 0\n","output":"Yes\nNo\n"},{"problem_id":"p00237","input":"3 4\n1 0 3 0 2 1\n2 3 2 5 3 4\n5 3 5 5 6 4\n3 2\n1 0 3 0 2 1\n2 3 2 5 3 4\n5 3 5 5 6 4\n0 0\n","output":"1\n3\n"},{"problem_id":"p00238","input":"10\n3\n6 11\n12 15\n18 22\n14\n2\n6 11\n13 20\n0\n","output":"OK\n2\n"},{"problem_id":"p00239","input":"4\n1 7 14 47\n2 5 35 55\n3 6 3 59\n4 6 5 15\n10 15 50 400\n2\n1 8 10 78\n2 4 18 33\n10 10 50 300\n0\n","output":"1\n4\nNA\n"},{"problem_id":"p00240","input":"2\n8\n1 5 2\n2 6 1\n2\n9\n1 5 2\n2 6 1\n0\n","output":"2\n1\n"},{"problem_id":"p00241","input":"2\n1 2 3 4 7 6 7 8\n5 6 7 8 3 2 3 4\n0\n","output":"-58 16 36 32\n-50 32 28 48\n"},{"problem_id":"p00242","input":"1\nben likes bananas the best among many fruits because bananas are sweet and cheap\nb\n1\nwinners get to visit aizu and the university of aizu and make many friends as well\na\n3\nask alex about\nthe answer for the\nassignment on android apps\na\n2\nprogramming is both\na sport and an intellectual puzzle\nc\n0\n","output":"bananas because ben best\naizu and as\nabout alex android answer apps\nNA\n"},{"problem_id":"p00243","input":"3 3\nR G B\nG G G\nG B B\n2 4\nR G\nG G\nR B\nB R\n4 3\nG G B R\nG R R G\nB G G R\n0 0\n","output":"2\n4\n4\n"},{"problem_id":"p00244","input":"2 1\n1 2 5\n3 2\n1 2 5\n2 3 5\n6 9\n1 2 7\n1 3 9\n1 5 14\n2 3 10\n2 4 15\n3 4 11\n3 5 2\n4 5 9\n4 6 8\n0 0\n","output":"5\n0\n7\n"},{"problem_id":"p00245","input":"6 5\n1 1 . 0 0 4\n1 . . . . .\n. . 2 2 . .\n. . 2 2 3 3\nP . . . . .\n5\n0 50 5 10\n1 20 0 10\n2 10 5 15\n3 150 3 5\n4 100 8 9\n0 0\n","output":"180\n"},{"problem_id":"p00246","input":"5\n4 9 1 3 8\n10\n8 5 3 6 2 1 4 5 4 5\n9\n5 7 3 8 2 9 6 4 1\n0\n","output":"1\n4\n4\n"},{"problem_id":"p00247","input":"5 5\n.X.S.\n.X#..\n.XX##\n.#XG.\n..X..\n7 3\nSXX.XXG\nX.#.#X.\nXXX.XX#\n4 4\nS...\nX.X.\nGX..\n...X\n10 10\n..XXXXX.XX\n.X.#.#X.XX\nSX.#X.X..X\n#X.##.X.XX\n..XXXX#.XX\n##.##.##XX\n....X.XX#X\n.##X..#X#X\n....XX#..X\n...#XXG..X\n0 0\n","output":"11\n10\n10\n33\n"},{"problem_id":"p00248","input":"5 4\n1 2\n2 3\n3 4\n4 5\n4 6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n5 0\n0 0\n","output":"yes\nno\nyes\n"},{"problem_id":"p00249","input":"4 1 1\n0 0\n1 0\n1 2\n0 2\n0 0 0\n","output":"1.000000\n"},{"problem_id":"p00250","input":"5 11\n11 27 34 45 56\n8 5\n0 2 1 5 4 6 8 3\n5 2\n2 4 2 4 6\n10 18\n10 15 12 31 12 50 11 23 43 181\n1 100\n5\n0 0\n","output":"8\n4\n0\n17\n5\n"},{"problem_id":"p00251","input":"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n","output":"55\n"},{"problem_id":"p00252","input":"0 0 1\n","output":"Open\n"},{"problem_id":"p00253","input":"5\n1 2 3 6 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9 11 12\n0\n","output":"6\n1\n12\n"},{"problem_id":"p00254","input":"6174\n2012\n3333\n0000\n","output":"0\n3\nNA\n"},{"problem_id":"p00255","input":"3\n1 1 1\n3 3\n4\n3 3 3 3\n1 1 1\n5\n1 2 3 4 5\n4 3 2 1\n0\n","output":"12\n48\n76\n"},{"problem_id":"p00256","input":"2012.12.31\n2.12.16.14.14\n7138.5.13\n10.5.2.1.5\n10000000.12.31\n#\n","output":"0.0.0.0.10\n3054.8.15\n0.0.0.0.10\n6056.2.29\n8.19.3.13.2\n"},{"problem_id":"p00257","input":"3\n3\n-2\n1\n0\n2\n4\n2\n0\n-1\n-2\n2\n2\n-2\n-2\n0\n","output":"OK\nNG\nNG\n"},{"problem_id":"p00258","input":"2 2\n0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1\n1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0\n0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1\n1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0\n2 2\n0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0\n0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0\n0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0\n0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0\n5 3\n0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0\n1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1\n0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0\n0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0\n0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0\n0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0\n1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0\n0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1\n0 0\n","output":"8\n7\n16\n"},{"problem_id":"p00259","input":"5: 2 - 3\n17: 1 + 3 * (2 + 3 \/ 5 * 2) + 7\n11: 1 \/ 8 - 5 - 8 * 2\n19: 8 \/ (2 - 3 * 7)\n1153: 10 * 3 \/ 7 + ( 50 + 81 \/ 22 ) + 11\n0:\n","output":"2-3 = 4 (mod 5)\n1+3*(2+3\/5*2)+7 = 4 (mod 17)\n1\/8-5-8*2 = 8 (mod 11)\nNG\n10*3\/7+(50+81\/22)+11 = 915 (mod 1153)\n"},{"problem_id":"p00260","input":"8\n0 0\n3 2\n6 2\n8 6\n6 5\n7 7\n0 4\n3 4\n8\n0 0\n5 3\n5 2\n4 1\n6 1\n8 6\n6 4\n2 4\n0\n","output":"1\n2\n"},{"problem_id":"p00261","input":"0100\n0101\n10100\n01000\n0101011\n0011\n011111\n#\n","output":"Yes\nNo\nYes\nNo\nYes\nNo\nYes\n"},{"problem_id":"p00262","input":"6\n1 4 1 3 2 4\n5\n1 2 3 4 5\n10\n1 1 1 1 1 1 1 1 1 1\n9\n1 1 1 1 1 1 1 1 1\n12\n1 4 1 3 2 4 3 3 2 1 2 2\n1\n5050\n3\n10000 10000 100\n0\n","output":"24\n0\n10\n-1\n48\n5049\n-1\n"},{"problem_id":"p00263","input":"8\n00000000\n80000000\n00000080\n00000040\n000000c0\n00000100\n80000780\n80000f70\n","output":"0.0\n-0.0\n1.0\n0.5\n1.5\n2.0\n-15.0\n-30.875\n"},{"problem_id":"p00264","input":"6 3\n2 1\n1 2\n5 2\n1 3\n1 5\n-2 3\n1 1 1 90 30 45\n3 -4\n-3 0\n2 -2\n45 6\n90 6\n135 6\n2 1\n1 3\n5 2\n0 1 1 90 30 45\n-3 0\n2 -2\n45 6\n0 0\n","output":"5 6\nNA\n"},{"problem_id":"p00265","input":"3 3\n9 3 8\n4\n6\n5\n","output":"3\n3\n4\n"},{"problem_id":"p00266","input":"3\n2\n1 2\n2 3\n4\n2\n2 3\n2 4\n0\n","output":"3\n4\n"},{"problem_id":"p00267","input":"10\n4 9 1 9 5 9 2 3 2 1\n8 7 6 5 10 5 5 4 7 6\n5\n4 3 2 5 1\n4 4 4 4 4\n4\n4 1 3 2\n4 3 2 1\n0\n","output":"3\n1\nNA\n"},{"problem_id":"p00268","input":"4 4\n0 0\n1 0\n1 1\n0 1\n1 2\n1 4\n2 3\n3 4\n12 22\n2 0\n4 0\n8 0\n4 2\n6 2\n8 2\n2 4\n4 4\n6 4\n0 6\n8 6\n0 8\n1 2\n2 3\n1 4\n1 7\n1 10\n2 4\n2 5\n3 5\n3 6\n4 5\n4 8\n5 6\n5 9\n6 9\n6 11\n7 10\n7 8\n8 9\n9 11\n10 11\n10 12\n11 12\n0 0\n","output":"1\n3\n"},{"problem_id":"p00269","input":"2 2 1\n5 3\n2 2\n3 3 1\n2 0\n1 2\n2 2\n1 1\n2 2 1\n5 3\n2 2\n3 2 1\n2 0\n1 2\n2 2\n1 1\n2 2 2\n5 3\n2 2\n3 2 1\n2 0\n1 2\n2 2\n1 1\n4 3 1\n2 2 1\n3 2 2\n2 3 3\n1 2 2\n5 4 3\n1 1 0\n1 0 1\n1 0 2\n1 1 2\n2 2 2\n1 0 1\n2 0 2\n1 1 1\n0 0 0\n","output":"-1\n9\n6\n7\n"},{"problem_id":"p00270","input":"6 7\n1 2 3\n1 4 1\n2 3 5\n4 3 1\n3 6 2\n4 5 2\n5 6 1\n1 6 6\n1 6\n4 3\n4 6\n5 6\n2 6\n2 5\n","output":"Yes\nYes\nYes\nYes\nNo\nNo\n"},{"problem_id":"p00271","input":"30 19\n39 20\n19 18\n25 20\n22 21\n23 10\n10 -10\n","output":"11\n19\n1\n5\n1\n13\n20\n"},{"problem_id":"p00272","input":"3 10\n1 4\n4 1\n2 5\n","output":"30000\n24000\n2000\n20000\n"},{"problem_id":"p00273","input":"2\n100 100 1 1\n1000 500 5 2\n","output":"200\n4800\n"},{"problem_id":"p00274","input":"2\n3 2\n3\n0 1 1\n1\n1000\n0\n","output":"3\nNA\n2\n"},{"problem_id":"p00275","input":"2\nSSSSSSSSSSSSSSSLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n2\nSSSSSSSSSSSSSSLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSL\n5\nMMMMMMSLSLLMMMSMMSLMMMLMMMMLSLLLLMLSMMLMMLLMSSSLMMMMLMLSMLMSMMMMMMMSMMMMMMLMMMMMSMMMLMMLMMMMMMMMMSSM\n0\n","output":"42 58 0\n0 100 0\n0 0 3 10 59 28\n"},{"problem_id":"p00276","input":"4\n3 0 0\n1 1 1\n9 4 1\n0 1 2\n","output":"1\n1\n4\n0\n"},{"problem_id":"p00277","input":"3 4 600\n3 100 5\n1 200 10\n2 400 20\n3 500 20\n","output":"1\n"},{"problem_id":"p00278","input":"5 8\n5\n10\n8\n7\n3\nADD 1\nADD 3\nCHECK 0\nCHECK 1\nCHECK 2\nCHECK 3\nCHECK 4\nCHECK 5\n","output":"NA\n2\n1\n0\n0\n0\n"},{"problem_id":"p00279","input":"5\n0 0\n3 0\n5 2\n1 4\n0 3\n3\n3\n4\n5\n","output":"1 4 5\n1 2 4 5\n1 2 3 4 5\n"},{"problem_id":"p00280","input":"2 2\n","output":"AABB\nABAB\nABBA\nBAAB\nBABA\nBBAA\n"},{"problem_id":"p00281","input":"4 6\n1 2 1\n2 3 2\n2 4 3\n3 1 5\n4 2 4\n4 3 2\n4 6 10\n0 0 0\n3\n1 3 2 4 0 10\n6 5 4 3 2 1\n5 1 1 5 5 1\n","output":"3 16 5 116\n5 17 30 38\n1 17 25 16\n"},{"problem_id":"p00282","input":"2 10\n5 20\n10 8\n20 17\n0 0\n","output":"1024\n95Cho3674Oku3164Man625\n1Oku\n131Gai720Kei\n"},{"problem_id":"p00283","input":"15 4\n1 1 0\n1 2 2\n5 10 5\n8 1 15\n60 4\n5 2 0\n8 8 2\n3 5 0\n49 0 18\n100 1\n1 1 1\n0 0\n","output":"6\n4\nNA\n"},{"problem_id":"p00284","input":"3\n0 7\n-1048576 0\n-3 5\n","output":"3\n1\n4\n"},{"problem_id":"p00285","input":"3 3\n0 20 30\n10 20 30\n10 10\n32 10 15 8 20 10 6 45 50 41\n18 0 37 25 45 11 25 21 32 27\n7 3\n23 14 39 6 47 16 23\n19 37 8\n0 0\n","output":"12000\n53906\n11629\n"},{"problem_id":"p00286","input":"5 2\nA 5\n1 0 0 1\n0 1 0 0\n1 0 1 0\n0 1 0 1\nB 4\n1 0 0 1\n0 1 0 0\n0 0 1 0\n2\n2(A+B)\n1000000000(1000000000A+1000000000B)\n","output":"4 2 5 1 3\n1 2 3 4 5\n"},{"problem_id":"p00287","input":"5 6 5\n0 2 5 2\n0 3 5 3\n0 4 3 4\n1 4 1 6\n3 0 3 6\n2\n2 5 4 1\n2 5 4 5\n","output":"3\n1\n"},{"problem_id":"p00288","input":"1 1 1\n0 0\n0 0 1 0\n1 1 0\n0 0\n-3 0 2 3\n1 3 1\n0 0\n-3 0 2 3\n0 -5 2 0\n4 0 2 1\n4 3 1\n0 0\n0 0\n0 0\n0 0\n-3 0 2 3\n0 -5 2 0\n4 0 2 1\n6 3 1\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n-3 0 2 3\n0 -5 2 0\n4 0 2 1\n6 3 2\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n-3 0 2 3\n0 -5 2 0\n4 0 2 1\n10 5 1\n0 0\n2 0\n4 0\n8 0\n100 0\n100 0\n100 0\n100 0\n100 0\n100 0\n-3 0 1 0\n1 0 1 0\n3 0 2 0\n15 0 1 0\n105 0 6 0\n10 5 2\n0 0\n2 0\n4 0\n8 0\n100 0\n100 0\n100 0\n100 0\n100 0\n100 0\n-3 0 1 0\n1 0 1 0\n3 0 2 0\n15 0 1 0\n105 0 6 0\n0 0 0\n","output":"0\n3\n5\n11\n18\n28\n20\n38\n"},{"problem_id":"p00289","input":"6 7\n1 2\n2 3\n1 3\n1 4\n4 5\n5 6\n6 1\n5\n2\n3\n4\n5\n6\n","output":"2\n3\n4\n4\n5\n"},{"problem_id":"p00290","input":"20 2\n","output":"40\n"},{"problem_id":"p00291","input":"3 1 4 0 4 1\n","output":"0\n"},{"problem_id":"p00292","input":"3\n10 3\n2 10\n4 2\n","output":"1\n2\n2\n"},{"problem_id":"p00293","input":"2 9 8 15 59\n1 8 27\n","output":"8:27 9:08 15:59\n"},{"problem_id":"p00294","input":"5 4 0\n1\n2\n3\n4\n","output":"400\n"},{"problem_id":"p00295","input":"4\n1 1 1 1 1 1 1 1 1 2 2 2 4 4 4 6 6 6 5 5 5 3 3 3 3 3 3 3 3 3\n3 3 3 1 1 1 1 1 1 2 2 2 4 4 6 4 6 6 5 5 5 3 3 3 3 3 3 1 1 1\n3 3 3 1 1 3 1 1 1 2 2 5 6 4 4 4 6 6 2 5 5 3 3 3 1 3 3 1 1 1\n1 3 1 3 1 3 3 1 3 2 2 2 6 4 4 6 6 4 5 5 5 1 3 1 1 3 1 3 1 3\n","output":"0\n1\n2\n7\n"},{"problem_id":"p00296","input":"10 5 3\n2 6 5 18 3\n3 0 5\n","output":"1\n0\n1\n"},{"problem_id":"p00297","input":"9 2\n1 1 1\n1 5 12\n2 3 2\n3 2 4\n4 4 1\n5 1 3\n5 3 8\n6 5 5\n7 2 4\n","output":"16\n"},{"problem_id":"p00298","input":"3\n150 120\n100 50\n80 100\n","output":"1\n"},{"problem_id":"p00299","input":"3 2\n1\n","output":"3\n"},{"problem_id":"p00300","input":"4\n300 120\n300 105\n250 105\n250 90\n","output":"23\n18 23\n17 18 22 23\n17 18\n"},{"problem_id":"p00301","input":"25\n","output":"+0-+\n"},{"problem_id":"p00302","input":"1 10 20\n1\n","output":"11\n"},{"problem_id":"p00303","input":"4\n1 lock 1\n2 lock 2\n1 wait 2\n2 wait 1\n","output":"1\n"},{"problem_id":"p00304","input":"12\nA\nE\nE\nE\nR?\nE?\nE?\nE\nE\nE\nE?\nE\n1 2\n1 3\n1 4\n2 5\n4 6\n4 7\n5 8\n5 9\n7 10\n7 11\n11 12\n","output":"11\n"},{"problem_id":"p00305","input":"5\n2 0 0 2 0\n0 1 0 2 0\n0 0 0 -1 0\n0 4 0 3 0\n-1 0 0 1 0\n","output":"12\n"},{"problem_id":"p00306","input":"90 10\n","output":"0.0\n"},{"problem_id":"p00307","input":"3 4\n2 2\n3 3\n4 4\n3 3\n4 4\n1 1\n2 2\n","output":"3\n"},{"problem_id":"p00308","input":"6\noooxxxx\nooooxxx\noxxooxxo\nooxx\noo\nooo\n","output":"-1\n7\nsplit 0 0\njoin 2 1\nsplit 3 4\nsplit 4 0\njoin 7 6\nsplit 8 2\nsplit 9 0\n3\nsplit 0 1\nsplit 2 1\nsplit 4 1\n-1\n0\n1\nsplit 0 0\n"},{"problem_id":"p00309","input":"6 7\n1 2 1\n2 3 2\n3 1 3\n4 5 4\n5 6 5\n6 4 6\n1 4 7\n","output":"7 18\n"},{"problem_id":"p00310","input":"10 10 20\n","output":"40\n"},{"problem_id":"p00311","input":"5 1\n3 1\n1 2 5 5\n","output":"hiroshi\n"},{"problem_id":"p00312","input":"10 5\n","output":"2\n"},{"problem_id":"p00313","input":"5\n3 1 2 3\n2 4 5\n2 3 4\n","output":"1\n"},{"problem_id":"p00314","input":"7\n5 4 3 10 2 4 1\n","output":"4\n"},{"problem_id":"p00315","input":"7 8\n00100000\n00011000\n10111101\n01100110\n01000110\n10111101\n00011000\n00100100\n2\n5 3\n1 6\n1\n6 8\n3\n6 8\n3 3\n3 6\n2\n6 3\n6 6\n0\n2\n3 8\n6 8\n","output":"3\n"},{"problem_id":"p00316","input":"3 2 5\n1 1 2\n1 2 3\n2 1 1\n2 3 2\n2 2 1\n","output":"4\n"},{"problem_id":"p00317","input":"5 4\naloe\napple\napricot\ncactus\ncat\napple\nap*\n*e\nca?*\n","output":"1\n2\n2\n2\n"},{"problem_id":"p00318","input":"2\n0 2\n1 2\n","output":"1.936\n"},{"problem_id":"p00319","input":"3 3\n1 2 1 2\n2 3 1 2\n1 3 1 3\n","output":"3\n"},{"problem_id":"p00320","input":"2 2\n2 3\n2 3\n2 3\n2 2\n3 2\n","output":"yes\n"},{"problem_id":"p00321","input":"5 2\n3 bread milk banana\n2 milk cornflakes\n3 potato bread milk\n4 cornflakes bread milk butter\n2 potato bread\n","output":"3\nbread milk\nbread potato\ncornflakes milk\n"},{"problem_id":"p00322","input":"7 6 -1 1 -1 9 2 3 4\n","output":"1\n"},{"problem_id":"p00323","input":"3\n2 1\n1 3\n2 2\n","output":"3 0\n5 0\n"},{"problem_id":"p00324","input":"5\n18\n102\n-155\n53\n32\n","output":"3\n"},{"problem_id":"p00325","input":"6\n10 SET c 1\n20 SET i 5\n100 ADD s s i\n110 SUB i i c\n120 IF i 100\n200 HALT\n","output":"c=1\ni=0\ns=15\n"},{"problem_id":"p00326","input":"5 3\n1 5 2\n3 8 5\n1 2 3\n5 5 5\n4 8 2\n0\n1 2 3\n2\n2 2 3 1\n4 3 1 2\n","output":"4\n5\n2\n1\n3\n"},{"problem_id":"p00327","input":"8\n1 2 3 3 2 1 2 2\n","output":"yes\n"},{"problem_id":"p00328","input":"9\n0 2 5 2\n1 3 1 7\n0 6 3 6\n2 4 8 4\n4 0 4 5\n6 3 6 0\n5 6 7 6\n8 3 8 7\n6 5 11 5\n","output":"1\n1\n0\n1\n0\n1\n1\n0\n1\n"},{"problem_id":"p00329","input":"6\n1 0 0 0 1\n1 0 1 0 1\n0 1 0 1 0\n0 0 0 1 0\n0 1 0 0 1\n","output":"yes\n1\n3\n2\n4\n5\n"},{"problem_id":"p00330","input":"4\n","output":"128\n"},{"problem_id":"p00331","input":"-3 3\n","output":"0\n"},{"problem_id":"p00332","input":"0 2015\n","output":"H27\n"},{"problem_id":"p00333","input":"10 20 5\n","output":"10\n"},{"problem_id":"p00334","input":"4\n1 3 2\n1 2 4\n1 4 3\n2 3 4\n","output":"0\n"},{"problem_id":"p00335","input":"3\n1 2 1\n","output":"4\n"},{"problem_id":"p00336","input":"abab\nab\n","output":"3\n"},{"problem_id":"p00337","input":"5 5\n0 0\n1 1\n3 0\n3 2\n0 2\n1 2\n2 3\n2 4\n3 4\n1 5\n","output":"11.4142\n"},{"problem_id":"p00338","input":"3 11\n0 2 5\n0 1 5\n0 3 4\n1 1\n1 2\n1 3\n0 3 2\n1 1\n0 2 1\n1 2\n1 3\n","output":"1 5\n2 5\n3 4\n3 6\n3 6\n1 5\n"},{"problem_id":"p00339","input":"5 4\n3 3\n2 1\n1 5\n4 2\n2 6\n4 1\n8 2\n10 4\n12 17\n","output":"2\n"},{"problem_id":"p00340","input":"1 1 3 4\n","output":"no\n"},{"problem_id":"p00341","input":"1 1 3 4 8 9 7 3 4 5 5 5\n","output":"no\n"},{"problem_id":"p00342","input":"10\n1 2 3 4 5 6 7 8 9 10\n","output":"19.00000\n"},{"problem_id":"p00343","input":"5\n1 2 3 4 5 6\n1 3 5 6 8 4\n1 2 3 4 5 8\n1 2 4 5 10 11\n1 2 3 6 9 11\n","output":"yes\nyes\nno\nyes\nno\n"},{"problem_id":"p00344","input":"3\n1 1 1\n","output":"3\n"},{"problem_id":"p00345","input":"0.(3)\n","output":"1\/3\n"},{"problem_id":"p00346","input":"4 5\n1 2 2\n1 3 2\n2 3 1\n2 4 2\n3 4 1\n","output":"1\n2\n"},{"problem_id":"p00347","input":"2 1\n-2 1\n","output":"1\n"},{"problem_id":"p00348","input":"6\n1 3 6 5 8 2\n","output":"10\n"},{"problem_id":"p00349","input":"3 3 3\n2 1 S\n1 2 E\n2 2 E\n","output":"3\n1\n2\n"},{"problem_id":"p00350","input":"13\naizualgorithm\n9\ncomp 1 1 4 5\ncomp 2 6 1 5\nset 9 12 b\ncomp 9 9 10 10\ncomp 5 8 1 4\nset 1 10 z\nset 11 13 x\ncomp 8 10 1 5\ncomp 1 5 1 5\n","output":"s\nt\ne\nt\ns\ne\n"},{"problem_id":"p00351","input":"0 2\n","output":"0.00000000\n"},{"problem_id":"p00352","input":"1000 3000\n","output":"2000\n"},{"problem_id":"p00353","input":"1000 3000 3000\n","output":"2000\n"},{"problem_id":"p00354","input":"1\n","output":"fri\n"},{"problem_id":"p00355","input":"5 7\n3\n1 4\n4 5\n7 10\n","output":"0\n"},{"problem_id":"p00356","input":"4 4\n","output":"5\n"},{"problem_id":"p00357","input":"4\n20\n5\n10\n1\n","output":"no\n"},{"problem_id":"p00358","input":"5 3\n0 1\n1 2\n3 3\n","output":"2\n"},{"problem_id":"p00359","input":"5 4 4\n0 3\n1 1\n2 2\n2 3\n","output":"2\n"},{"problem_id":"p00360","input":"pckoshien\n3\n","output":"ckopshien\n"},{"problem_id":"p00361","input":"6 7\n0 2\n2 1\n1 0\n2 3\n4 3\n4 5\n5 4\n","output":"2\n"},{"problem_id":"p00362","input":"6 3\n0 1 1\n0 2 1\n0 3 1\n2 4 1\n2 5 1\n3\nsend 1 4\nadd 2 2\nsend 1 4\n","output":"3\n1\n"},{"problem_id":"p00363","input":"3 3 B\n","output":"+-+\n|B|\n+-+\n"},{"problem_id":"p00364","input":"3 10\n6 4\n4 2\n3 2\n","output":"6.666667\n"},{"problem_id":"p00365","input":"1999 9 9\n2001 11 3\n","output":"3\n"},{"problem_id":"p00366","input":"3\n3\n6\n8\n","output":"3\n"},{"problem_id":"p00367","input":"5\n1 0 2 0 3 30 4 30 6 0 7 0\n2 30 3 0 4 0 5 0 5 30 6 30\n1 30 2 30 4 30 5 0 6 30 7 0\n2 30 3 0 5 0 6 0 6 30 7 0\n1 0 2 0 3 0 3 30 4 0 5 0\n","output":"3\n"},{"problem_id":"p00368","input":"3 2\n1 1 0\n0 0 1\n","output":"yes\n"},{"problem_id":"p00369","input":"11121314\n","output":"3\n"},{"problem_id":"p00370","input":"0 0\n4 0\n4\n1 1\n2 1\n3 3\n1 2\n","output":"4.472136\n"},{"problem_id":"p00371","input":"3 2 7\n8\n3\n6\n5\n2 2\n3 2\n4 1\n6 1\n6 0\n","output":"yes\nno\nyes\nno\nyes\n"},{"problem_id":"p00372","input":"7 8\n0 1\n1 2\n1 3\n2 3\n0 4\n4 5\n4 6\n5 6\n","output":"6\n"},{"problem_id":"p00373","input":"5 5 3 3\nAF??z\nW?p88\n???Hk\npU?m?\nF???c\nF??\np?8\n?H?\n","output":"4\n"},{"problem_id":"p00374","input":"18 8 3 6\n4\n3\n3\n3\n3\n2\n2\n2\n1\n1\n1\n1\n1\n2\n2\n3\n3\n3\n1\n1\n1\n1\n1\n1\n1\n1\n","output":"3\n"},{"problem_id":"p00375","input":"68\n","output":"19\n"},{"problem_id":"p00376","input":"20 30\n","output":"10\n"},{"problem_id":"p00377","input":"5 4\n5 5 6 5\n","output":"4\n"},{"problem_id":"p00378","input":"180 100 2400\n","output":"460\n"},{"problem_id":"p00379","input":"16 2 1000\n","output":"3\n"},{"problem_id":"p00380","input":"6\n9 7 5 6 3 1\n3\n1 6\n2 5\n3 4\n","output":"2\n"},{"problem_id":"p00381","input":"6\nabbaba\nbaabab\n","output":"5\n"},{"problem_id":"p00382","input":"3\n3 8 10 1\n4 7 1 2 15\n3 11 8 19\n","output":"45\n"},{"problem_id":"p00383","input":"5 4\n0 0\n1 0\n1 1\n0 1\n2 2\n","output":"0\n"},{"problem_id":"p00384","input":"7\n6\n1\n-1\n4\n3\n3\n1\n1 2\n2 3\n3 4\n3 5\n5 6\n5 7\n","output":"10\n"},{"problem_id":"p00385","input":"5 3 1\n1 -2 0\n2 3\n","output":"-3\n"},{"problem_id":"p00386","input":"5 4\n1 2 3\n2 3 4\n2 4 2\n4 5 3\n1 3 4\n1 4 5\n1 2 3\n2 4 5\n","output":"4\n5\n4\n3\n"},{"problem_id":"p00387","input":"3 5\n","output":"2\n"},{"problem_id":"p00388","input":"100 2 4\n","output":"2\n"},{"problem_id":"p00389","input":"4 2\n","output":"3\n"},{"problem_id":"p00390","input":"5\n1 0 0 1 0\n2 3 5 1 2\n","output":"3\n"},{"problem_id":"p00391","input":"5 4\n0 2 2 1 1\n1 1 1 3\n","output":"1\n"},{"problem_id":"p00392","input":"5\n6 4 2 3 7\n","output":"1\n"},{"problem_id":"p00393","input":"4 3\n","output":"3\n"},{"problem_id":"p00394","input":"3 2 2\n3 2 1\n1 2 3\n1 2\n","output":"26\n"},{"problem_id":"p00395","input":"12 5\n.....S......\n.abcdefghij.\n.0123456789.\n.ABCDEFGHIJ.\n.....T......\n0 1 0 0 0 0 0 0 0 0\n2 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n","output":"26 2\n"},{"problem_id":"p00396","input":"4\n24 99\n15 68\n12 90\n95 79\n","output":"0\n"},{"problem_id":"p00397","input":"3 3\n1 2 3\n","output":"2\n"},{"problem_id":"p00398","input":"3\n1 2\n3 4\n10 1\n","output":"9\n"},{"problem_id":"p00399","input":"4 2 1 1\n","output":"8\n"},{"problem_id":"p00400","input":"67\n","output":"1\n"},{"problem_id":"p00401","input":"54\n","output":"32\n"},{"problem_id":"p00402","input":"3\n4 0 1\n","output":"2\n"},{"problem_id":"p00403","input":"4\n1 2 -3 -1\n","output":"3\n"},{"problem_id":"p00404","input":"0 0\n","output":"1\n"},{"problem_id":"p00405","input":"3\n3 5 2\n","output":"7\n"},{"problem_id":"p00406","input":"2 10\n3 0\n6 1\n","output":"6\n"},{"problem_id":"p00407","input":"6\n0 0\n4 0\n6 3\n5 5\n1 5\n0 3\n5\n2 2\n6 6\n3 1\n5 1\n-1 -1\n","output":"1\n0\n1\n0\n0\n"},{"problem_id":"p00408","input":"3\n1 2\n1 3\n","output":"2\n"},{"problem_id":"p00409","input":"6 5\nababac\n6 b\n3 c\n4 a\n5 b\n6 c\n","output":"2\n6\n6\n6\n3\n"},{"problem_id":"p00410","input":"5 4\n2\n1\n3\n6\n4\n1 2\n2 3\n2 4\n4 5\n","output":"14\n"},{"problem_id":"p00411","input":"180 120 90\n","output":"60.0\n"},{"problem_id":"p00412","input":"2 7\n1 999\n1 1000\n0 2\n1 1001\n1 1002\n0 1\n0 1\n","output":"1000\n999\n1002\n"},{"problem_id":"p00413","input":"0 0 4 5\n2 2 3 6\n","output":"26\n"},{"problem_id":"p00414","input":"3 2\nooo\n","output":"21\n"},{"problem_id":"p00415","input":"7 3\n1 4 1 4 2 1 3\n","output":"4423\n"},{"problem_id":"p00416","input":"6\n2 2 3 2 2 2\n","output":"1\n"},{"problem_id":"p00417","input":"3 2 100000007\n","output":"2\n"},{"problem_id":"p00418","input":"3 2\n5 1\n10 4\n6 2\n2 1 3\n3 2 1\n","output":"45\n"},{"problem_id":"p00419","input":"4\naedb\naeb\nebCd\ncdE\n","output":"1\n"},{"problem_id":"p00420","input":"6 5 8\n1 3\n2 5\n3 4\n2 4\n2 5\n1 1 5 1\n1 1 5 2\n1 1 5 3\n1 1 5 4\n1 1 5 5\n1 1 5 6\n2 3 4 2\n1 1 1 1\n","output":"3\n2\n4\n5\n1\n6\n4\n3\n"},{"problem_id":"p00421","input":"1 1\n","output":"8\n"},{"problem_id":"p00423","input":"3\n9 1\n5 4\n0 8\n3\n9 1\n5 4\n1 0\n3\n9 1\n5 5\n1 8\n0\n","output":"19 8\n20 0\n15 14\n"},{"problem_id":"p00424","input":"3\nA a\n0 5\n5 4\n10\nA\nB\nC\n0\n1\n4\n5\na\nb\nA\n3\nA a\n0 5\n5 4\n10\nA\nB\nC\n0\n1\n4\n5\na\nb\nA\n0\n","output":"aBC5144aba\naBC5144aba\n"},{"problem_id":"p00425","input":"5\nNorth\nNorth\nEast\nSouth\nWest\n8\nWest\nNorth\nLeft\nSouth\nRight\nNorth\nLeft\nEast\n0\n","output":"21\n34\n"},{"problem_id":"p00426","input":"3 10\n0\n1 1\n2 2 3\n4 20\n2 1 2\n1 3\n1 4\n2 5\n2 1 2\n0\n0\n3 3\n0\n1 1\n2 2 3\n0 0\n","output":"9\n3\n0\n-1\n"},{"problem_id":"p00427","input":"2 1 0 5\n3 1 1 3\n2 2 1 3\n0 0 0 0\n","output":"0.50000\n0.833\n1.000\n"},{"problem_id":"p00428","input":"4 6\n1 0 1 0 1 1\n1 1 0 1 0 0\n1 1 1 0 0 0\n1 0 1 0 1 0\n4 6\n1 0 1 0 1 1\n1 1 0 1 0 0\n1 1 1 0 0 0\n1 0 1 0 1 0\n0 0\n","output":"1 3 2 5 4 6\n1 3 2 5 4 6\n"},{"problem_id":"p00429","input":"5\n11\n5\n11\n0\n","output":"13112221\n13112221\n"},{"problem_id":"p00430","input":"5\n5\n0\n","output":"5\n4 1\n3 2\n3 1 1\n2 2 1\n2 1 1 1\n1 1 1 1 1\n5\n4 1\n3 2\n3 1 1\n2 2 1\n2 1 1 1\n1 1 1 1 1\n"},{"problem_id":"p00431","input":"7\n1 3\n3 4\n1 4\n2 7\n5 7\n6 7\n1 7\n6\n1 2\n2 3\n3 4\n4 5\n1 5\n2 6\n7\n1 3\n2 4\n3 5\n4 6\n6 7\n2 6\n4 7\n0\n","output":"5\n6\n4\n"},{"problem_id":"p00432","input":"5 1\n0 0 3 2\n1 1 2 5\n0 4 6 5\n3 3 5 6\n5 0 7 6\n5 2\n0 0 3 2\n1 1 2 5\n0 4 6 5\n3 3 5 6\n5 0 7 6\n2 2\n0 0 8 9\n0 0 9 8\n3 2\n2 2 8 8\n3 0 4 9\n5 0 7 9\n0 0\n","output":"29\n29\n38\n80\n36\n45\n36\n"},{"problem_id":"p00433","input":"100 80 70 60\n80 70 80 90\n","output":"320\n"},{"problem_id":"p00434","input":"3\n1\n4\n5\n7\n9\n6\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n","output":"2\n8\n"},{"problem_id":"p00435","input":"MRL\n","output":"JOI\n"},{"problem_id":"p00436","input":"2\n2\n1\n0\n","output":"2\n4\n3\n1\n"},{"problem_id":"p00437","input":"2 2 2\n4\n2 4 5 0\n2 3 6 0\n1 4 5 0\n2 3 5 1\n0 0 0\n","output":"2\n1\n1\n0\n1\n0\n"},{"problem_id":"p00438","input":"5 4\n3\n2 2\n2 3\n4 2\n5 4\n3\n2 2\n2 3\n4 2\n0 0\n","output":"5\n5\n"},{"problem_id":"p00439","input":"5 3\n2\n5\n-4\n10\n3\n0 0\n","output":"11\n"},{"problem_id":"p00440","input":"7 5\n6\n2\n4\n7\n1\n7 5\n6\n2\n0\n4\n7\n0 0\n","output":"2\n4\n"},{"problem_id":"p00441","input":"10\n9 4\n4 3\n1 1\n4 2\n2 4\n5 8\n4 0\n5 3\n0 5\n5 2\n10\n9 4\n4 3\n1 1\n4 2\n2 4\n5 8\n4 0\n5 3\n0 5\n5 2\n0\n","output":"10\n10\n"},{"problem_id":"p00442","input":"4\n5\n1 2\n3 1\n3 2\n3 4\n4 1\n","output":"3\n4\n1\n2\n0\n"},{"problem_id":"p00443","input":"1\n6 9 0 0\n4\n3 2 0 4\n1 3 0 0\n4 4 2 1\n2 2 0 0\n0\n","output":"5\n40\n"},{"problem_id":"p00444","input":"380\n1\n0\n","output":"4\n15\n"},{"problem_id":"p00445","input":"JOIJOI\nJOIOIOIOI\nJOIOIJOINXNXJIOIOIOJ\n","output":"2\n0\n1\n3\n2\n3\n"},{"problem_id":"p00446","input":"5\n1\n7\n9\n6\n10\n10\n8\n7\n14\n18\n4\n11\n3\n17\n5\n19\n0\n","output":"3\n0\n2\n0\n"},{"problem_id":"p00447","input":"5\n8 5\n6 4\n4 3\n7 10\n0 10\n10\n10 5\n2 7\n9 7\n8 10\n10 2\n1 2\n8 1\n6 7\n6 0\n0 9\n5\n904207 809784\n845370 244806\n499091 59863\n638406 182509\n435076 362268\n10\n757559 866424\n114810 239537\n519926 989458\n461089 424480\n674361 448440\n81851 150384\n459107 795405\n299682 6700\n254125 362183\n50795 541942\n0\n","output":"2 -3\n-384281 179674\n"},{"problem_id":"p00448","input":"2 5\n0 1 0 1 0\n1 0 0 0 1\n3 6\n1 0 0 0 1 0\n1 1 1 0 1 0\n1 0 1 1 0 1\n0 0\n","output":"9\n15\n"},{"problem_id":"p00449","input":"3 8\n1 3 1 10\n0 2 3\n1 2 3 20\n1 1 2 5\n0 3 2\n1 1 3 7\n1 2 1 9\n0 2 3\n5 16\n1 1 2 343750\n1 1 3 3343\n1 1 4 347392\n1 1 5 5497\n1 2 3 123394\n1 2 4 545492\n1 2 5 458\n1 3 4 343983\n1 3 5 843468\n1 4 5 15934\n0 2 1\n0 4 1\n0 3 2\n0 4 2\n0 4 3\n0 5 3\n0 0\n","output":"-1\n15\n12\n5955\n21431\n9298\n16392\n24774\n8840\n"},{"problem_id":"p00450","input":"8\n1\n0\n1\n1\n0\n0\n0\n0\n8\n1\n0\n1\n1\n0\n0\n0\n1\n0\n","output":"6\n2\n"},{"problem_id":"p00451","input":"ABRACADABRA\nECADADABRBCRDARA\nUPWJCIRUCAXIIRGL\nSBQNYBSBZDFNEV\n","output":"5\n0\n"},{"problem_id":"p00452","input":"4 50\n3\n14\n15\n9\n3 21\n16\n11\n2\n0 0\n","output":"48\n20\n"},{"problem_id":"p00453","input":"5 1\n2 1 3 2 2\n1 3 2\n1 1 7\n1 2 1\n1 4 4\n5 0\n2 1 3 2 2\n1 3 2\n1 1 7\n1 2 1\n1 4 4\n0 0\n","output":"17\n40\n"},{"problem_id":"p00454","input":"15 6\n10\n1 4 5 6\n2 1 4 5\n1 0 5 1\n6 1 7 5\n7 5 9 6\n7 0 9 2\n9 1 10 5\n11 0 14 1\n12 1 13 5\n11 5 14 6\n0 0\n","output":"5\n"},{"problem_id":"p00455","input":"9 0 0 18 0 0\n9 0 1 18 0 0\n12 14 52 12 15 30\n","output":"9 0 0\n8 59 59\n0 0 38\n"},{"problem_id":"p00456","input":"23\n23\n20\n15\n15\n14\n13\n9\n7\n6\n25\n19\n17\n17\n16\n13\n12\n11\n9\n5\n","output":"66 61\n"},{"problem_id":"p00457","input":"12\n3\n2\n1\n1\n2\n3\n2\n2\n2\n1\n1\n3\n12\n3\n2\n1\n1\n2\n3\n2\n1\n3\n2\n1\n3\n0\n","output":"3\n12\n"},{"problem_id":"p00458","input":"3\n3\n1 1 0\n1 0 1\n1 1 0\n5\n3\n1 1 1 0 1\n1 1 0 0 0\n1 0 0 0 1\n0\n0\n","output":"5\n5\n"},{"problem_id":"p00459","input":"9\n1\n3 7 4\n3 5\n12\n3\n3 8 5\n3 8\n2 5\n6 10\n0\n","output":"2\n3\n"},{"problem_id":"p00460","input":"3 9 45\n3 100 50\n5 50 685\n0 0 0\n","output":"1\n7\n74501\n"},{"problem_id":"p00461","input":"1\n13\nOOIOIOIOIIOII\n2\n13\nOOIOIOIOIIOII\n0\n","output":"4\n2\n"},{"problem_id":"p00462","input":"8\n3\n2\n3\n1\n4\n6\n20\n4\n4\n12\n8\n16\n7\n7\n11\n8\n0\n","output":"3\n3\n"},{"problem_id":"p00463","input":"4 5 7 2\n20\n80\n100\n50\n1 1\n2 6\n2 3\n1 5\n3 1\n2 2 5 1\n10\n20\n1 1\n1 3\n0 0 0 0\n","output":"100\n10\n"},{"problem_id":"p00464","input":"3 4 3\n1 0 1 1\n0 1 0 0\n1 0 1 0\n0 0 0\n","output":"1 5\n"},{"problem_id":"p00465","input":"5\n2 2 1 2\n9 5\n1 17\n3 2 2 1\n6 1 20\n8 18 3\n8\n5 4 1 3\n5 5 4 5 5\n8 2 1 9 7\n1 1 3 5 1\n7 2 7 1 3\n6 5 6 2\n2 3 5 8 2 7\n1 6 9 4 5 1\n2 4 5 4 2 2\n5 4 2 5 3 3\n7 1 5 1 5 6\n6\n3 3 2 2\n2 9 2\n9 1 9\n2 9 2\n2 2 1 1\n1 3\n5 7\n0\n","output":"15\n4\n9\n"},{"problem_id":"p00466","input":"9850\n1050\n800\n420\n380\n600\n820\n2400\n1800\n980\n0\n","output":"600\n"},{"problem_id":"p00467","input":"10 5\n0\n0\n5\n6\n-3\n8\n1\n8\n-4\n0\n1\n3\n5\n1\n5\n10 10\n0\n-1\n-1\n4\n4\n-5\n0\n1\n-6\n0\n1\n5\n2\n4\n6\n5\n5\n4\n1\n6\n0 0\n","output":"5\n6\n"},{"problem_id":"p00468","input":"6\n5\n1 2\n1 3\n3 4\n2 3\n4 5\n6\n5\n2 3\n3 4\n4 5\n5 6\n2 5\n0\n0\n","output":"3\n0\n"},{"problem_id":"p00469","input":"4\n2\n1\n2\n12\n1\n6\n3\n72\n2\n12\n7\n2\n1\n0\n0\n","output":"7\n68\n"},{"problem_id":"p00470","input":"3 4\n15 15\n0 0\n","output":"5\n43688\n"},{"problem_id":"p00471","input":"3 2\n1 0 1\n1 0 2\n3 3\n1 1 1\n1 0 1\n1 1 2\n0 0\n","output":"2\n6\n"},{"problem_id":"p00472","input":"7 5\n2\n1\n1\n3\n2\n1\n2\n-1\n3\n2\n-3\n","output":"18\n"},{"problem_id":"p00473","input":"6\n1\n8\n12\n6\n2\n","output":"7\n"},{"problem_id":"p00474","input":"4 6\n4\n2\n3\n5\n","output":"8\n"},{"problem_id":"p00475","input":"5\n0 0\n1 0\n-1 -2\n0 1\n-1 1\n","output":"3\n"},{"problem_id":"p00476","input":"10 10\n4 2\n2 5\n6 1\n7 3\n6 4\n9 6\n0 8\n4 1\n9 4\n","output":"10\n"},{"problem_id":"p00477","input":"31\n34\n7\n151\n","output":"3\n43\n"},{"problem_id":"p00478","input":"ABCD\n3\nABCDXXXXXX\nYYYYABCDXX\nDCBAZZZZZZ\n","output":"2\n"},{"problem_id":"p00479","input":"11\n4\n5 2\n9 7\n4 4\n3 9\n","output":"2\n3\n1\n3\n"},{"problem_id":"p00480","input":"11\n8 3 2 4 8 7 2 4 0 8 8\n","output":"10\n"},{"problem_id":"p00481","input":"3 3 1\nS..\n...\n..1\n","output":"4\n"},{"problem_id":"p00482","input":"2 3\n??O\nIIJ\n","output":"4\n"},{"problem_id":"p00483","input":"4 7\n4\nJIOJOIJ\nIOJOIJO\nJOIJOOI\nOOJJIJO\n3 5 4 7\n2 2 3 6\n2 2 2 2\n1 1 4 7\n","output":"1 3 2\n3 5 2\n0 1 0\n10 11 7\n"},{"problem_id":"p00484","input":"7 4\n14 1\n13 2\n12 3\n14 2\n8 2\n16 3\n11 2\n","output":"60\n"},{"problem_id":"p00485","input":"3 3 1\n1 2 1\n2 3 1\n3 1 1\n1\n","output":"2\n"},{"problem_id":"p00486","input":"5 4\n3\n1 1\n3 4\n5 3\n","output":"10\n3 3\n"},{"problem_id":"p00487","input":"6\n12 8\n5 9\n2 4\n10 12\n6 7\n13 9\n","output":"3\n"},{"problem_id":"p00488","input":"800\n700\n900\n198\n330\n","output":"848\n"},{"problem_id":"p00489","input":"4\n1 2 0 1\n1 3 2 1\n1 4 2 2\n2 3 1 1\n2 4 3 0\n3 4 1 3\n","output":"2\n1\n4\n2\n"},{"problem_id":"p00490","input":"3\n12 2\n200\n50\n300\n100\n","output":"37\n"},{"problem_id":"p00491","input":"5 3\n3 1\n1 1\n4 2\n","output":"6\n"},{"problem_id":"p00492","input":"8 4\n0 1 0 1 0 1 1 1\n0 1 1 0 0 1 0 0\n1 0 1 0 1 1 1 1\n0 1 1 0 1 0 1 0\n","output":"64\n"},{"problem_id":"p00493","input":"100\n200\n5\n","output":"13\n"},{"problem_id":"p00494","input":"OJJOOIIOJOI\n","output":"2\n"},{"problem_id":"p00495","input":"5 4\n1 2 3 4 5\n3 1 4 1\n","output":"2\n"},{"problem_id":"p00496","input":"5 20 14\n8 9\n2 4\n7 13\n6 3\n5 8\n","output":"16\n"},{"problem_id":"p00497","input":"5 2\n2 2 1\n2 1 3\n","output":"12\n"},{"problem_id":"p00498","input":"6 6 2 3\n1 2 5\n2 3 4\n2 4 6\n3 5 9\n4 5 3\n5 6 7\n1\n6\n3 4\n5 2\n1 4\n","output":"7\n5\n0\n"},{"problem_id":"p00499","input":"20\n25\n30\n6\n8\n","output":"15\n"},{"problem_id":"p00500","input":"5\n100 99 98\n100 97 92\n63 89 63\n99 99 99\n89 97 98\n","output":"0\n92\n215\n198\n89\n"},{"problem_id":"p00501","input":"4\nbar\nabracadabra\nbear\nbar\nbaraxbara\n","output":"3\n"},{"problem_id":"p00502","input":"3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 33 40\n","output":"80\n"},{"problem_id":"p00503","input":"3 2\n30 50 0 50 70 100\n10 20 20 70 90 60\n40 60 20 90 90 70\n","output":"49000\n"},{"problem_id":"p00504","input":"5 4 2\n...#\n.#.#\n.#73\n8##.\n....\n","output":"11\n"},{"problem_id":"p00505","input":"3 4 5\n2 1 2\n6 3 4\n1 1 1\n1 2 3\n","output":"3 1 1 1\n"},{"problem_id":"p00506","input":"2\n75 125\n","output":"1\n5\n25\n"},{"problem_id":"p00507","input":"3\n2\n7\n5\n","output":"52\n"},{"problem_id":"p00508","input":"2\n0 0\n1 1\n","output":"2\n"},{"problem_id":"p00509","input":"1 0\n","output":"101\n"},{"problem_id":"p00510","input":"3\n2\n2 3\n2 3\n4 1\n","output":"3\n"},{"problem_id":"p00511","input":"1\n+\n1\n=\n","output":"2\n"},{"problem_id":"p00512","input":"5\nA 20\nB 20\nA 20\nAB 10\nZ 10\n","output":"A 40\nB 20\nZ 10\nAB 10\n"},{"problem_id":"p00513","input":"10\n4\n7\n9\n10\n12\n13\n16\n17\n19\n20\n","output":"2\n"},{"problem_id":"p00514","input":"2 0 3\n","output":"4\n"},{"problem_id":"p00515","input":"10\n65\n100\n30\n95\n","output":"68\n"},{"problem_id":"p00516","input":"4 3\n5\n3\n1\n4\n4\n3\n2\n","output":"2\n"},{"problem_id":"p00517","input":"4 3 3\n1 1\n3 3\n4 1\n","output":"5\n"},{"problem_id":"p00518","input":"2\nOI\n","output":"7\n"},{"problem_id":"p00519","input":"6 6\n400 2\n200 1\n600 3\n1000 1\n300 5\n700 4\n1 2\n2 3\n3 6\n4 6\n1 5\n2 4\n","output":"700\n"},{"problem_id":"p00520","input":"5\n1 0 1 1 2\n0 2 6 3 4\n","output":"20\n"},{"problem_id":"p00521","input":"3 5\nJOIJO\nIJOOO\nIIJIJ\nJO\nIJ\n","output":"3\n"},{"problem_id":"p00522","input":"4 3\n180\n160\n170\n190\n2 100\n3 120\n4 250\n","output":"480\n"},{"problem_id":"p00523","input":"6\n1\n5\n4\n5\n2\n4\n","output":"6\n"},{"problem_id":"p00524","input":"5 5 0\n50\n100\n25\n30\n10\n1 2 10\n2 5 50\n2 4 20\n4 3 1\n5 4 20\n","output":"110\n"},{"problem_id":"p00525","input":"10 10 5\n6 0 6 7\n0 6 7 6\n2 3 9 3\n2 3 2 10\n1 9 8 9\n","output":"4\n"},{"problem_id":"p00526","input":"10\n1 1 0 0 1 0 1 1 1 0\n","output":"7\n"},{"problem_id":"p00527","input":"5 5\nOIOOI\nOOIOI\n","output":"7\n"},{"problem_id":"p00528","input":"3 2 1\n1 2\n","output":"4\n"},{"problem_id":"p00529","input":"6\nJOIIOI\n","output":"2\n"},{"problem_id":"p00530","input":"5\n10\n3\n6\n8\n1\n","output":"0\n"},{"problem_id":"p00531","input":"9\n100\n20\n3\n10\n","output":"90\n"},{"problem_id":"p00532","input":"3\n4\n1 2 3 2\n1 1 2\n3 2 2\n1 1 3\n2 2 2\n","output":"3\n4\n5\n"},{"problem_id":"p00533","input":"3 4\nc..c\n..c.\n....\n","output":"0 1 2 0\n-1 -1 0 1\n-1 -1 -1 -1\n"},{"problem_id":"p00534","input":"3 5\n10\n25\n15\n50\n30\n15\n40\n30\n","output":"1125\n"},{"problem_id":"p00535","input":"5 6\n......\n.939..\n.3428.\n.9393.\n......\n","output":"3\n"},{"problem_id":"p00536","input":"6 15\n50 900\n30 200\n40 100\n80 600\n60 100\n70 700\n","output":"1200\n"},{"problem_id":"p00537","input":"4 4\n1 3 2 4\n120 90 100\n110 50 80\n250 70 130\n","output":"550\n"},{"problem_id":"p00538","input":"5\n2\n8\n1\n10\n9\n","output":"18\n"},{"problem_id":"p00539","input":"5 5 2\n2 3 1\n3 1 2\n2 4 3\n1 2 4\n2 5 5\n","output":"14\n"},{"problem_id":"p00540","input":"7 3\n5 2\n5 5\n8 6\n6\n2\n8\n9\n","output":"8\n"},{"problem_id":"p00541","input":"5 5 3 2\n2 2\n4 3\n","output":"4\n"},{"problem_id":"p00542","input":"100\n34\n76\n42\n10\n0\n","output":"228\n"},{"problem_id":"p00543","input":"6 4\n3\n2\n8\n3\n1\n5\n","output":"2\n3\n1\n8\n5\n3\n"},{"problem_id":"p00544","input":"4 5\nWRWRW\nBWRWB\nWRWRW\nRWBWR\n","output":"11\n"},{"problem_id":"p00545","input":"5 5 3\n-8 1\n-4 2\n-2 2\n4 2\n10 1\n1\n3\n5\n","output":"-6\n-6\n15\n"},{"problem_id":"p00546","input":"13 21 1 1\n1000 6000\n7\n1 2\n3 7\n2 4\n5 8\n8 9\n2 5\n3 4\n4 7\n9 10\n10 11\n5 9\n7 12\n3 6\n4 5\n1 3\n11 12\n6 7\n8 11\n6 13\n7 8\n12 13\n","output":"11000\n"},{"problem_id":"p00547","input":"5 5\n..483\n.59.9\n3.866\n79...\n4.8..\n","output":"20\n"},{"problem_id":"p00548","input":"6 3 6\n1\n2\n3\n1\n2\n1\n","output":"21\n"},{"problem_id":"p00549","input":"5\nJOIOI\n","output":"6\n"},{"problem_id":"p00550","input":"5 6 5\n1 2\n1 3\n4 2\n3 2\n2 5\n5 3\n5\n2\n4\n1\n3\n","output":"0\n2\n2\n4\n4\n"},{"problem_id":"p00551","input":"12 1\nEENWSEEESWWS\n","output":"3\n"},{"problem_id":"p00552","input":"10 2\n12 1 3\n2 2 2\n","output":"3\n3\n5\n5\n5\n5\n5\n5\n2\n2\n"},{"problem_id":"p00553","input":"-10\n20\n5\n10\n3\n","output":"120\n"},{"problem_id":"p00554","input":"4 5\n1 7\n6 2\n3 5\n4 4\n0 8\n","output":"4\n"},{"problem_id":"p00555","input":"3 5 2\n...#.\n#...#\n....#\n","output":"12\n"},{"problem_id":"p00556","input":"7 2\n1\n2\n2\n2\n1\n2\n1\n","output":"2\n"},{"problem_id":"p00557","input":"3 3\n2 9 4\n7 5 3\n6 1 8\n","output":"4\n"},{"problem_id":"p00558","input":"8 10 4\n0\n1\n1\n2\n1\n1\n2\n0\n1 2 1\n1 3 1\n2 3 3\n2 4 5\n3 4 1\n4 5 1\n5 6 1\n5 8 1\n1 7 2\n7 8 2\n","output":"9\n"},{"problem_id":"p00559","input":"3 5 1 2\n0\n4\n1\n8\n1 2 2\n1 1 -2\n2 3 5\n1 2 -1\n1 3 5\n","output":"-5\n-7\n-13\n-13\n-18\n"},{"problem_id":"p00560","input":"10 3 5\n10 3 5\n30\n1\n6\n10\n","output":"8\n"},{"problem_id":"p00561","input":"4 4\n1 12 6 11\n11 10 2 14\n10 1 9 20\n4 17 19 10\n","output":"11\n"},{"problem_id":"p00562","input":"6 5\n1 3 6\n3\n1 1\n0 4\n6 5\n","output":"26\n"},{"problem_id":"p00563","input":"5 3\n1 2 3 3 2\n","output":"2\n1\n1\n"},{"problem_id":"p00570","input":"3 2\n1\n3\n6\n","output":"4\n"},{"problem_id":"p00571","input":"3\n2 3\n11 2\n4 5\n","output":"6\n"},{"problem_id":"p00572","input":"3 4\nRGWR\nGRGG\nRGWW\n","output":"3\n"},{"problem_id":"p00573","input":"6 6\n1 6\n1 4\n1 2 1\n2 3 1\n3 5 1\n2 4 3\n4 5 2\n5 6 1\n","output":"2\n"},{"problem_id":"p00574","input":"3 5\n12345678\n000\n0??\n1?0\n?11\n???\n","output":"1\n10\n12\n12\n36\n"},{"problem_id":"p00575","input":"3 0 10\n","output":"4\n"},{"problem_id":"p00576","input":"3\n2 3 6\n2\n1 3\n","output":"2\n3\n7\n"},{"problem_id":"p00577","input":"5\nOXXOX\n","output":"2\n"},{"problem_id":"p00578","input":"6\n0 1 2 1 3 2\n","output":"2\n"},{"problem_id":"p00579","input":"4 1\n1 2 3 8\n2 4\n","output":"9\n"},{"problem_id":"p00580","input":"4\n2 1 1 1\n","output":"4\n"},{"problem_id":"p00581","input":"3 4\nJOIJ\nJIOO\nIIII\n","output":"3\n"},{"problem_id":"p00582","input":"3 4\n10 20\n5 1\n3 5\n4\n6\n10\n4\n","output":"2\n"},{"problem_id":"p00583","input":"5\nRRGYY\n","output":"2\n"},{"problem_id":"p00584","input":"3\n0 0\n0 4\n4 0\n2 1\n2 5\n-1 1\n","output":"15\n"},{"problem_id":"p00585","input":"5 4\n1 2\n2 3\n3 4\n3 5\n1 2 1 2 4\n","output":"2\n0\n1\n1\n1\n"},{"problem_id":"p00586","input":"1 2\n10 5\n100 20\n","output":"3\n15\n120\n"},{"problem_id":"p00587","input":"i ((,),(,)) ((,(,)),)\nu ((,),(,)) ((,(,)),)\n","output":"((,),)\n((,(,)),(,))\n"},{"problem_id":"p00588","input":"2\n2\nYNNNNYYY\n4\nNYNNYYNNNYNYYNNN\n","output":"6\n9\n"},{"problem_id":"p00589","input":"666660666\n44444416003334446633111\n20202202000333003330333\n","output":"No\nI'm fine.\naaba  f ff\n"},{"problem_id":"p00590","input":"1\n4\n7\n51\n","output":"0\n2\n2\n6\n"},{"problem_id":"p00591","input":"3\n1 2 3\n4 5 6\n7 8 9\n3\n1 2 3\n7 8 9\n4 5 6\n0\n","output":"7\n7\n"},{"problem_id":"p00592","input":"1 2100 2400\n1\n2130 2200\n3 2100 2400\n3\n2100 2130 2200 2230 2300 2330\n2\n2130 2200 2330 2400\n2\n2100 2130 2330 2400\n0 0 0\n","output":"120\n180\n"},{"problem_id":"p00593","input":"3\n4\n0\n","output":"Case 1:\n  1  2  6\n  3  5  7\n  4  8  9\nCase 2:\n  1  2  6  7\n  3  5  8 13\n  4  9 12 14\n 10 11 15 16\n"},{"problem_id":"p00594","input":"8\n3 1 2 3 3 1 5 3\n7\n5 2 5 3 4 5 5\n0\n","output":"NO COLOR\n5\n"},{"problem_id":"p00595","input":"57 38\n60 84\n","output":"19\n12\n"},{"problem_id":"p00596","input":"6\n13 23 14 24 15 25\n10\n00 01 11 02 12 22 03 13 23 33\n","output":"Yes\nNo\n"},{"problem_id":"p00597","input":"1\n4\n","output":"1\n8\n"},{"problem_id":"p00598","input":"A 3\n1 3 -1\nB 4\n3 1 5 7\nD 1\n5\nR 0\ncAiBdD\nC 3\n1 2 3\nA 4\n2 10 8 3\nB 3\n2 4 8\nR 0\n(As(AiB))uC\n","output":"7\n1 2 3 10\n"},{"problem_id":"p00599","input":"4\n-5.000000 0.000000\n5.000000 0.000000\n9.635255 14.265848\n-0.364745 14.265848\n3\n-1.000000 0.000000\n0.000000 0.000000\n0.000000 1.000000\n","output":"0 150\n-1 -1\n"},{"problem_id":"p00600","input":"3 5\n12 8 25 19 23\n9 13 16 0 17\n20 14 16 10 22\n17 27 18 16\n9 7 0\n19 5\n21\n0 0\n","output":"38\n"},{"problem_id":"p00601","input":"5 4\n0 1\n0 4\n1 2\n3 4\n5 4\n0 1\n0 4\n1 2\n3 4\n0 0\n","output":"2\n2\n"},{"problem_id":"p00602","input":"5 5\n50 1\n13 13\n","output":"2\n50\n8\n"},{"problem_id":"p00603","input":"9 1\n3\n9 4\n1 2 3 4\n","output":"3\n0\n"},{"problem_id":"p00604","input":"3\n10 20 30\n7\n56 26 62 43 25 80 7\n","output":"100\n873\n"},{"problem_id":"p00605","input":"2 3\n5 4 5\n1 2 3\n3 2 1\n3 5\n1 2 3 4 5\n0 1 0 1 2\n0 1 1 2 2\n1 0 3 1 1\n0 0\n","output":"Yes\nNo\n"},{"problem_id":"p00606","input":"1\nE A C\n1\nE B C\n2\nE A B\n0\n","output":"0.00000000\n0.25000000\n0.06250000\n"},{"problem_id":"p00607","input":"hyo\nni\nEND_OF_TEXT\nf\nd\nf\nf\nk\np\np\ne\ny\na\nk\ny\ny\nn\ny\n-\n","output":"honihoni\nhoni\n"},{"problem_id":"p00608","input":"5 5\n4=..2\n+#=#+\n.-2=.\n=#*#=\n.-.=3\n6\n7 3 1 4 \/ 8\n1 6\n8..3=2\n2\n2 +\n0 0\n","output":"Yes\nNo\n"},{"problem_id":"p00609","input":"2 2 1\n0 0\n0 4\n2 2\n2 8\n0 0 0\n","output":"2\n"},{"problem_id":"p00610","input":"2 1\n2 3\n6 4\n0 0\n","output":"..\n..\n\nNo\n\n..EEEE\n..E..E\nEEE..E\nE..EEE\nE..E..\nEEEE..\n"},{"problem_id":"p00611","input":"3 8\n########\n#P....*#\n########\n10 10\n##########\n#P.......#\n#..#*....#\n#..#*.#.*#\n#.....#*.#\n#*.......#\n#..##....#\n#...#.P..#\n#P......P#\n##########\n0 0\n","output":"5\n14\n"},{"problem_id":"p00612","input":"2\n4\n0\n","output":"24\n64\n"},{"problem_id":"p00613","input":"2\n2\n3\n5 4 3\n0\n","output":"2\n6\n"},{"problem_id":"p00614","input":"123 3 0 2 0 1 1\n999 9 9 9 9 9 9\n0 0 0 0 0 0 0\n","output":"6\n3\n"},{"problem_id":"p00615","input":"4 5\n20 35 60 70\n15 30 40 80 90\n3 2\n10 20 30\n42 60\n0 1\n100\n1 1\n10\n50\n0 0\n","output":"20\n18\n100\n40\n"},{"problem_id":"p00616","input":"4 3\nxy 4 4\nxz 1 2\nyz 2 3\n4 5\nxy 1 1\nxy 3 3\nxz 3 3\nyz 2 1\nyz 3 3\n0 0\n","output":"52\n46\n"},{"problem_id":"p00617","input":"5\n<main>10,10,190,150<menu>20,20,70,140<\/menu><primary>80,20,180,140<\/primary><\/main>\n10 10\n15 15\n40 60\n2 3\n130 80\n0\n","output":"main 2\nmain 2\nmenu 0\nOUT OF MAIN PANEL 1\nprimary 0\n"},{"problem_id":"p00618","input":"4 4\n1 0\n3 2 0 2\n2 0\n2 0\n3 6\n1 0\n3 2 0 2\n2 0\n0 0\n","output":"2\n3\n"},{"problem_id":"p00619","input":"8\n1 3 11 3\n5 3 13 11\n10 10 17 10\n11 2 11 6\n10 5 14 5\n13 6 13 2\n17 10 17 3\n13 3 19 3\n1 3 19 3\n6\n1 3 11 3\n5 3 13 11\n10 10 17 10\n11 2 11 6\n10 5 14 5\n13 3 19 3\n1 3 19 3\n2\n0 0 7 0\n3 0 7 3\n0 0 7 3\n0\n","output":"270.0000\n-1\n36.86989765\n"},{"problem_id":"p00620","input":"3\n-3 1 1\n2 -4 1\n2 1 -1\n3\n-4 1 1\n1 1 -6\n1 -5 3\n4\n-8 6 -2 1\n2 -7 -2 1\n1 -1 1 1\n1 1 1 -5\n6\n2 2 3 -7 3 2\n1 -10 1 1 3 2\n2 6 5 2 -6 1\n3 4 -23 2 2 5\n3 3 -6 2 3 7\n-7 2 3 2 -5 -13\n6\n2 2 3 -7 3 2\n1 -10 1 1 3 2\n2 6 5 2 -6 1\n3 4 -23 2 2 5\n3 3 -6 2 3 7\n-7 2 3 2 -5 -12\n0\n","output":"YES\nNO\nNO\nYES\nNO\n"},{"problem_id":"p00621","input":"4 6\ns 0 2\ns 1 3\ns 2 1\nw 0\ns 3 3\ns 4 2\n3 3\ns 0 1\ns 1 1\ns 2 1\n0 0\n","output":"0\nimpossible\n2\nimpossible\n0\nEND\n0\n1\n2\nEND\n"},{"problem_id":"p00622","input":"CBA\ncba\ncCa\nX\nZY\nZ\n-\n","output":"BbA\nXY\n"},{"problem_id":"p00623","input":"(1 2)\n2\n0 1 0 1\n1 0 1 0\n((1 2) 3)\n3\n1 1 0 0\n1 0 1 0\n0 0 0 1\nEND\n","output":"2\n2\n"},{"problem_id":"p00624","input":"5 5\n#####\n##@##\n#wc.#\n#Ew.#\n#####\n5 5\n#####\n##@.#\n#wc.#\n#E#.#\n#####\n3 6\n######\n#@.wE#\n######\n0 0\n","output":"3\n5\n-1\n"},{"problem_id":"p00625","input":"2 1\n12 5 3\n0 17 3\n0 0 2 2\n2 3\n2 0 2\n100 100 2\n0 0 -1 0\n-2 -5 0 3\n100 100 1 1\n0 0\n","output":"1 0\n2 1\n"},{"problem_id":"p00626","input":"4 4\n1 0 0 0\n0 0 1 0\n0 1 0 0\n1 0 0 1\n1 1\n1\n2 3\n1 0 0\n0 0 1\n0 0\n","output":"7\n0\n2\n"},{"problem_id":"p00627","input":"20\n4\n3\n2\n1\n3\n8\n2\n0\n0\n","output":"13\n2\n"},{"problem_id":"p00628","input":"Yes I have a number\nHow I wish I could calculate an unused color for space\nThank you\nEND OF INPUT\n","output":"31416\n31415926535\n53\n"},{"problem_id":"p00629","input":"6\n1 1 6 200\n2 1 6 300\n3 1 6 400\n4 2 5 1200\n5 1 5 1400\n6 3 4 800\n3\n777 1 5 300\n808 2 4 20\n123 3 6 500\n2\n2 1 3 100\n1 1 3 100\n0\n","output":"1\n2\n3\n4\n6\n123\n777\n808\n1\n2\n"},{"problem_id":"p00630","input":"get_user_name L\ngetUserName U\nGetUserName D\nEndOfInput X\n","output":"getUserName\nGetUserName\nget_user_name\n"},{"problem_id":"p00631","input":"5\n1 2 3 4 5\n4\n2 3 5 7\n0\n","output":"1\n1\n"},{"problem_id":"p00632","input":"4 7\nA#...#B\n.#.#.#.\n.#.#.#.\n...#...\n5\n4 7\nA#...#B\n.#.#.#.\n.#.#.#.\n...#...\n2\n4 7\nA#...#B\n.#.#.#.\n.#.#.#.\n...#...\n4\n4 7\nA#...#B\n.#.#.#.\n.#.#.#.\n...#...\n442668\n1 10\nA#.......B\n55555554\n1 10\nA#.......B\n55555555\n0 0\n","output":"18 0 6\n15 3 6\n6 0 0\n14 0 4\n72 0 0\nimpossible\n"},{"problem_id":"p00633","input":"4\n6 4 2\n4 7 3\n7 10 3\n13 6 1\n4\n7 4 2\n4 7 3\n7 10 3\n11 6 3\n0\n","output":"39.664699289572\n45.627024663706\n"},{"problem_id":"p00634","input":"3\n3 apple 100 banana 200 egg 300\n3 apple 150 banana 100 cola 200\n3 apple 100 banana 150 cola 200\n3\napple\nbanana\ncola\n5\n0 2 4\n0 1 3\n0 3 3\n1 2 3\n2 3 5\n3\n3 apple 100 banana 200 egg 300\n3 apple 150 banana 100 cola 200\n3 apple 100 banana 150 cola 200\n4\napple\nbanana\ncola\njump\n5\n0 2 4\n0 1 3\n0 3 3\n1 2 3\n2 3 5\n0\n","output":"400 10\nimpossible\n"},{"problem_id":"p00635","input":"4\n0 2 3 1\n4 0 4 2\n1 1 0 3\n3 1 5 0\n2\n0 3\n3 0\n0\n","output":"8\n3\n"},{"problem_id":"p00636","input":"2\n1 1\n3 3\n4\n1.0 0.5\n1.0 2.5\n3.0 1.5\n3.0 3.5\n1\n2.0 2.0\n0\n","output":"5.656854249492\n4.618033988750\nimpossible\n"},{"problem_id":"p00637","input":"5\n1 2 3 5 6\n3\n7 8 9\n0\n","output":"1-3 5-6\n7-9\n"},{"problem_id":"p00638","input":"3\n2 3\n3 6\n1 2\n3\n2 3\n3 5\n1 2\n0\n","output":"Yes\nNo\n"},{"problem_id":"p00639","input":"10.0\n0.5 0.0 -0.2 0.0\n1.0\n0.1 0.0 0.2 0.2\n0\n","output":"0.50000000\nimpossible\n"},{"problem_id":"p00640","input":"3\n800 600\nindex 1\n500 100 700 200 profile\nprofile 2\n100 100 400 200 index\n100 400 400 500 link\nlink 1\n100 100 300 200 index\n9\nclick 600 150\nshow\nclick 200 450\nshow\nback\nback\nshow\nforward\nshow\n0\n","output":"profile\nlink\nindex\nprofile\n"},{"problem_id":"p00641","input":"3\n1 1 2 3\n0 1 2 2\n1 2 0 3\n7\n1 2 2 1\n0 2 3 2\n0 1 3 1\n2 1 1 2\n5 3 6 2\n4 3 6 1\n4 2 5 1\n0\n","output":"1\n2\n"},{"problem_id":"p00642","input":"1\n2\n3\n0\n","output":"1.00000000\n1.50000000\n2.12500000\n"},{"problem_id":"p00643","input":"1 2\n8 8\n0 0\n0 1\n3 3\n1 2 5\n2 8 3\n0 1 2\n0 0\n2 2\n3 3\n1 2 5\n2 8 3\n0 1 2\n0 0\n1 2\n2 2\n1 2\n3 4\n0 0\n0 1\n2 3\n1 2 3\n4 5 6\n0 0\n1 2\n0 0\n","output":"24\n19\n17\n6\n21\n"},{"problem_id":"p00644","input":"3 2 1\n0 1 2\n1 2 3\n1\n4 5 2\n0 1 1\n0 2 1\n1 2 1\n1 3 1\n2 3 1\n1\n2\n0 0 0\n","output":"1.00000000\n\n0.50000000\n0.50000000\n"},{"problem_id":"p00645","input":"5\n1 1 1 1 1\n1 0 0 0 1\n1 0 1 0 1\n1 0 0 0 1\n1 1 1 1 1\n3\n1 1 1\n1 1 1\n1 1 1\n5\n1 1 1 1 0\n1 1 1 1 0\n1 0 0 0 1\n0 1 1 1 1\n0 1 1 1 1\n0\n","output":"myonmyonmyon\nmyon\nmyonmyon\n"},{"problem_id":"p00646","input":"12\n9\n2\n0\n","output":"8\n3\n2\n"},{"problem_id":"p00647","input":"5\n12:57 59\n20:12 15\n12:19 21\n18:52 03\n16:09 14\n0\n","output":"lunch 100\ndinner 50\nmidnight no guest\n"},{"problem_id":"p00648","input":"1\ngalaxy_angel 0 600\n1\ngalaxy_angel\n11\nA 0 600\nB 0 610\nC 0 610\nD 0 610\nE 0 640\nEE 0 700\nF 0 710\nG 0 710\nH 0 710\nI 0 740\nJ 0 750\n2\nB\nH\n42\nnchj 6 2620\nanhnnnmewbktthsrn 4 2515\ngntmdsh 1 1800\nachnnl 4 2540\nhnskirh 0 2200\naonexrcst 0 1700\ndgdys 6 2330\nhdnnara 4 2525\ndnpaonntssotk 4 2555\nddmnwndrlnd 6 2500\nC 4 2445\nastrttnomch 0 2330\nseknnqasr 1 2630\nsftnt 4 2630\nstnsgt 2 2605\ndrrnenmknmrmr 4 2610\nhnzm 6 2713\nyndmsoazzlsn 6 2658\nmrahlcalv 4 2615\nhshzrhkkrhs 1 900\nortchntsbshni 0 2430\nkmnmzshrski 1 2530\nsktdnc 4 1800\ngykkybrkjhkirkhn 2 2459\ntrk 0 900\n30zzsinhkntiik 3 2700\nsngkotmmmirprdx 1 2600\nyran 2 2529\ntntissygntinybu 1 2614\nskiichhtki 5 2505\ntgrbnny 6 2558\ndnbrsnki 3 1927\nyugozxl 1 1930\nfrbllchrmn 1 1928\nfjrg 1 1955\nshwmngtr 0 2200\nxmn 5 2200\nrngnkkrskitikihn 0 2100\nszysz 0 1254\nprttyrythmaulrdrm 6 1000\nsckiesfrntrqst 5 1820\nmshdr 1 2255\n1\nmrahlcalv\n0\n","output":"1\n4\n31\n"},{"problem_id":"p00649","input":"4\n0 0 100 60\n0 60 50 90\n50 60 100 90\n0 90 100 120\n6\n0 0 100 40\n0 40 50 70\n50 40 100 60\n50 60 100 80\n0 70 50 120\n50 80 100 120\n0\n","output":"1\n2\n3\n4\n\n1\n2\n4\n5\n3\n6\n"},{"problem_id":"p00650","input":"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0\n","output":"1\n100\n0\n-1\n"},{"problem_id":"p00651","input":"4 10 8\n0 -10\n3 -7\n0 -4\n-3 -7\n0 0 0\n","output":"-4.146082488326 -9.100000000000\n-7.545870128753 -6.562000000000\n-9.587401146004 -2.842840000000\n-9.903199956975 1.388031200000\n-8.436422775690 5.369056784000\n-5.451089494781 8.383652146880\n-1.484560104812 9.889190123322\n2.749190104024 9.614673877565\n"},{"problem_id":"p00652","input":"2 3 10 10 50\n3 3\n6 6\n10 10\n4.0000000000 4.0000000000\n7.0000000000 7.0000000000\n2 3 10 10 70\n3 3\n6 6\n10 10\n4.0000000000 4.0000000000\n7.0000000000 7.0000000000\n2 3 10 10 30\n3 3\n6 6\n10 10\n4.0000000000 4.0000000000\n7.0000000000 7.0000000000\n2 3 10 10 40\n3 3\n6 6\n10 10\n4.0000000000 4.0000000000\n7.0000000000 7.0000000000\n2 3 10 10 100\n3 3\n6 6\n10 10\n4.0000000000 4.0000000000\n7.0000000000 7.0000000000\n0 0 0 0 0\n","output":"1\n1\n0\n1\n2\n"},{"problem_id":"p00653","input":"3 3 4\n1 2 3\n4 2 2\n2 1 1\n0 0 2 2\n0 0 1 1\n1 0 1 0\n0 1 1 2\n1 10 4\n1 2 3 4 5 6 7 8 9 10\n0 0 0 9\n0 0 0 4\n0 5 0 9\n0 4 0 5\n0 0 0\n","output":"1\n1\n4\n2\n1\n1\n6\n5\n"},{"problem_id":"p00654","input":"3\n6 10 14 15 21 35\n2\n30 42 35\n0\n","output":"2\n3 5 7\n6\n5 7\n"},{"problem_id":"p00655","input":"5\n0 1\n0 2\n0 3\n0 4\n1\n6\n0 1\n0 2\n0 3\n0 4\n0 5\n1\n31\n0 6\n0 2\n0 3\n0 4\n0 5\n0 1\n0 8\n4 1\n4 2\n5 1\n5 2\n2\n3\n1\n2\n3\n1\n2\n3\n1\n2\n3\n1\n2\n3\n1\n2\n3\n1\n2\n1\n32\n0 1\n0 3\n0 2\n0 5\n0 9\n0 6\n0 7\n8 1\n8 2\n8 3\n9 1\n9 2\n6\n7\n1\n6\n7\n1\n6\n7\n1\n6\n7\n1\n6\n7\n1\n6\n7\n1\n6\n1\n0\n","output":"2\nend\n3\nend\n2\n6\n1\n8\n2\n1\n4\n2\n1\n3\n2\n1\n5\n2\n1\n2\n1\n8\n1\n6\n8\n6\n8\n8\nend\n5\n3\n1\n9\n7\n5\n9\n5\n3\n9\n2\n9\n7\n9\n3\n7\n3\n6\n7\n6\n1\n7\n1\n7\n7\nend\n"},{"problem_id":"p00656","input":"3 4\nabc 1 1\nabc 10 1\nabc 100 1\n3\na\nabc\nab\n3 4\nab 1 1\nab 10 1\nabc 100 1\n3\nabc\nab\na\n3 4\nabc 1 1\nabc 10 1\nabc 100 1\n3\nab\nab\nab\n8 20\nabcdef 100 2\nbcdef 200 1\ncfghj 300 3\nksjirto 400 6\nksitoew 500 2\nqwertyl 600 2\nkjhbvc 700 2\nedfghucb 800 1\n10\nks\ncd\nhj\ne\na\ng\nh\nj\ni\na\n0 0\n","output":"111\n110\n100\n100\n11\n10\n111\n110\n100\n900\n300\n300\n2200\n100\n1100\n1500\n1400\n900\n-1\n"},{"problem_id":"p00657","input":"1 1\n2 2\n0 0\n","output":"no\nyes\n"},{"problem_id":"p00658","input":"8 8\n........\n........\n....###.\n...#.#.G\nS#B...##\n#ICII.I#\n#..#.#.#\n.#..#.#.\n7\nPUSH RIGHT\nMOVETO 2\nCLIMB RIGHT\nCLIMB RIGHT\nGETDOWN RIGHT\nCLIMB RIGHT\nGETDOWN RIGHT\n8 8\n........\n........\n........\n...G....\nS#B.....\n#ICIIIII\n#..#.#.#\n.#..#.#.\n4\nPUSH RIGHT\nMOVETO 2\nCLIMB RIGHT\nCLIMB RIGHT\n8 8\n........\n....#.#.\n.....#.G\n...#..#.\nS#B....#\n#ICIII.#\n#..#.#.#\n.#..#.#.\n8\nPUSH RIGHT\nMOVETO 2\nCLIMB RIGHT\nCLIMB RIGHT\nCLIMB RIGHT\nGETDOWN RIGHT\nCLIMB RIGHT\nGETDOWN RIGHT\n0 0\n","output":"Game Over : Death by Hole\nGame Over : Cleared\nGame Over : Death by Walking Goal\n"},{"problem_id":"p00659","input":"4\nakzakr 2 1 8\nfnmyi 5 2 3 4 6 9\ntsnukk 5 2 3 4 7 9\nyskwcnt 6 3 4 7 8 9 10\n4\nakzakr 1 2\nfnmyi 3 10 11 12\ntsnukk 2 1 8\nyskwcnt 2 1 8\n5\nknmmdk 2 13 19\nakmhmr 4 13 15 19 22\nmksyk 6 3 7 12 13 15 19\nskrkyk 3 1 4 8\ntmemm 3 1 17 24\n5\nknmmdk 5 5 6 16 18 26\nakmhmr 9 3 4 7 11 14 15 17 18 20\nmksyk 5 6 13 25 27 28\nskrkyk 4 3 16 23 24\ntmemm 3 6 12 20\n14\nhrkamm 6 4 6 8 10 20 22\nmkhsi 6 1 10 12 15 22 27\nhbkgnh 2 4 9\nchyksrg 8 3 4 12 15 16 20 25 28\nmktkkc 6 0 1 8 15 17 20\ntknsj 6 6 8 18 19 25 26\nyyitktk 3 3 12 18\nykhhgwr 5 3 9 10 11 24\namftm 7 2 6 8 12 13 14 17\nmmftm 4 6 12 16 18\nrtkakzk 3 14 15 21\nazsmur 7 1 2 4 12 15 18 20\niormns 2 4 20\nktrotns 6 7 12 14 17 20 25\n14\nhrkamm 2 4 21\nmkhsi 6 2 3 8 11 18 20\nhbkgnh 4 4 16 28 29\nchyksrg 5 0 3 9 17 22\nmktkkc 2 7 18\ntknsj 3 3 9 23\nyyitktk 3 10 13 25\nykhhgwr 2 18 26\namftm 3 13 18 22\nmmftm 4 1 20 24 27\nrtkakzk 2 1 10\nazsmur 5 2 5 10 14 17\niormns 3 9 15 16\nktrotns 5 7 12 16 17 20\n0\n","output":"7 akzakr\n4 akzakr\n6 knmmdk\n12 tmemm\n19 iormns\n24 mktkkc\n"},{"problem_id":"p00660","input":".......#######......................#######..............\n.......#.....#......................#..-..#..............\n.......#.|...#......................#.|.|.#..............\n.......#.....#......................#..-..#..............\n.......#.|...#......................#.|...#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n############################.############################\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n#.-.-.##...|.##.-.-.##.|.|.#.#.....##.|.|.##.-.-.##.|.|.#\n#|.|.|##..-..##|.|.|##..-..#.#....|##..-..##|.|.|##..-..#\n#...-.##.|...##...-.##.|.|.#.#.-.-.##.|...##...-.##.|...#\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n############################.############################\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#.|...#......................#.|...#..............\n.......#..-..#......................#..-..#..............\n.......#.|.|.#......................#...|.#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#.|...#......................#...|.#..............\n.......#..-..#......................#..-..#..............\n.......#...|.#......................#.|.|.#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n############################.############################\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n#.-.-.##...|.##.-.-.##.|.|.#.#...-.##...|.##.-...##.|.|.#\n#|.|.|##..-..##|.|.|##..-..#.#|.|.|##..-..##|.|.|##..-..#\n#.-.-.##.|...##...-.##.|...#.#.-...##.|.|.##.-.-.##.|...#\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n############################.############################\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#...|.#......................#.|...#..............\n.......#..-..#......................#..-..#..............\n.......#.|...#......................#...|.#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#.|...#......................#.|.|.#..............\n.......#..-..#......................#..-..#..............\n.......#...|.#......................#.|...#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n############################.############################\n#.....##..-..##.....##..-..#.#.....##..-..##.....##.....#\n#.-.-.##.|.|.##.-.-.##...|.#.#.....##.|.|.##...-.##.|...#\n#|.|.|##..-..##|....##..-..#.#....|##..-..##|.|.|##.....#\n#.-.-.##.|.|.##.....##.|.|.#.#.-.-.##.|.|.##.-...##.|...#\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n############################.############################\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#.|.|.#......................#.|...#..............\n.......#..-..#......................#..-..#..............\n.......#...|.#......................#...|.#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#.|...#......................#.|.|.#..............\n.......#..-..#......................#..-..#..............\n.......#...|.#......................#.|...#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n############################.############################\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n#.-.-.##...|.##.-.-.##.|.|.#.#.-...##.|.|.##.-...##.|.|.#\n#|.|.|##..-..##|.|.|##..-..#.#|.|.|##..-..##|.|.|##..-..#\n#...-.##.|...##.-.-.##.|.|.#.#.-.-.##.|...##.-.-.##.|.|.#\n#.....##..-..##.....##..-..#.#.....##..-..##.....##..-..#\n############################.############################\n.......#######......................#######..............\n.......#..-..#......................#..-..#..............\n.......#...|.#......................#.|.|.#..............\n.......#..-..#......................#..-..#..............\n.......#.|...#......................#...|.#..............\n.......#..-..#......................#..-..#..............\n.......#######......................#######..............\n0\n","output":"LOW\nHIGH\nHIGH\nLOW\n"},{"problem_id":"p00661","input":"12 3\n2 3 6\n12 4\n1 2 3 6\n0 0\n","output":"6.0000000000\n0.0000000000\n"},{"problem_id":"p00662","input":"1 1 1 1 1 1\n1 1 1 0 0 0\n1 0 0 0 1 1\n3 0 0 3 0 0\n3 1 0 1 3 1\n1 2 0 2 0 1\n0 0 1 1 0 3\n1 0 0 1 1 0\n0 0 0 0 0 0\n","output":"2\n1\n1\n2\n3\n1\n1\n0\n"},{"problem_id":"p00663","input":"(B&B&f)|(~d&~i&i)|(~v&i&~V)|(~g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i&~V)|(~v&f&~d)\n(S&X&~X)\n#\n","output":"yes\nno\n"},{"problem_id":"p00664","input":"5 5 5\n0 0 1\n0 0 0\n0 2 0\n1 2 1\n0 0 0\n5 5 5\n1 4 0\n0 1 1\n0 4 1\n1 3 0\n0 3 1\n5 5 5\n1 0 0\n0 3 0\n1 2 1\n0 4 0\n0 1 1\n0 0 0\n","output":"4\n13\n8\n"},{"problem_id":"p00665","input":"4 1 3 4\nyskwcnt 16\nakzakr 7\ntsnukk 12\nfnmyi 13\nakzakr\n4 1 3 5\nakzakr 7\ntsnukk 12\nfnmyi 13\nyskwcnt 16\nakzakr\n4 2 2 1\nakzakr 4\ntsnukk 6\nyskwcnt 6\nfnmyi 12\nakzakr\nfnmyi\n5 2 3 28\nknmmdk 6\nskrkyk 14\ntmemm 14\nakmhmr 15\nmksyk 25\nknmmdk\nskrkyk\n5 2 3 11\ntmemm 12\nskrkyk 18\nknmmdk 21\nmksyk 23\nakmhmr 42\nskrkyk\ntmemm\n14 5 10 38\niormns 19\nhbkgnh 23\nyyitktk 31\nrtkakzk 36\nmmftm 43\nykhhgwr 65\nhrkamm 66\nktrotns 67\nmktkkc 68\nmkhsi 69\nazsmur 73\ntknsj 73\namftm 81\nchyksrg 88\nmkhsi\nhbkgnh\nmktkkc\nyyitktk\ntknsj\n14 5 10 38\nmktkkc 24\nrtkakzk 25\nykhhgwr 25\nhrkamm 27\namftm 37\niormns 38\ntknsj 38\nyyitktk 39\nhbkgnh 53\nmmftm 53\nchyksrg 63\nktrotns 63\nazsmur 65\nmkhsi 76\nmkhsi\nhbkgnh\nmktkkc\nyyitktk\ntknsj\n0 0 0 0\n","output":"0\n1\n1\n2\n1\n4\n5\n"},{"problem_id":"p00666","input":"4\n0.200 3 0.500\n0.100 0 0.400\n0.900 1 1.000\n0.400 2 0.600\n2\n0.600 1 0.800\n0.500 0 1.000\n9\n0.200 7 0.600\n0.400 0 0.500\n0.700 8 1.000\n0.100 4 0.400\n0.200 2 0.600\n0.100 6 0.400\n0.100 5 0.400\n0.600 3 0.900\n0.500 1 0.900\n9\n0.300 8 0.900\n0.700 3 0.800\n0.300 0 0.900\n0.700 6 0.800\n0.200 5 0.700\n0.200 2 0.700\n0.700 4 0.800\n0.700 1 0.800\n0.300 7 0.900\n0\n","output":"7.27777777778 1\n2.66666666667 1\n23.98412698413 72\n11.36904761905 4\n"},{"problem_id":"p00667","input":"1\n11\n111111\n111111111111\n12345\n11111111119999999999\n11111111113333333333\n11111111118888888888\n11111111112222222222111111111\n11111111110000000000444444444\n11224111122411\n888888888888999999999999888888888888999999999999999999\n666666666666666777333333333338888888888\n1111114444441111111444499999931111111222222222222888111111115555\n#\n","output":"1\n2\n32\n1856\n1\n230400\n230400\n156480\n56217600\n38181120\n128\n26681431\n61684293\n40046720\n"},{"problem_id":"p00668","input":"22 5\n0 0\n0 1\n0 2\n0 3\n0 4\n2 1\n2 2\n2 3\n2 4\n2 5\n0 5\n2 1\n0 6\n2 2\n3 3\n2 2\n2 2\n1 2\n2 2\n2 1\n2 2\n2 3\n30 5\n0 383594529\n1 1\n0 868094164\n0 708344471\n0 4102559\n0 944076771\n0 320398558\n1 1\n0 949521499\n0 1035499529\n0 585547493\n0 915496840\n0 721553343\n0 405934659\n0 814301872\n1 1\n2 3\n0 919753364\n1 1\n0 69231610\n2 2\n0 373477673\n0 842917649\n0 961543702\n0 907959899\n2 1\n2 2\n2 3\n2 4\n2 5\n30 5\n0 726736645\n0 1\n0 344304573\n0 241734870\n3 726736645\n1 3\n2 1\n0 586879203\n2 3\n0 511883046\n0 481344051\n0 154183395\n0 435126242\n0 185906768\n1 1\n0 383123551\n0 20253038\n1 5\n2 1\n2 2\n0 163044554\n3 435126242\n0 105612613\n0 725050544\n0 559442328\n2 1\n2 2\n2 3\n2 4\n2 5\n0 0\n","output":"0\n1\n2\n3\n4\n1\n3\n4\n4\n5\n2\n5\n6\nend\n405934659\n405934659\n69231610\n373477673\n842917649\n961543702\n907959899\nend\n1\n586879203\n154183395\n435126242\n383123551\n163044554\n105612613\n725050544\n559442328\nend\n"},{"problem_id":"p00669","input":"4 2\n2\n3\n7\n5\n0 0\n","output":"0\n"},{"problem_id":"p00670","input":"3 7\n1\n3\n10\n0 0\n","output":"2\n"},{"problem_id":"p00671","input":"5 5 10 2\n1 1 0 1 1\n0 9 1 0 1\n1 1 1 9 1\n1 1 9 0 1\n1 1 1 1 0\n1 1 0 1 1\n0 9 1 0 1\n1 1 1 9 1\n1 1 1 0 1\n1 1 1 1 0\n1 1 10 0\n3\n7\n1 1 5 0\n3\n6\n1 2 10 1\n6 7\n5 6\n2 1 10 1\n4\n8\n3\n7\n2 1 10 0\n4\n8\n3\n7\n2 1 5 0\n4\n8\n3\n6\n0 0 0 0\n","output":"18\n3\n0\n7\n12\n8\n4\n"},{"problem_id":"p00672","input":"2 3 2\nlength\n1 0\ntime\n0 1\nspeed\n1 -1\na\/b\na length\nb time\n2 3 3\nlength\n1 0\ntime\n0 1\nspeed\n1 -1\na\/b+c\na length\nb time\nc speed\n2 3 3\nlength\n1 0\ntime\n0 1\nspeed\n1 -1\na\/b+c\na length\nb time\nc time\n2 3 2\nlength\n1 0\ntime\n0 1\nspeed\n1 -1\na\/b\/b\na length\nb time\n3 6 6\nspeed\n1 -1 0\nacceleration\n1 -2 0\nforce\n1 -2 1\nlength\n1 0 0\ntime\n0 1 0\nweight\n0 0 1\n((v+l\/t)+a*t)\/(t*t)*w*t+f+w*a\nv speed\nl length\na acceleration\nt time\nw weight\nf force\n0 0 0\n","output":"speed\nspeed\nerror\nundefined\nforce\n"},{"problem_id":"p00673","input":"2\n4\n1 2 10\n2 2 5\n1 3 20\n2 3 10\n10\n3\n2\n1 2 5\n0 3 4\n3\n10 11 100\n2 12 2\n12 12 3\n10\n0\n","output":"2 15\n2 111\n"},{"problem_id":"p00674","input":"4\n-100 -100\n100 -100\n100 100\n-100 100\n4\n-99 -100\n100 -100\n100 100\n-99 100\n4\n-100 -99\n100 -99\n100 100\n-100 100\n14\n-99 -70\n-92 -79\n10 -98\n37 -100\n62 -95\n77 -69\n88 -47\n92 -10\n96 28\n100 91\n42 92\n-62 92\n-88 91\n-98 64\n0\n","output":"100.000000000000000 0.000000000000000\n100.000000000000000 0.000000000000000\n0.000000000000000 100.000000000000000\n-96.983291994836122 66.745111613942484\n"},{"problem_id":"p00675","input":"2\n1\n1\n2\n1 2 1\n2 1 1\n1\n1111\n2\n1\n1\n2\n1 2 1\n2 1 1\n1\n11\n2\n1\n1\n2\n1 2 1\n2 1 1\n10\n1111\n2\n1\n1\n2\n1 2 1\n2 1 1\n10\n111111\n2\n1\n1\n2\n1 2 -1\n2 1 0\n10\n11\n2\n1\n1\n2\n1 2 -1\n2 1 0\n10\n1111\n2\n1\n1\n2\n1 2 -1\n2 1 0\n10\n12\n2\n1\n1\n2\n1 2 -1\n2 1 0\n10\n1111111111\n0\n","output":"1 1\n0 0\n1 1\n2 4\n0 0\n1 -1\n-1\n4 -10\n"},{"problem_id":"p00676","input":"2 2 1\n2 3 1\n3 2 3\n2 3 5\n","output":"3.9681187851\n6.7970540913\n6.5668891783\n13.9527248554\n"},{"problem_id":"p00677","input":"3 3 100\n2\n5 20 3 10\n2\n10 50 12 60\n2\n8 30 22 100\n0 1 2\n\n1 1 30\n1\n13 8\n0\n","output":"23 100\n13 8\n"},{"problem_id":"p00678","input":"2\n1 1 1\n2 2 1\n4\n1 1 3\n3 1 3\n4 2 1\n1 5 3\n0\n","output":"0.70710678\n1.06066017\n"},{"problem_id":"p00679","input":"3 2\n0 0 0\n1 1 1\n2 2 2\n4\n-1 -1 -1\n3 3 3\n-1 -1 -1\n4 4 4\n2\n1234 5678 9012\n1716 6155 9455\n0 0\n","output":"12.124355653\n810.001234567\n"},{"problem_id":"p00680","input":"3\n3 0 2 5\n1 1 1 6\n3 2 1 10\n1 -2 3 6\n2\n1 2\n3 3\n1\n2\n3\n0\n3 0 2 5\n1 1 1 6\n3 2 1 10\n1 -2 3 6\n2\n1 2\n2 2\n1\n2\n2\n0\n10 2 7 20\n8 9 -5 6 -9 5 1 0 4 9 4\n3 -1 -8 0 -5 4 3 0 -3 2 4\n-4 5 8 -4 1 -8 -6 3 3 5 -7\n-7 0 2 5 8 -5 -9 -8 1 -2 -1\n3 8 1 -3 8 2 -5 8 -3 4 -4\n-2 5 0 -2 -4 4 -3 9 6 -1 -2\n4 1 2 -9 3 5 6 -4 4 -1 -4\n-4 6 6 9 -2 1 -9 -3 -7 3 -4\n1 -1 6 3 1 -5 9 5 -5 -9 -5\n-7 4 6 8 8 4 -4 4 -7 -8 -5\n5\n1 5 0 6 3\n15 17 14 7 15\n3\n1 5 7\n6 8 14\n10\n3 5 3 5 9 5 9 5 1 4\n12 6 16 11 16 7 9 3 13 13\n10\n9 1 5 6 2 5 8 5 9 4\n15 8 8 14 13 13 18 1 12 11\n5\n3 5 0 4 6\n14 15 4 14 11\n9\n5 0 6 2 7 8 8 6 6\n6 5 7 17 17 17 17 19 3\n9\n7 7 2 7 8 4 7 7 0\n4 13 16 10 19 17 19 12 19\n3\n1 5 1\n3 7 16\n8\n5 7 4 9 1 4 6 8\n4 3 6 12 6 19 10 1\n4\n1 3 6 3\n5 15 18 14\n","output":"10.0000000000\nimpossible\n11.9354380207\n"},{"problem_id":"p00681","input":"3 3\n 0 0\n0 0 0\n 0 0\n0 0 1\n 0 1\n0 0\n0 1\n1 1\n2 2\n1\n5 5\n 0 1 0 0\n1 0 0 1 0\n 1 0 1 0\n0 1 0 0 1\n 0 1 1 0\n0 1 0 1 0\n 1 1 1 0\n0 0 0 0 0\n 0 0 1 1\n0 0\n1 0\n4 4\n0 1\n2\n0 0\n","output":"4\n15\n"},{"problem_id":"p00682","input":"3\n1 1\n3 4\n6 0\n\n7\n0 0\n10 10\n0 20\n10 30\n0 40\n100 40\n100 0\n\n0\n","output":"1 8.5\n2 3800.0\n"},{"problem_id":"p00684","input":"(1-10*i)+00007+(3+10*i)\n3+4*i*(4+10*i)\n(102+10*i)*(99+10*i)\n2*i+3+9999*i+4\n","output":"11\n-37+16i\n9998+2010i\noverflow\n"},{"problem_id":"p00686","input":"6 5\nFORWARD 3\nRIGHT\nFORWARD 5\nLEFT\nBACKWARD 2\nSTOP\n3 1\nFORWARD 2\nSTOP\n0 0\n","output":"6 2\n1 1\n"},{"problem_id":"p00687","input":"10 2 3\n10 2 5\n100 5 25\n0 0 0\n","output":"1\n2\n80\n"},{"problem_id":"p00688","input":"2 5 2\n1 1 1\n10 -7 0\n1 0 -3\n0 0 0\n","output":"2 1 1 2\nImpossible\n10 -7 1 0\nImpossible\n"},{"problem_id":"p00689","input":"8\n   60  70\n   20  40\n   50  50\n   70  10\n   10  70\n   80  90\n   70  50\n  100  50\n5\n   60  50\n    0  80\n   60  20\n   10  20\n   60  80\n0\n","output":"388.9\n250.0\n"},{"problem_id":"p00690","input":" 6  5\n 1  3  10\n 2  3  12\n 3  4   2\n 4  5  13\n 4  6  11\n10 10\n 1  2  11\n 2  3  25\n 2  5  81\n 2  6  82\n 4  5  58\n 5  9  68\n 6  7  80\n 6  9  67\n 8  9  44\n 9 10  21\n 0  0\n","output":"27\n2 3 4 5\n378\n6 2 5 9 6 7\n"},{"problem_id":"p00691","input":"6\n4\n2\n0\n","output":"27\n10\n6\n"},{"problem_id":"p00692","input":"4\n1 4 5 2\n3 1 4 3\n5 4 2 2\n4 5 2 3\n1 1 3 5\n5 1 5 1\n4 5 3 2\n3 2 1 4\n1 4 5 3\n2 3 4 2\n1 2 1 2\n5 4 5 4\n2 1 2 1\n3 5 3 4\n3 3 5 4\n4 2 3 1\n2 5 3 1\n3 5 4 2\n1 5 4 1\n4 5 3 2\n","output":"0\n4\n12\n0\n"},{"problem_id":"p00693","input":"2 5\npermit 192168?? ?12??34?\ndeny 19216899 012343?5\n19216711 11233340 HiIamACracker\n19216891 01234345 Hello\n19216899 01234345 HiIamAlsoACracker\n19216809 11200340 World\n00000000 99999999 TheEndOfTheWorld\n1 2\npermit 12345678 23456789\n19216891 01234345 Hello\n12345678 23456789 Hello\n0 0\n","output":"2\n19216891 01234345 Hello\n19216809 11200340 World\n1\n12345678 23456789 Hello\n"},{"problem_id":"p00694","input":"19\n  1 +x 1 +y +z 3 +z\n  3 +y -z +x +y -z -x +z 2 +z\n  2 +y\n19\n  1 +x 1 +y +z 3 +y -z +x +y -z -x +z 2 +y\n  3 +z\n  2 +z\n19\n  1 +x 1 +y +z 3 +z\n  3 +y -z +x +y -z -x +z 2 +y\n  2 +z\n18\n  1 -y\n  1 +y -z +x\n  1 +z +y +x +z +y -x -y 2 -y\n  2 +z\n3 +x +y +z\n3 +y +z -x\n0\n","output":"SAME\nSAME\nDIFFERENT\n"},{"problem_id":"p00695","input":"3\n1 1 0 1 0\n0 1 1 1 1\n1 0 1 0 1\n0 1 1 1 0\n0 1 1 0 0\n\n0 1 0 1 1\n0 1 0 1 0\n0 0 1 0 0\n0 0 1 1 0\n1 0 1 0 0\n\n1 1 1 1 0\n0 1 1 1 0\n0 1 1 0 1\n0 1 1 1 0\n0 0 0 0 1\n","output":"4\n3\n8\n"},{"problem_id":"p00697","input":"6\nWwRR wwrg RRGb rGBG RGrb RrRg RGrg rgBB Wrgr\nRrGb WWGR rGgb Wbrg wgBb GgBg WbBG Wwwg WWGG\nRBbr Wrbr wGGG wggR WgGR WBWb WRgB wBgG WBgG\nwBrg rGgb WRrB WWbw wRRB RbbB WRrb wrbb WgrG\nWrwB WWww wRRB WGGb Wbbg WBgG WrbG Wrww RBgg\nWWgg RBrr Rggr RGBg Wbgr WGbg WBbr WGWB GGGg\n","output":"40\n8\n32\n4\n12\n0\n"},{"problem_id":"p00698","input":"3 3\n? ? 70 105\n? 50 ? 150\n30 60 90 180\n45 150 240 435\n\n2 2\n? ? 40\n? ? 40\n40 40 80\n\n2 3\n? 30 40 90\n50 60 70 180\n70 90 110 270\n\n0\n","output":"-5\n40\n20\n80\n\nNO\n\n20\n"},{"problem_id":"p00699","input":"6\n0 0 0 0 0\n0 0 0 0 6\n0 2 4 5 3\n0 0 1 0 0\n0 0 0 0 0\n0 0 3 0 0\n0 0 2 0 0\n0 0 4 1 0\n0 0 0 5 0\n0 0 0 6 0\n0 0 0 3 0\n0 0 2 5 0\n0 4 1 0 0\n0 0 6 0 0\n0 0 0 0 0\n0 6 2 0 0\n0 0 4 0 0\n0 1 5 0 0\n0 0 3 0 0\n0 0 0 0 0\n0 0 0 0 6\n0 2 4 5 3\n0 0 1 0 0\n0 0 0 0 0\n0 0 0 1 0\n0 0 0 0 6\n0 2 4 5 3\n0 0 0 0 0\n0 0 0 0 0\n0 0 0 1 0\n","output":"true\ntrue\nfalse\nfalse\nfalse\nfalse\n"},{"problem_id":"p00700","input":"3\n1 0\n0 1\n-1 0\n1 0\n0 5\n-1 0\n0 -1\n5 0\n0 1\n0 -1\n1 0\n0 -4\n-3 0\n0 3\n2 0\n0 -2\n-1 0\n0 1\n0 -1\n1 0\n0 2\n-2 0\n0 -3\n3 0\n0 4\n-4 0\n0 -5\n-2 0\n0 0\n1 0\n-1 0\n0 0\n2 0\n0 1\n-1 0\n0 1\n-1 0\n0 -2\n0 0\n","output":"6 5\n1 0\n2 1\n"},{"problem_id":"p00701","input":"3\n1 3\n2 0\n0 0\n4\n4 1\n3 1\n1 2\n0 0\n5\n2 1\n3 1\n4 1\n3 2\n1 1\n0 0\n0\n","output":"1\n2\nend\n1\n1\n2\nend\n1\n4\nend\n"},{"problem_id":"p00702","input":"3\nnai tiruvantel ar varyuvantel i valar tielyama nu vilya\nqua ist qda quang ncw psts\nsvampti tsuldya jay quadal ciszeriol\n","output":"a r 3\nb a 0\nc i 1\nd a 2\ne l 3\nf a 0\ng a 0\nh a 0\ni s 2\nj a 1\nk a 0\nl y 2\nm a 1\nn a 1\no l 1\np a 0\nq d 1\nr i 1\ns t 1\nt i 3\nu v 2\nv a 5\nw a 0\nx a 0\ny a 3\nz e 1\nld y 1\nmb a 0\nmp t 1\nnc w 1\nnd a 0\nng a 0\nnt e 2\nnw a 0\nps ts 1\nqu a 3\ncw a 0\nts u 1\n"},{"problem_id":"p00703","input":"6 4\n160348 0 4\n913286 2 3\n431289 3 1\n671283 3 3\n10 8\n3827690415 2 8\n0482691573 1 9\n1924730586 3 7\n1378490256 1 9\n6297830541 1 9\n4829531706 3 7\n4621570983 1 9\n9820147536 6 4\n4 4\n2713 0 3\n1247 2 0\n1230 1 1\n1387 2 1\n6 5\n605743 0 4\n593026 2 2\n792456 1 2\n143052 1 3\n093614 3 3\n5 2\n12345 5 0\n67890 0 5\n0 0\n","output":"637281\n7820914536\n3287\nNO\nNO\n"},{"problem_id":"p00705","input":"3 2\n2 1 4\n0\n3 3 4 8\n3 2\n4 1 5 8 9\n3 2 5 9\n5 2 4 5 7 9\n3 3\n2 1 4\n3 2 5 9\n2 2 4\n3 3\n2 1 2\n3 1 2 9\n2 2 4\n0 0\n","output":"4\n5\n0\n2\n"},{"problem_id":"p00706","input":"16\n10 8\n2 2\n2 5\n2 7\n3 3\n3 8\n4 2\n4 5\n4 8\n6 4\n6 7\n7 5\n7 8\n8 1\n8 4\n9 6\n10 3\n4 3\n8\n6 4\n1 2\n2 1\n2 4\n3 4\n4 2\n5 3\n6 1\n6 2\n3 2\n0\n","output":"4\n3\n"},{"problem_id":"p00707","input":"7 4\n9R2A993\n0E314A0\n8A900DE\n820R037\n6 7\nJH03HE\nID7722\n0DA1AH\n30C9G5\n99971A\nCA7EAI\nAHLBEM\n20 2\nA1234567891234CBDEGH\nBDEDF908034265091499\n0 0\n","output":"23900037\n771971\n12345908034265091499\n"},{"problem_id":"p00708","input":"3\n10.000 10.000 50.000 10.000\n40.000 10.000 50.000 10.000\n40.000 40.000 50.000 10.000\n2\n30.000 30.000 30.000 20.000\n40.000 40.000 40.000 20.000\n5\n5.729 15.143 3.996 25.837\n6.013 14.372 4.818 10.671\n80.115 63.292 84.477 15.120\n64.095 80.924 70.029 14.881\n39.472 85.116 71.369 5.553\n0\n","output":"20.000\n0.000\n73.834\n"},{"problem_id":"p00709","input":"4 3\n0 1 1 1\n1 1 1 1\n1 1 1 1\n8 5\n0 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n1 1 1 0 1 1 1 1\n0 1 1 1 0 1 1 1\n8 8\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n10 10\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n1 1 0 1 1 0 1 1 0 1\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n1 1 0 1 1 0 1 1 0 1\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n1 1 0 1 1 0 1 1 0 1\n1 1 1 1 1 1 1 1 1 1\n0 0\n","output":"2\n6\n14\n29\n"},{"problem_id":"p00710","input":"5 2\n3 1\n3 1\n10 3\n1 10\n10 1\n8 3\n0 0\n","output":"4\n4\n"},{"problem_id":"p00711","input":"6 9\n....#.\n.....#\n......\n......\n......\n......\n......\n#@...#\n.#..#.\n11 9\n.#.........\n.#.#######.\n.#.#.....#.\n.#.#.###.#.\n.#.#..@#.#.\n.#.#####.#.\n.#.......#.\n.#########.\n...........\n11 6\n..#..#..#..\n..#..#..#..\n..#..#..###\n..#..#..#@.\n..#..#..#..\n..#..#..#..\n7 7\n..#.#..\n..#.#..\n###.###\n...@...\n###.###\n..#.#..\n..#.#..\n0 0\n","output":"45\n59\n6\n13\n"},{"problem_id":"p00712","input":"2 3 120 3\n2 3 300 3\n2 3 299 3\n2 3 12 3\n2 3 12000 7\n54 795 12000 7\n2 3 300 1\n2 1 200 5\n2 4 54 2\n0 0 0 0\n","output":"4\n7\n6\n2\n42\n1\n0\n9\n3\n"},{"problem_id":"p00713","input":"3\n6.47634 7.69628\n5.16828 4.79915\n6.69533 6.20378\n6\n7.15296 4.08328\n6.50827 2.69466\n5.91219 3.86661\n5.29853 4.16097\n6.10838 3.46039\n6.34060 2.41599\n8\n7.90650 4.01746\n4.10998 4.18354\n4.67289 4.01887\n6.33885 4.28388\n4.98106 3.82728\n5.12379 5.16473\n7.84664 4.67693\n4.02776 3.87990\n20\n6.65128 5.47490\n6.42743 6.26189\n6.35864 4.61611\n6.59020 4.54228\n4.43967 5.70059\n4.38226 5.70536\n5.50755 6.18163\n7.41971 6.13668\n6.71936 3.04496\n5.61832 4.23857\n5.99424 4.29328\n5.60961 4.32998\n6.82242 5.79683\n5.44693 3.82724\n6.70906 3.65736\n7.89087 5.68000\n6.23300 4.59530\n5.92401 4.92329\n6.24168 3.81389\n6.22671 3.62210\n0\n","output":"2\n5\n5\n11\n"},{"problem_id":"p00714","input":"2\n5\n15 40\n35 20\n50 45\n70 30\n80 10\n3\n20 3\n60 2\n65 2\n6\n40 4100\n25 7500\n10 18000\n90 7000\n25 15000\n25 22000\n5\n15 40\n35 20\n50 45\n70 30\n80 10\n2\n60 4\n75 1\n3\n60 6000\n75 6000\n85 6000\n","output":"0.666667\n21.4286\n36.6667\n11.1111\n40.0\n50.0\n30.0\n13.3333\n13.3333\n"},{"problem_id":"p00715","input":"7\nShijo-Kawaramachi\nKarasuma-Imadegawa\nKawaramachi-Imadegawa\nNishioji-Shijo\nKarasuma-Gojo\nTorimaru-Rokujo\nRokujo-Karasuma\n6\nShijo-Karasuma\nImadegawa-Nishioji\nNishioji-Gojo\nShijo-Torimaru\nTorimaru-Gojo\nShijo-Kawabata\n4\n1jo-Midosuji\nMidosuji-2jo\n2jo-Omotesando\nOmotesando-1jo\n4\nMidosuji-1jo\n1jo-Midosuji\nMidosuji-Omotesando\n1jo-1jo\n0\n","output":"8\nYES\nNO\nYES\nNO\nYES\nNO\n4\nYES\nYES\nNO\nNO\n"},{"problem_id":"p00716","input":"4\n1000000\n5\n2\n0 0.03125 3000\n1 0.03125 3000\n6620000\n7\n2\n0 0.0732421875 42307\n1 0.0740966796875 40942\n39677000\n4\n4\n0 0.0709228515625 30754\n1 0.00634765625 26165\n0 0.03662109375 79468\n0 0.0679931640625 10932\n10585000\n6\n4\n1 0.0054931640625 59759\n1 0.12353515625 56464\n0 0.0496826171875 98193\n0 0.0887451171875 78966\n","output":"1150357\n10559683\n50796918\n20829397\n"},{"problem_id":"p00717","input":"5\n5\n0 0\n2 0\n2 1\n4 1\n4 0\n5\n0 0\n0 2\n-1 2\n-1 4\n0 4\n5\n0 0\n0 1\n-2 1\n-2 2\n0 2\n5\n0 0\n0 -1\n2 -1\n2 0\n4 0\n5\n0 0\n2 0\n2 -1\n4 -1\n4 0\n5\n0 0\n2 0\n2 1\n4 1\n4 0\n4\n4\n-60 -75\n-60 -78\n-42 -78\n-42 -6\n4\n10 3\n10 7\n-4 7\n-4 40\n4\n-74 66\n-74 63\n-92 63\n-92 135\n4\n-12 22\n-12 25\n-30 25\n-30 -47\n4\n12 -22\n12 -25\n30 -25\n30 47\n3\n5\n-8 5\n-8 2\n0 2\n0 4\n8 4\n5\n-3 -1\n0 -1\n0 7\n-2 7\n-2 16\n5\n-1 6\n-1 3\n7 3\n7 5\n16 5\n5\n0 1\n0 -2\n8 -2\n8 0\n17 0\n0\n","output":"1\n3\n5\n+++++\n3\n4\n+++++\n+++++\n"},{"problem_id":"p00718","input":"10\nxi x9i\ni 9i\nc2x2i 4c8x8i\nm2ci 4m7c9x8i\n9c9x9i i\ni 9m9c9x8i\nm i\ni m\nm9i i\n9m8c7xi c2x8i\n","output":"3x\nx\n6cx\n5m9c9x9i\nm\n9m9c9x9i\nmi\nmi\nmx\n9m9c9x9i\n"},{"problem_id":"p00719","input":"3 4 3 1 4\n3 1 2\n1 2 10\n2 3 30\n3 4 20\n2 4 4 2 1\n3 1\n2 3 3\n1 3 3\n4 1 2\n4 2 5\n2 4 3 4 1\n5 5\n1 2 10\n2 3 10\n3 4 10\n1 2 0 1 2\n1\n8 5 10 1 5\n2 7 1 8 4 5 6 3\n1 2 5\n2 3 4\n3 4 7\n4 5 3\n1 3 25\n2 4 23\n3 5 22\n1 4 45\n2 5 51\n1 5 99\n0 0 0 0 0\n","output":"30.000\n3.667\nImpossible\nImpossible\n2.856\n"},{"problem_id":"p00720","input":"3 5 10\nred\n0 0 0\n5 0 0\ngreen\n0 5 5\n5 6 1\nblue\n0 40 5\n5 0 0\n3 10 5\natom\n0 47 32\n5 -10 -7\n10 1 0\npluto\n0 0 0\n7 0 0\n10 3 3\ngesicht\n0 25 7\n5 -7 -2\n10 -1 10\n4 100 7\nimpulse\n0 -500 0\n100 10 1\nfreedom\n0 -491 0\n100 9 2\ndestiny\n0 -472 0\n100 7 4\nstrike\n0 -482 0\n100 8 3\n0 0 0\n","output":"blue\ngreen\nred\natom\ngesicht\npluto\nfreedom\nimpulse\nstrike\n"},{"problem_id":"p00721","input":"7 5\n.......\n.o...*.\n.......\n.*...*.\n.......\n15 13\n.......x.......\n...o...x....*..\n.......x.......\n.......x.......\n.......x.......\n...............\nxxxxx.....xxxxx\n...............\n.......x.......\n.......x.......\n.......x.......\n..*....x....*..\n.......x.......\n10 10\n..........\n..o.......\n..........\n..........\n..........\n.....xxxxx\n.....x....\n.....x.*..\n.....x....\n.....x....\n0 0\n","output":"8\n49\n-1\n"},{"problem_id":"p00722","input":"367 186 151\n179 10 203\n271 37 39\n103 230 1\n27 104 185\n253 50 85\n1 1 1\n9075 337 210\n307 24 79\n331 221 177\n259 170 40\n269 58 102\n0 0 0\n","output":"92809\n6709\n12037\n103\n93523\n14503\n2\n899429\n5107\n412717\n22699\n25673\n"},{"problem_id":"p00723","input":"4\naa\nabba\nabcd\nabcde\n","output":"1\n6\n12\n18\n"},{"problem_id":"p00724","input":"3\n2 -2\n2 -1\n1 0\n1\n0 2\n0 0\n4\n2 -2\n2 -1\n2 0\n3 0\n2\n1 -1\n0 2\n0 0\n8\n-6 0\n-5 0\n-4 0\n-3 0\n-2 0\n-1 0\n0 0\n1 0\n1\n-1 1\n0 0\n6\n2 -3\n3 -3\n3 -2\n3 -1\n3 0\n2 1\n3\n1 -1\n1 0\n1 1\n0 0\n3\n-8000 4996\n-8000 4997\n-8000 4998\n2\n-7999 4999\n-8001 5000\n-8000 5000\n8\n10 -8\n9 -7\n9 -6\n9 -5\n9 -4\n9 -3\n9 -2\n9 -1\n0\n0 0\n0\n","output":"3\n9\n18\n18\n19\n20\n"},{"problem_id":"p00725","input":"2 1\n3 2\n6 6\n1 0 0 2 1 0\n1 1 0 0 0 0\n0 0 0 0 0 3\n0 0 0 0 0 0\n1 0 0 0 0 1\n0 1 1 1 1 1\n6 1\n1 1 2 1 1 3\n6 1\n1 0 2 1 1 3\n12 1\n2 0 1 1 1 1 1 1 1 1 1 3\n13 1\n2 0 1 1 1 1 1 1 1 1 1 1 3\n0 0\n","output":"1\n4\n-1\n4\n10\n-1\n"},{"problem_id":"p00726","input":"ABC 3\nABC 0\n2(4(AB)3(XY))10C 30\n1000(1000(1000(1000(1000(1000(NM)))))) 999999\n0 0\n","output":"0\nA\nC\nM\n"},{"problem_id":"p00727","input":"3\n1 1\n3 1\n4 3\n4\n1 1\n2 3\n3 8\n1 9\n8\n1 1\n3 1\n6 1\n1 3\n5 3\n1 7\n3 5\n5 5\n8\n20 7\n1 27\n30 14\n9 6\n17 13\n4 2\n17 7\n8 9\n0\n","output":"2.553590050042226\n0.982793723247329\n1.570796326794896\n2.819842099193151\n1.325817663668032\n2.094395102393196\n2.777613697080149\n0.588002603547568\n"},{"problem_id":"p00728","input":"3\n1000\n342\n0\n5\n2\n2\n9\n11\n932\n5\n300\n1000\n0\n200\n400\n8\n353\n242\n402\n274\n283\n132\n402\n523\n0\n","output":"342\n7\n300\n326\n"},{"problem_id":"p00729","input":"4 2\n10\n775 1 1 1\n780 4 2 1\n790 2 1 1\n800 2 1 0\n810 3 1 1\n820 1 1 0\n825 3 1 0\n860 1 1 1\n870 4 2 0\n880 1 1 0\n1\n780 870 1\n13 15\n12\n540 12 13 1\n600 12 13 0\n650 13 15 1\n660 12 15 1\n665 11 13 1\n670 13 15 0\n675 11 13 0\n680 12 15 0\n1000 11 14 1\n1060 12 14 1\n1060 11 14 0\n1080 12 14 0\n3\n540 700 13\n600 1000 15\n1000 1200 11\n1 1\n2\n600 1 1 1\n700 1 1 0\n5\n540 600 1\n550 650 1\n610 620 1\n650 750 1\n700 800 1\n0 0\n","output":"55\n70\n30\n0\n0\n50\n10\n50\n0\n"},{"problem_id":"p00730","input":"3 5 6\n1 18\n2 19\n1 2\n3 4 1\n1 1\n2 1\n3 1\n0 2 5\n0 0 0\n","output":"4 4 6 16\n1 1 1 1\n10\n"},{"problem_id":"p00731","input":"6 6\n4 4 X X T T\n4 7 8 2 X 7\n3 X X X 1 8\n1 2 X X X 6\n1 1 2 4 4 7\nS S 2 3 X X\n2 10\nT 1\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n2 10\nT X\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n10 10\nT T T T T T T T T T\nX 2 X X X X X 3 4 X\n9 8 9 X X X 2 9 X 9\n7 7 X 7 3 X X 8 9 X\n8 9 9 9 6 3 X 5 X 5\n8 9 9 9 6 X X 5 X 5\n8 6 5 4 6 8 X 5 X 5\n8 9 3 9 6 8 X 5 X 5\n8 3 9 9 6 X X X 5 X\nS S S S S S S S S S\n10 7\n2 3 2 3 2 3 2 3 T T\n1 2 3 2 3 2 3 2 3 2\n3 2 3 2 3 2 3 2 3 4\n3 2 3 2 3 2 3 2 3 5\n3 2 3 1 3 2 3 2 3 5\n2 2 3 2 4 2 3 2 3 5\nS S 2 3 2 1 2 3 2 3\n0 0\n","output":"12\n5\n-1\n22\n12\n"},{"problem_id":"p00732","input":"4.0 2.0 8\n-1 0\n5 0\n5 -2\n7 -2\n7 0\n18 0\n18 6\n-1 6\n4.0 2.0 4\n-1 0\n10 0\n10 12\n-1 12\n4.0 1.0 7\n-1 0\n2 0\n-1 -3\n-1 -8\n6 -8\n6 6\n-1 6\n4.0 2.0 6\n-1 0\n10 0\n10 3\n7 3\n7 5\n-1 5\n5.0 2.0 6\n-1 0\n2 0\n2 -4\n6 -4\n6 6\n-1 6\n6.0 1.0 8\n-1 0\n8 0\n7 2\n9 2\n8 4\n11 4\n11 12\n-1 12\n0 0 0\n","output":"16.0 0.0\n9.999999999999998 7.4641016151377535\n0.585786437626906 -5.414213562373095\n8.0 0.0\n6.0 0.0\n9.52786404500042 4.0\n"},{"problem_id":"p00733","input":"(((x x) x) ((x x) (x (x x))))\n(((x x) (x x)) ((x x) ((x x) (x x))))\n(((x x) ((x x) x)) (((x (x x)) x) (x x)))\n(((x x) x) ((x x) (((((x x) x) x) x) x)))\n(((x x) x) ((x (x x)) (x (x x))))\n((((x (x x)) x) (x ((x x) x))) ((x (x x)) (x x)))\n((((x x) x) ((x x) (x (x x)))) (((x x) (x x)) ((x x) ((x x) (x x)))))\n0\n","output":"((x (x x)) ((x x) ((x x) x)))\n(((x x) ((x x) (x x))) ((x x) (x x)))\n(((x ((x x) x)) (x x)) ((x x) ((x x) x)))\n(((x ((x ((x x) x)) x)) (x x)) ((x x) x))\n((x (x x)) ((x (x x)) ((x x) x)))\n(((x (x x)) (x x)) ((x ((x x) x)) ((x (x x)) x)))\n(((x (x x)) ((x x) ((x x) x))) (((x x) (x x)) (((x x) (x x)) (x x))))\n"},{"problem_id":"p00734","input":"2 2\n1\n5\n3\n7\n6 5\n3\n9\n5\n2\n3\n3\n12\n2\n7\n3\n5\n4 5\n10\n0\n3\n8\n1\n9\n6\n0\n6\n7 4\n1\n1\n2\n1\n2\n1\n4\n2\n3\n4\n3\n2 3\n1\n1\n2\n2\n2\n0 0\n","output":"1 3\n3 5\n-1\n2 2\n-1\n"},{"problem_id":"p00735","input":"205920\n262144\n262200\n279936\n299998\n1\n","output":"205920: 6 8 13 15 20 22 55 99\n262144: 8\n262200: 6 8 15 20 50 57 69 76 92 190 230 475 575 874 2185\n279936: 6 8 27\n299998: 299998\n"},{"problem_id":"p00736","input":"(P*Q)\n(--R+(P*Q))\n(P*-P)\n2\n1\n(-1+(((---P+Q)*(--Q+---R))*(-R+-P)))\n.\n","output":"3\n11\n0\n27\n0\n7\n"},{"problem_id":"p00737","input":"8 3\n0 0 0 0 0 0 0 1\n2 3 0 1 4 0 0 1\n3 3 0 0 0 0 0 4\n9 9 1 9\n4 4\n3 3 4 0\n1 2 4 4\n1 1 1 0\n0 2 4 4\n8 7 2 1\n2 8\n2 2\n4 1\n0 4\n1 3\n1 0\n2 1\n0 3\n1 4\n1 9 3 1\n0 0\n","output":"1\n11\n6\n"},{"problem_id":"p00738","input":"2\n-40 -40 100 30\n-100 -100 -50 -30 1\n30 -70 90 -30 10\n2\n-4 -4 10 3\n-10 -10 -5 -3 1\n3 -7 9 -3 1\n2\n-40 -40 100 30\n-100 -100 -50 -30 3\n30 -70 90 -30 10\n2\n-400 -400 1000 300\n-800 -800 -500 -300 7\n300 -700 900 -300 20\n3\n20 70 150 70\n0 0 50 50 4\n40 100 60 120 8\n130 80 200 200 1\n3\n20 70 150 70\n0 0 50 50 4\n40 100 60 120 10\n130 80 200 200 1\n3\n20 70 150 70\n0 0 50 50 10\n40 100 60 120 10\n130 80 200 200 3\n1\n2 4 8 8\n0 0 10 10 1\n1\n1 4 9 9\n2 2 7 7 1\n0\n","output":"30\n1\n18.16666666667\n717.7857142857\n50.5\n50\n18.16666666667\n0\n0\n"},{"problem_id":"p00739","input":"2 2\n1 1\n1 1\n3 3\n0 1 0\n1 1 0\n1 1 1\n4 6\n1 1 1 0\n1 1 1 1\n1 1 1 0\n1 1 1 0\n0 1 1 0\n1 1 1 0\n7 5\n0 0 1 0 0 1 1\n0 1 1 1 1 1 0\n0 1 1 1 1 1 0\n1 1 1 1 1 1 0\n1 0 0 0 1 1 0\n9 7\n0 0 1 0 0 0 0 0 0\n0 0 1 1 0 0 0 0 0\n1 1 1 1 1 1 1 1 0\n1 1 1 1 1 1 1 1 0\n0 1 1 1 1 1 1 1 1\n0 0 0 1 1 0 0 0 0\n0 0 0 1 0 0 0 0 0\n9 7\n0 0 1 0 0 0 0 0 0\n0 0 1 0 0 0 0 0 0\n1 1 1 1 1 1 1 1 0\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n0 0 0 1 0 0 0 0 0\n0 0 0 1 0 0 0 0 0\n7 6\n1 1 1 1 1 1 1\n1 1 1 1 1 1 1\n1 1 1 1 1 1 0\n1 1 1 1 1 1 0\n0 1 1 1 1 1 0\n0 1 1 1 1 1 0\n10 10\n0 1 1 1 1 1 1 1 1 1\n1 1 0 0 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0\n1 1 1 0 0 0 0 0 1 0\n1 1 1 1 1 1 1 1 1 0\n0 0\n","output":"YES\nNO\nYES\nYES\nYES\nNO\nNO\nYES\n"},{"problem_id":"p00740","input":"3 2\n3 3\n3 50\n10 29\n31 32\n50 2\n50 50\n0 0\n","output":"1\n0\n1\n5\n30\n1\n13\n"},{"problem_id":"p00741","input":"1 1\n0\n2 2\n0 1\n1 0\n3 2\n1 1 1\n1 1 1\n5 4\n1 0 1 0 0\n1 0 0 0 0\n1 0 1 0 1\n1 0 0 1 0\n5 4\n1 1 1 0 1\n1 0 1 0 1\n1 0 1 0 1\n1 0 1 1 1\n5 5\n1 0 1 0 1\n0 0 0 0 0\n1 0 1 0 1\n0 0 0 0 0\n1 0 1 0 1\n0 0\n","output":"0\n1\n1\n3\n1\n9\n"},{"problem_id":"p00742","input":"3\nACM\nIBM\nICPC\n3\nGAME\nBEST\nGAMER\n4\nA\nB\nC\nAB\n3\nA\nB\nCD\n3\nONE\nTWO\nTHREE\n3\nTWO\nTHREE\nFIVE\n3\nMOV\nPOP\nDIV\n9\nA\nB\nC\nD\nE\nF\nG\nH\nIJ\n0\n","output":"4\n1\n8\n30\n0\n0\n0\n40320\n"},{"problem_id":"p00743","input":"2 0\n1 2\n5 4\n1 5\n1 2 1 1\n2 3 2 2\n3 4 2 2\n4 5 1 1\n6 6\n1 6\n1 2 2 1\n2 3 2 1\n3 6 2 1\n1 4 2 30\n4 5 3 30\n5 6 2 30\n6 7\n1 6\n1 2 1 30\n2 3 1 30\n3 1 1 30\n3 4 100 30\n4 5 1 30\n5 6 1 30\n6 4 1 30\n0 0\n","output":"unreachable\n4.00000\n5.50000\n11.25664\n"},{"problem_id":"p00744","input":"4 3\n2 6 6 15\n2 3 5\n2 3\n4 9\n8 16 32\n4 2\n4 9 11 13\n5 7\n5 5\n2 3 5 1001 1001\n7 11 13 30 30\n10 10\n2 3 5 7 9 11 13 15 17 29\n4 6 10 14 18 22 26 30 34 38\n20 20\n195 144 903 63 137 513 44 626 75 473\n876 421 568 519 755 840 374 368 570 872\n363 650 155 265 64 26 426 391 15 421\n373 984 564 54 823 477 565 866 879 638\n100 100\n195 144 903 63 137 513 44 626 75 473\n876 421 568 519 755 840 374 368 570 872\n363 650 155 265 64 26 426 391 15 421\n373 984 564 54 823 477 565 866 879 638\n117 755 835 683 52 369 302 424 513 870\n75 874 299 228 140 361 30 342 750 819\n761 123 804 325 952 405 578 517 49 457\n932 941 988 767 624 41 912 702 241 426\n351 92 300 648 318 216 785 347 556 535\n166 318 434 746 419 386 928 996 680 975\n231 390 916 220 933 319 37 846 797 54\n272 924 145 348 350 239 563 135 362 119\n446 305 213 879 51 631 43 755 405 499\n509 412 887 203 408 821 298 443 445 96\n274 715 796 417 839 147 654 402 280 17\n298 725 98 287 382 923 694 201 679 99\n699 188 288 364 389 694 185 464 138 406\n558 188 897 354 603 737 277 35 139 556\n826 213 59 922 499 217 846 193 416 525\n69 115 489 355 256 654 49 439 118 961\n0 0\n","output":"3\n1\n0\n4\n9\n18\n85\n"},{"problem_id":"p00745","input":"6 16\n5 4\n11 988\n474 975\n459 16\n985 12\n984 982\n242 227\n140 266\n45 410\n92 570\n237 644\n370 567\n406 424\n336 290\n756 220\n634 251\n511 404\n575 554\n726 643\n868 571\n907 403\n845 283\n10 4\n261 196\n943 289\n859 925\n56 822\n112 383\n514 0\n1000 457\n514 1000\n0 485\n233 224\n710 242\n850 654\n485 915\n140 663\n26 5\n0 953\n180 0\n299 501\n37 301\n325 124\n162 507\n84 140\n913 409\n635 157\n645 555\n894 229\n598 223\n783 514\n765 137\n599 445\n695 126\n859 462\n599 312\n838 167\n708 563\n565 258\n945 283\n251 454\n125 111\n28 469\n1000 1000\n185 319\n717 296\n9 315\n372 249\n203 528\n15 15\n200 247\n859 597\n340 134\n967 247\n421 623\n1000 427\n751 1000\n102 737\n448 0\n978 510\n556 907\n0 582\n627 201\n697 963\n616 608\n345 819\n810 809\n437 706\n702 695\n448 474\n605 474\n329 355\n691 350\n816 231\n313 216\n864 360\n772 278\n756 747\n529 639\n513 525\n0 0\n","output":"2257.0518296609\n3609.92159564177\n2195.83727086364\n3619.77160684813\n"},{"problem_id":"p00746","input":"1\n5\n0 0\n0 1\n0 2\n0 3\n12\n0 0\n1 0\n2 0\n3 1\n4 1\n5 1\n6 2\n7 2\n8 2\n9 3\n10 3\n10\n0 2\n1 2\n2 2\n3 2\n2 1\n5 1\n6 1\n7 1\n8 1\n0\n","output":"1 1\n3 3\n4 4\n5 6\n"},{"problem_id":"p00748","input":"40\n14\n5\n165\n120\n103\n106\n139\n0\n","output":"2 6\n2 14\n2 5\n1 1\n1 18\n5 35\n4 4\n3 37\n"},{"problem_id":"p00749","input":"4 5\n..33\n..33\n2222\n..1.\n.111\n5 7\n....1\n.1..1\n.1..1\n11..1\n.2222\n..111\n...1.\n3 6\n.3.\n233\n23.\n22.\n.11\n.11\n4 3\n2222\n..11\n..11\n4 5\n.3..\n33..\n322.\n2211\n.11.\n3 3\n222\n2.1\n111\n3 4\n11.\n11.\n.2.\n222\n3 4\n.11\n.11\n.2.\n222\n2 7\n11\n.1\n21\n22\n23\n.3\n33\n2 3\n1.\n11\n.1\n0 0\n","output":"STABLE\nSTABLE\nSTABLE\nUNSTABLE\nSTABLE\nSTABLE\nUNSTABLE\nUNSTABLE\nUNSTABLE\nUNSTABLE\n"},{"problem_id":"p00750","input":"4 7 0 2\n0 1 abra\n0 1 oil\n2 0 ket\n1 3 cada\n3 3 da\n3 2 bra\n2 3 ket\n2 2 0 1\n0 0 a\n0 1 b\n5 6 3 0\n3 1 op\n3 2 op\n3 4 opq\n1 0 st\n2 0 qr\n4 0 r\n2 1 0 1\n1 1 loooop\n0 0 0 0\n","output":"abracadabra\nNO\nopqr\nNO\n"},{"problem_id":"p00751","input":"1 4\nAABBCCDDEEFFGGHHIJJKKLLMMNNOOPP\nAABBCCDDEEFFGG\nCCDDEEFFGGHHII\nFFGGHHIIJJKKLL\nJJKKLLMMNNOOPP\n2 3\nABRACADABRA.ABBRACADABRA.\nABRACADABRA.A\n.ABRACADABRA.\nBRA.ABRACADAB\n2 2\nAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAA\nAAAAAAAAAAAAA\n2 3\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nXXXXXXAXXXXXX\nXXXXXXBXXXXXX\nXXXXXXXXXXXXX\n0 0\n","output":"1\nAABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP\n5\n.ABRACADABRA.ABRACADABRA.\nABRACADABRA.A.ABRACADABRA.\nABRACADABRA.AABRACADABRA.A\nABRACADABRA.ABRACADABRA.\nABRACADABRA.ABRACADABRA.A\n5\nAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAA\n257\n"},{"problem_id":"p00752","input":"2\n30 10 30 75\n60 30 60 95\n90 0\n0 100\n1\n20 81 90 90\n10 90\n90 10\n2\n10 0 10 58\n20 20 20 58\n0 70\n30 0\n4\n8 0 8 60\n16 16 16 48\n16 10 28 30\n16 52 28 34\n24 0\n24 64\n5\n8 0 8 60\n16 16 16 48\n16 10 28 30\n16 52 28 34\n100 0 100 50\n24 0\n24 64\n0\n","output":"180.27756377319946\n113.13708498984761\n98.99494936611666\n90.50966799187809\n90.50966799187809\n"},{"problem_id":"p00760","input":"8\n1 1 1\n344 3 1\n696 5 1\n182 9 5\n998 8 7\n344 2 19\n696 4 19\n999 10 20\n","output":"196470\n128976\n59710\n160715\n252\n128977\n59712\n1\n"},{"problem_id":"p00761","input":"2012 4\n83268 6\n1112 4\n0 1\n99 2\n0 0\n","output":"3 6174 1\n1 862632 7\n5 6174 1\n0 0 1\n1 0 1\n"},{"problem_id":"p00762","input":"4\n6 4\n6 4\n6 4\n6 4\n2\n5 3\n5 3\n8\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n6\n4 6\n1 5\n2 3\n5 3\n2 4\n4 2\n0\n","output":"0 1 1 0 0 1\n1 0 0 0 1 0\n1 2 2 1 0 0\n2 3 0 0 0 0\n"},{"problem_id":"p00763","input":"4 4 2 1 4\n1 2 2 1\n2 3 2 1\n3 4 5 1\n2 4 4 2\n3 1\n3 6\n10 5 3\n\n10\n2 0 1 1 2\n1\n\n1\n4 5 2 4 1\n4 3 10 1\n3 2 2 1\n3 2 1 2\n3 2 5 2\n2 1 10 1\n3 3\n20 30\n3 2 1\n5 10\n3 2 1\n5 5 2 1 5\n1 2 10 2\n1 3 20 2\n2 4 20 1\n3 4 10 1\n4 5 20 1\n2 2\n20\n4 1\n20\n3 1\n0 0 0 0 0\n","output":"54\n-1\n63\n130\n"},{"problem_id":"p00764","input":"10\n802 0 10\n814 0 4\n820 1 4\n826 1 4\n832 3 5\n838 5 5\n845 7 3\n849 10 3\n853 14 4\n857 18 3\n3\n0 0 5\n8 0 5\n8 8 5\n3\n0 0 5\n7 3 6\n16 0 5\n9\n0 3 5\n8 0 8\n19 2 8\n23 14 6\n23 21 6\n23 28 6\n19 40 8\n8 42 8\n0 39 5\n11\n0 0 5\n8 0 5\n18 8 10\n8 16 5\n0 16 5\n0 24 5\n3 32 5\n10 32 5\n17 28 8\n27 25 3\n30 18 5\n0\n","output":"58.953437\n11.414214\n16.0\n61.874812\n63.195179\n"},{"problem_id":"p00765","input":"1 1 1\na\n3 3 4\na+ * a *\n2 2 3\na a b\n2 2 3\n* * *\n2 2 3\n* b b\n2 2 2\na a\n2 3 3\na a+ a++\n2 6 6\na a+ a++ b b+ b++\n4 13 5\na a * * *\n4 13 5\na a b b *\n4 13 5\na a a * *\n4 13 5\na a+ a++ a+++ a++++\n4 13 5\n* * * * *\n4 13 5\na a a b b\n4 13 5\na a a a *\n7 60 7\na b a b c c *\n7 60 7\n* * * * * * *\n7 60 7\na a+ a++ a+++ a++++ a+++++ a++++++\n1 14 4\nb a+ a a\n0 0 0\n","output":"1.0000000000\n0.8809523810\n1.0000000000\n1.0000000000\n1.0000000000\n0.3333333333\n0.4000000000\n0.1212121212\n0.4929171669\n0.0492196879\n0.0228091236\n0.0035460338\n1.0000000000\n0.0014405762\n0.0002400960\n0.0002967709\n1.0000000000\n0.0000001022\n0.0000000000\n"},{"problem_id":"p00766","input":"3 5\n###.#\n#####\n###..\n4 5\n.#.##\n.####\n####.\n##.#.\n8 8\n.#.#.#.#\n########\n.######.\n########\n.######.\n########\n.######.\n########\n8 8\n.#.#.#.#\n########\n.##.#.#.\n##....##\n.##.###.\n##...###\n.##.###.\n###.#.##\n4 4\n####\n####\n####\n####\n0 0\n","output":"3\n5\n11\n19\n1\n"},{"problem_id":"p00767","input":"1 2\n1 3\n2 3\n1 4\n2 4\n5 6\n1 8\n4 7\n98 100\n99 100\n0 0\n","output":"1 3\n2 3\n1 4\n2 4\n3 4\n1 8\n4 7\n2 8\n3 140\n89 109\n"},{"problem_id":"p00768","input":"300 10 8 5\n50 5 2 1\n70 5 2 0\n75 1 1 0\n100 3 1 0\n150 3 2 0\n240 5 5 7\n50 1 1 0\n60 2 2 0\n70 2 3 0\n90 1 3 0\n120 3 5 0\n140 4 1 0\n150 2 4 1\n180 3 5 4\n15 2 2 1\n20 2 2 1\n25 2 2 0\n60 1 1 0\n120 5 5 4\n15 5 4 1\n20 5 4 0\n40 1 1 0\n40 2 2 0\n120 2 3 4\n30 1 1 0\n40 2 1 0\n50 2 2 0\n60 1 2 0\n120 3 3 2\n0 1 1 0\n1 2 2 0\n300 5 8 0\n0 0 0 0\n","output":"3,1,5,10=9=8=7=6=4=2\n2,1,3,4,5\n1,2,3\n5=2=1,4=3\n2=1\n1,2,3\n5=4=3=2=1\n"},{"problem_id":"p00769","input":"6\n[[123][4567][89]]\n[[5][3][7][3][9]]\n[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]\n[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]\n[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]\n[[8231][3721][203][3271][8843]]\n","output":"107\n7\n175\n95\n21\n3599\n"},{"problem_id":"p00770","input":"49 22\n46 37\n42 23\n945 561\n1081 681\n1056 452\n1042 862\n973 677\n1000000 1000000\n0 0\n","output":"0 0\n6 43\n1 23\n20 829\n18 947\n10 947\n13 947\n23 947\n534 993541\n"},{"problem_id":"p00771","input":"3\n10 10 20\n10 -10 20\n-10 10 120\n1\n10 10 16\n2\n10 10 20\n10 -10 20\n2\n100 0 101\n-90 0 91\n2\n0 0 53\n30 40 102\n3\n10 10 20\n10 -10 20\n-10 -10 20\n3\n1 5 13\n5 -3 13\n-3 -3 13\n3\n98 97 168\n-82 -80 193\n-99 -96 211\n4\n90 -100 160\n-80 -80 150\n90 80 150\n80 80 245\n4\n85 -90 290\n-80 -80 220\n-85 90 145\n85 90 170\n5\n0 0 4\n3 0 5\n-3 0 5\n0 3 5\n0 -3 5\n10\n95 -93 260\n-86 96 211\n91 90 177\n-81 -80 124\n-91 91 144\n97 94 165\n-90 -86 194\n89 85 167\n-93 -80 222\n92 -84 218\n0\n","output":"17.3205081\n16.0000000\n17.3205081\n13.8011200\n53.0000000\n14.1421356\n12.0000000\n128.3928757\n94.1879092\n131.1240816\n4.0000000\n72.2251798\n"},{"problem_id":"p00772","input":"3 3 3\n1 2 3\n4 5 6\n2 1 2 5\n2 6 4 3\n2 5 3 1\n3 3 2\n1 1 1\n2 2 1\n2 1 1 2\n2 2 2 1\n7 1 2\n1 1 2 1 4 1 2\n4\n3 1 4 1 4\n3 2 4 2 4\n16 14 5\n2 1 2 2 1 3 2 1 3 2 2 1 1 3 1 2\n2 1 3 1 1 2 3 1 2 2 2 2 1 3\n2 3 1 3\n3 2 2 2 1\n3 2 2 1 2\n3 1 2 2 2\n4 2 1 2 2 2\n0 0 0\n","output":"2\n-1\n1\n9\n"},{"problem_id":"p00773","input":"5 8 105\n8 5 105\n1 2 24\n99 98 24\n12 13 26\n1 22 23\n1 13 201\n13 16 112\n2 24 50\n1 82 61\n1 84 125\n1 99 999\n99 1 999\n98 99 999\n1 99 11\n99 1 12\n0 0 0\n","output":"109\n103\n24\n24\n26\n27\n225\n116\n62\n111\n230\n1972\n508\n1004\n20\n7\n"},{"problem_id":"p00774","input":"1\n6 9 9 9 9\n5\n5 9 5 5 9\n5 5 6 9 9\n4 6 3 6 9\n3 3 2 9 9\n2 2 1 1 1\n10\n3 5 6 5 6\n2 2 2 8 3\n6 2 5 9 2\n7 7 7 6 1\n4 6 6 4 9\n8 9 1 1 8\n5 6 1 8 1\n6 8 2 1 2\n9 6 3 3 5\n5 3 8 8 8\n5\n1 2 3 4 5\n6 7 8 9 1\n2 3 4 5 6\n7 8 9 1 2\n3 4 5 6 7\n3\n2 2 8 7 4\n6 5 7 7 7\n8 8 9 9 9\n0\n","output":"36\n38\n99\n0\n72\n"},{"problem_id":"p00775","input":"2 3\n-2 -1 3\n0 1 3\n2 3 3\n2 2\n-2 0 4\n0 2 3\n2 6\n-3 3 1\n-2 3 2\n-1 3 3\n0 3 4\n1 3 5\n2 3 6\n2 6\n-3 3 1\n-3 2 2\n-3 1 3\n-3 0 4\n-3 -1 5\n-3 -2 6\n0 0\n","output":"0.0000\n3.0000\n2.2679\n2.2679\n"},{"problem_id":"p00776","input":"enw\nabc\nabcdefghijklmnopqrst\nz\n#\n","output":"1\nfox\n5\nacc\nacd\nbbd\nbcc\nbcd\n17711\nacceeggiikkmmooqqssu\nacceeggiikkmmooqqstt\nacceeggiikkmmooqqstu\nacceeggiikkmmooqrrtt\nacceeggiikkmmooqrrtu\nbcdefghijklmnopqrrtt\nbcdefghijklmnopqrrtu\nbcdefghijklmnopqrssu\nbcdefghijklmnopqrstt\nbcdefghijklmnopqrstu\n0\n"},{"problem_id":"p00777","input":"4\n1 2 3\n10 20 30\n10\n1 2 2 1 5 5 1 8 8\n10 1 1 20 1 1 30 1 1\n3\n1 1\n1 1\n0\n","output":"80\n136\n2\n"},{"problem_id":"p00778","input":"1 1 1 1 1 1\n1 6\n1 1 1 1 1 1\n4 5\n0 0 0 0 0 2\n1 2\n0 0 2 2 2 4\n5 9\n1 2 3 4 5 6\n15 16\n0 1 2 3 5 9\n13 16\n2 13 22 27 31 91\n100 170\n0 0 0 0 0 0\n","output":"EEENEE\nNE\nimpossible\nNSSNW\nEN\nEWNS\nSNSNSNSNSNSNSNSNSNSNSNSSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNSNWEWE\n"},{"problem_id":"p00779","input":"5 3\n0 0 1000\n1399 1331 931\n0 1331 500\n1398 0 400\n2000 360 340\n450 950 1600 380\n450 950 1399 1331\n450 950 450 2000\n1 2\n50 50 50\n0 10 100 90\n0 10 50 50\n2 2\n50 50 50\n100 50 50\n40 50 110 50\n40 50 0 0\n4 1\n25 100 26\n75 100 26\n50 40 40\n50 160 40\n50 81 50 119\n6 1\n100 50 40\n0 50 40\n50 0 48\n50 50 3\n55 55 4\n55 105 48\n50 55 55 50\n20 6\n270 180 50\n360 170 50\n0 0 50\n10 0 10\n0 90 50\n0 180 50\n90 180 50\n180 180 50\n205 90 50\n180 0 50\n65 0 20\n75 30 16\n90 78 36\n105 30 16\n115 0 20\n128 48 15\n128 100 15\n280 0 30\n330 0 30\n305 65 42\n0 20 10 20\n0 20 10 0\n50 30 133 0\n50 30 133 30\n90 40 305 20\n90 40 240 30\n16 2\n0 0 50\n0 90 50\n0 180 50\n90 180 50\n180 180 50\n205 90 50\n180 0 50\n65 0 20\n115 0 20\n90 0 15\n280 0 30\n330 0 30\n305 65 42\n75 40 16\n90 88 36\n105 40 16\n128 35 250 30\n90 50 305 20\n0 0\n","output":"YES NO NO\nYES NO\nNO NO\nNO\nYES\nYES NO NO YES NO NO\nNO NO\n"},{"problem_id":"p00780","input":"6\n10\n12\n0\n","output":"1\n2\n1\n"},{"problem_id":"p00781","input":"10000 01000 00100 11000 01100 11111 01110 11100 10110 11110\n10101 01000 00000 11001 01100 11101 01110 11100 10110 11010\nEND\n","output":"40\n6\n"},{"problem_id":"p00782","input":"3\n4.0 4.0 3.0\n5.0 6.0 3.0\n5.5 4.5 1.0\n2\n3.0 3.0 3.0\n1.5 1.5 1.0\n0\n","output":"1 52.00\n2 36.00\n"},{"problem_id":"p00783","input":"As the first man said to the\nfirst woman:\n\"Madam, I'm Adam.\"\nShe responded:\n\"Eve.\"\n","output":"TOT\n\nMADAMIMADAM MADAM\nERE DED\nEVE\n"},{"problem_id":"p00784","input":"7\nX...XX.\n.X.....\n..X....\n...X...\n......X\n0\n","output":"34\n"},{"problem_id":"p00785","input":"3\n100 500\n200 500\n300 500\n6\n100 300\n100 600\n200 100\n200 700\n500 100\n600 300\n0\n","output":"166.6667 555.5556\n333.3333 333.3333\n"},{"problem_id":"p00786","input":"a(A,b(B,C));\nx( y( y( z(z), v( s, t ) ) ), u ) ;\n\na( b( c,\n      d(\n         e(f),\n         g\n       )\n    ),\n   h( i(\n         j(\n            k(k,k),\n            l(l)\n          ),\n         m(m)\n       )\n    )\n );\n\na(B(C),d(e(f(g(h(i(j,k),l),m),n),o),p))\n.\n","output":"1:\n B C\n ---\nA b\n---\n a\n2:\nz s t\n- ---\nz  v\n----\n y\n -\n y u\n ---\n  x\n3:\n   k k l\n   --- -\n f  k  l m\n -  ---- -\n e g j   m\n --- -----\nc d    i\n---    -\n b     h\n -------\n    a\n4:\nj k\n---\n i l\n ---\n  h m\n  ---\n   g n\n   ---\n    f o\n    ---\n   C e p\n   - ---\n   B  d\n   ----\n    a\n"},{"problem_id":"p00787","input":"6 28 6 32 25 32 26 27 26 24 6 24 99999\n2 28 2 35 30 35 30 20 2 20 99999\n\n3 28\n22.667\n0 1 1 1 1 0 0 -1 0 -1 1 0 0 0 1 0 -1 0 0 -1 -1 -1 -1 0 -1 0 -1 -1 -1 1 -1 1\n-1 1 -1 0 1 0 1 1 1 1 1 0 1 1 99999\n\n5 28\n22.667\n0 1 -1 1 1 0 1 -1 1 -1 1 0 1 0 1 0 -1 -1 -1 0 -1 -1 -1 0 -1 1 -1 -1 -1 1\n-1 0 -1 1 -1 0 1 0 1 0 1 1 1 1 1 1 99999\n\n4 28\n6.333\n0 1 0 1 1 -1 -1 -1 0 -1 0 -1 0 -1 99999\n\n3 28\n20.000\n0 -1 1 -1 1 0 1 1 1 1 1 0 -1 0 -1 0 -1 1 -1 1\n-1 1 -1 0 -1 -1 -1 -1 -1 -1 -1 0 1 0 1 -1 1 -1 1 -1 99999\n\n99999\n","output":"OK\nNG\nNG\nNG\n"},{"problem_id":"p00788","input":"2 5\n3 10\n5 100\n0 0\n","output":"3\/2 4\/3\n7\/4 5\/3\n85\/38 38\/17\n"},{"problem_id":"p00789","input":"2\n10\n30\n0\n","output":"1\n4\n27\n"},{"problem_id":"p00790","input":"1\nnorth\n3\nnorth\neast\nsouth\n0\n","output":"5\n1\n"},{"problem_id":"p00791","input":"7\n********\n*      *\n* ***  *\n* * *  *\n* ***  *\n*      *\n********\n9\n\n***\n*  *\n*****     *****\n          *   *\n    ***   *****\n   * *\n  * *\n ***\n11\n    ****                                      *******************\n   *   *  *********                          *                  *\n  ******  *       *    ****                 *  *********        *\n          * ***   *   *  *                 *  *         *       *\n***       * *  *  *  ****  *******        *  *  *** ***  *      *\n* *       * ***** *         *   *        *  *   * *  * *  *     *\n***       *       *          ***        *  *    ***   ***  *    *\n          *********                    *  *                 *   *\n                                      *  *********************  *\n                                     *                          *\n                                    *****************************\n0\n","output":"9 1\n56 1\n----------\n12 2\n15 1\n----------\n9 3\n12 2\n15 2\n63 1\n105 1\n264 1\n"},{"problem_id":"p00792","input":"0\n1\ny 8 7\n4\ny 8 7\nx 7 8\ny 0 0\nx 0 0\n4\ny 2 1\nx 1 2\ny 0 0\nx 0 0\n-1\n","output":"800 750\n750 800\n75 25\n75 25\n"},{"problem_id":"p00793","input":"2000 2000 8000 8000 9000 9500\n2500 2500 7500 2500 2500 7500\n0 0 0 0 0 0\n","output":"1 0.50000\n2 0.25000\n"},{"problem_id":"p00794","input":"3 3\n2 1 1\n1 1 0\n1 1 3\n8 4\n2 1 1 0 1 1 1 0\n1 0 4 1 1 0 4 1\n1 0 0 0 0 0 0 1\n1 1 1 4 1 1 1 3\n8 5\n1 2 1 1 1 1 1 4\n1 0 0 0 1 0 0 1\n1 4 1 0 1 1 0 1\n1 0 0 0 0 3 0 1\n1 1 4 1 1 1 1 1\n0 0\n","output":"4\n-1\n13\n"},{"problem_id":"p00795","input":"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsearchalgorithms.Forexample,ifyou\nwanttogetinformationonrecentcomparisonbetweenWindowsandUNIX,\nyoumayexpecttogetrelevantdescriptionoutofabigbunchofWeb\ntexts,byextractingtextsthatcontainbothkeywords\"Windows\"and\"UNIX\"\nclosetogether.\n\nbWn\n\n3.1415926535897932384626433832795028841971693993751058209749445923078164\n\npi\n\nWagner,Bach,Beethoven,Chopin,Brahms,Hindemith,Ives,Suk,Mozart,Stravinsky\n\nWeary\n\nASCIIcharacterssuchas+,*,[,#,\n","output":"1\n\nfirstexampleistriv\n\n7\n\nnWWW.Alb\n\n0\n\n1\n\nWagner,Bach,Beethoven,Chopin,Brahms,Hindemith,Ives,Suk,Mozart,Stravinsky\n\n1\n\nCIIcharacterssuchas+,*,[,#,\n"},{"problem_id":"p00796","input":"2\n   50.36493  81.61338  79.96592\n5\n  -10293.83 -4800.033 -5296.238\n   14936.30  6964.826  7684.818\n  -4516.069  25748.41 -27016.06\n   18301.59 -11946.25  5380.309\n   27115.20  43415.93 -71607.81\n   11.51547  13.35555  14.57307\n5\n  -56292.27  2583.892  67754.62\n  -567.5082 -756.2763 -118.7268\n  -1235.987 -213.3318 -216.4862\n  -317.6108 -54.81976 -55.63033\n   22505.44 -40752.88  27482.94\n","output":"1 2 4\n3 4 2\n"},{"problem_id":"p00797","input":"6 5\nJohn\n Robert\n  Frank\n  Andrew\n Nancy\n  David\nRobert is a child of John.\nRobert is an ancestor of Andrew.\nRobert is a sibling of Nancy.\nNancy is the parent of Frank.\nJohn is a descendant of Andrew.\n2 1\nabc\n xyz\nxyz is a child of abc.\n0 0\n","output":"True\nTrue\nTrue\nFalse\nFalse\n\nTrue\n"},{"problem_id":"p00798","input":"5 5\n0 0 0 0 0\n4 2 0 1 1\n0 1 0 0 0\n1 0 0 0 3\n1 0 0 0 0\n5 3\n4 0 0 0 0\n2 0 0 0 0\n0 0 0 0 3\n7 5\n1 1 4 1 0 0 0\n1 1 2 1 0 0 0\n3 0 0 0 0 0 0\n0 1 0 1 0 0 0\n0 0 0 1 0 0 0\n6 6\n0 0 0 0 0 3\n0 0 0 0 0 0\n0 0 0 0 0 0\n0 0 0 0 0 0\n0 2 0 0 0 0\n4 0 0 0 0 0\n0 0\n","output":"5\n-1\n11\n8\n"},{"problem_id":"p00799","input":"3 25\n3 1 2 1 4 1 0\n1 1 0\n2 1 3 2 0\n\n4 1000\n80 20 80 20 80 20 80 20 0\n80\n20\n0\n80 20 90\n10 80\n20\n0\n90 10\n0\n\n0 0\n","output":"10\n110\n"},{"problem_id":"p00800","input":"3\n12BC3BC4BNBBDD5\naaaBCNBBBCb\naaaBBCbNBC\n","output":"15234\naba\nERROR\n"},{"problem_id":"p00801","input":"3\n5\n7\n15\n655\n2711\n6395\n7195\n8465\n0\n","output":"2 3\n1 1\n9 11\n105 65\n398 332\n415 332\n430 332\n428 332\n190 421\n"},{"problem_id":"p00802","input":"4 3\n0.0 0.25 0.5 0.666666666666666666667\n4 4\n0.0 0.25 0.5 0.75\n30 15\n0.00 0.03 0.06 0.09 0.12 0.15 0.18 0.21 0.24 0.27\n0.30 0.33 0.36 0.39 0.42 0.45 0.48 0.51 0.54 0.57\n0.61 0.64 0.66 0.69 0.72 0.75 0.78 0.81 0.84 0.87\n40 20\n0.351 0.353 0.355 0.357 0.359 0.361 0.363 0.365 0.367 0.369\n0.371 0.373 0.375 0.377 0.379 0.381 0.383 0.385 0.387 0.389\n0.611 0.613 0.615 0.617 0.619 0.621 0.623 0.625 0.627 0.629\n0.631 0.633 0.635 0.637 0.639 0.641 0.643 0.645 0.647 0.649\n0 0\n","output":"1.183013\n2.000000\n3.026998\n0.253581\n"},{"problem_id":"p00803","input":"100\n64\n50\n20\n151200\n0\n","output":"99\n64\n47\n20\n151200\n"},{"problem_id":"p00804","input":"3\nPERLIS SELL A 300\nWILKES BUY A 200\nHAMMING SELL A 100\n4\nBACKUS SELL A 10\nFLOYD BUY A 20\nIVERSON SELL B 30\nBACKUS BUY B 40\n7\nWILKINSON SELL A 500\nMCCARTHY BUY C 300\nWILKINSON SELL C 200\nDIJKSTRA SELL B 100\nBACHMAN BUY A 400\nDIJKSTRA BUY A 600\nWILKINSON SELL A 300\n2\nABCD SELL X 10\nABC BUY X 15\n2\nA SELL M 100\nA BUY M 100\n0\n","output":"A 150 150 150\n--\nHAMMING 0 150\nPERLIS 0 0\nWILKES 150 0\n----------\nA 15 15 15\nB 35 35 35\n--\nBACKUS 35 15\nFLOYD 15 0\nIVERSON 0 35\n----------\nA 350 450 550\nC 250 250 250\n--\nBACHMAN 350 0\nDIJKSTRA 550 0\nMCCARTHY 250 0\nWILKINSON 0 1150\n----------\nX 12 12 12\n--\nABC 12 0\nABCD 0 12\n----------\n--\nA 0 0\n----------\n"},{"problem_id":"p00805","input":"2\n0.2000000 0.6000000\n0.3000000 0.8000000\n0.3000000 0.5000000\n0.5000000 0.6000000\n2\n0.3333330 0.6666670\n0.3333330 0.6666670\n0.3333330 0.6666670\n0.3333330 0.6666670\n4\n0.2000000 0.4000000 0.6000000 0.8000000\n0.1000000 0.5000000 0.6000000 0.9000000\n0.2000000 0.4000000 0.6000000 0.8000000\n0.1000000 0.5000000 0.6000000 0.9000000\n2\n0.5138701 0.9476283\n0.1717362 0.1757412\n0.3086521 0.7022313\n0.2264312 0.5345343\n1\n0.4000000\n0.6000000\n0.3000000\n0.5000000\n0\n","output":"0.215657\n0.111112\n0.078923\n0.279223\n0.348958\n"},{"problem_id":"p00806","input":"5\npush\npress\nthe\nbutton\nbottom\n77377843288866\n4\ni\nam\ngoing\ngo\n42646464\n3\na\nb\nc\n333\n0\n","output":"press the button.\n--\ni am going.\ni am go go i.\n--\n--\n"},{"problem_id":"p00807","input":"5\nfaafd\nbcbdb\n-\nbcbdb\nbccac\n-\nfaafd\naafdd\n-\naaafddd\naaaeff\n-\naaedd\naafdd\n-\n","output":"true\ntrue\nfalse\nfalse\nfalse\n"},{"problem_id":"p00808","input":"5\nHakodate 08:15 Morioka 12:30 2500\nMorioka 14:05 Hakodate 17:30 2500\nMorioka 15:30 Hakodate 18:00 3000\nMorioka 14:30 Tokyo 17:50 3000\nTokyo 08:30 Morioka 13:35 3000\n4\nHakodate 08:15 Morioka 12:30 2500\nMorioka 14:04 Hakodate 17:30 2500\nMorioka 14:30 Tokyo 17:50 3000\nTokyo 08:30 Morioka 13:35 3000\n18\nHakodate 09:55 Akita 10:53 3840\nHakodate 14:14 Akita 16:09 1920\nHakodate 18:36 Akita 19:33 3840\nHakodate 08:00 Morioka 08:53 3550\nHakodate 22:40 Morioka 23:34 3550\nAkita 14:23 Tokyo 14:53 2010\nAkita 20:36 Tokyo 21:06 2010\nAkita 08:20 Hakodate 09:18 3840\nAkita 13:56 Hakodate 14:54 3840\nAkita 21:37 Hakodate 22:35 3840\nMorioka 09:51 Tokyo 10:31 2660\nMorioka 14:49 Tokyo 15:29 2660\nMorioka 19:42 Tokyo 20:22 2660\nMorioka 15:11 Hakodate 16:04 3550\nMorioka 23:03 Hakodate 23:56 3550\nTokyo 09:44 Morioka 11:04 1330\nTokyo 21:54 Morioka 22:34 2660\nTokyo 11:34 Akita 12:04 2010\n0\n","output":"11000\n0\n11090\n"},{"problem_id":"p00809","input":"1 101 4 4\n1 100 4 4\n3 97 8 7 6 5 4 3\n0\n","output":"0\n1\n1\n"},{"problem_id":"p00810","input":"4\n10.00000 10.00000 10.00000\n20.00000 10.00000 10.00000\n20.00000 20.00000 10.00000\n10.00000 20.00000 10.00000\n4\n10.00000 10.00000 10.00000\n10.00000 50.00000 50.00000\n50.00000 10.00000 50.00000\n50.00000 50.00000 10.00000\n0\n","output":"7.07107\n34.64102\n"},{"problem_id":"p00811","input":"5 1 2\n99999 999 999\n1680 5 16\n1970 1 1\n2002 4 11\n0 0 0\n","output":"2 2\n313 313\n23 73\n43 43\n37 53\n"},{"problem_id":"p00812","input":"a+b+c\n(a+b)+c\na- (b-c)+2\n.\n4ab\n(a - b) (0-b+a) - 1a ^ 2 - b ^ 2\n2 b 2 a\n.\n108 a\n2 2 3 3 3 a\n4 a^1 27\n.\n.\n","output":"yes\nno\n.\nno\nyes\n.\nyes\nyes\n.\n"},{"problem_id":"p00813","input":"5\n_____*AAA__BBB__CCC__DDD\n*AAA_______0-0__0-0___-_\n_BBB_____________-___0-0\n_CCC_________________0-0\n_DDD____________________\n______CHN__CRC__TUR_*BRA\n_CHN_______0-2___-___0-4\n_CRC____________1-1___-_\n_TUR_________________1-2\n*BRA____________________\n______CMR_*KSA__GER__IRL\n_CMR_______1-0___-___1-1\n*KSA____________0-8___-_\n_GER_________________1-1\n_IRL____________________\n______TUN__JPN_*BEL__RUS\n_TUN________-___1-1__0-2\n_JPN____________2-2__1-0\n*BEL__________________-_\n_RUS____________________\n______MEX__CRO_*ECU__ITA\n_MEX_______1-0__2-1___-_\n_CRO_____________-___2-1\n*ECU_________________0-2\n_ITA____________________\n","output":"0.5000000\n1.0000000\n0.0000000\n0.3852746\n0.0353304\n"},{"problem_id":"p00814","input":"4 4\n   2\n  2 3\n 1 0 4\n1 1 4 0\n4 5\n   2\n  2 3\n 3 0 4\n1 1 4 0\n4 1\n   2\n  2 3\n 3 0 4\n1 1 4 0\n4 1\n   1\n  1 1\n 1 1 1\n1 1 1 0\n4 2\n   1\n  1 1\n 1 1 1\n1 1 1 0\n4 1\n   0\n  2 2\n 5 0 7\n0 5 7 0\n4 2\n   0\n  0 3\n 1 0 4\n0 1 0 4\n4 3\n   0\n  3 3\n 3 2 3\n0 3 0 3\n4 2\n   0\n  3 3\n 3 2 3\n0 3 0 3\n6 1\n     1\n    1 2\n   1 1 0\n  6 7 6 8\n 0 7 6 8 2\n6 6 7 2 2 0\n5 9\n    0\n   0 0\n  0 0 0\n 0 0 0 0\n0 0 0 0 0\n5 3\n    3\n   3 2\n  4 3 2\n 4 4 0 3\n3 3 3 0 3\n0 0\n","output":"6\n5\n1\n-10\n8\n-1\n0\n1\n-1\n5\n0\n5\n"},{"problem_id":"p00815","input":"2\n3 3 3 3 -3 3 2 -5 3 2 -5 -3 0\n3 5 4 -2 4 -3 -2 -2 -1 0\n","output":"1 2 4 6\n2 1 3 8\n3 2 4 7\n4 1 3 5\n5 4 6 7\n6 1 5\n7 3 5 8\n8 2 7\n1 2 3 4\n2 1 3 3 4 4\n3 1 2 2 4\n4 1 2 2 3\n"},{"problem_id":"p00816","input":"50 12346\n376 144139\n927438 927438\n18 3312\n9 3142\n25 1299\n111 33333\n103 862150\n6 1104\n0 0\n","output":"43 1 2 34 6\n283 144 139\n927438 927438\n18 3 3 12\nerror\n21 1 2 9 9\nrejected\n103 86 2 15 0\nrejected\n"},{"problem_id":"p00817","input":"2 1 1\n1 2 no\n2 1 no\n3 2 1\n1 1 yes\n2 2 yes\n3 3 yes\n2 2 1\n1 2 yes\n2 3 no\n5 4 3\n1 2 yes\n1 3 no\n4 5 yes\n5 6 yes\n6 7 no\n0 0 0\n","output":"no\nno\n1\n2\nend\n3\n4\n5\n6\nend\n"},{"problem_id":"p00818","input":"3\n0 0 0.5\n-0.9 0 1.00000000001\n0.9 0 1.00000000001\n5\n0 1 0.5\n1 1 1.00000000001\n0 2 1.00000000001\n-1 1 1.00000000001\n0 -0.00001 1.00000000001\n5\n0 1 0.5\n1 1 1.00000000001\n0 2 1.00000000001\n-1 1 1.00000000001\n0 0 1.00000000001\n2\n0 0 1.0000001\n0 0 1\n2\n0 0 1\n0.00000001 0 1\n0\n","output":"3\n5\n4\n2\n2\n"},{"problem_id":"p00819","input":"5\nAJMP\naB23d\nE\n86AE\nAM\n6\nJPEM\nWaEaETC302Q\nCP\nrTurnAGundam1isdefferentf\n","output":"32Bad\nAE86\n7\nEC302QTWaEa\nTurnAGundam0isdefferentfr\n"},{"problem_id":"p00820","input":"1\n25\n2003\n211\n20007\n0\n","output":"1\n3\n48\n7\n738\n"},{"problem_id":"p00821","input":"4\n5 -3\n1 0\n1 7\n-7 -1\n3\n5 5\n18 5\n5 10\n3\n-5 -5\n-5 -10\n-18 -10\n5\n0 0\n20 2\n11 1\n21 2\n2 0\n0\n","output":"55\n41\n41\n23\n"},{"problem_id":"p00822","input":"1\n0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n1 0 0 0 0 0 1 0 0 0 0 1 1 0 0 1\n0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1\n0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0\n0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1\n0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0\n7\n0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\n0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0\n0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0\n0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0\n0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1\n0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0\n15\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0\n0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0\n1 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0\n0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0\n0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0\n1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0\n0\n","output":"0\n1\n0\n1\n"},{"problem_id":"p00823","input":"H 1\nHe 4\nC 12\nO 16\nF 19\nNe 20\nCu 64\nCc 333\nEND_OF_FIRST_PART\nH2C\n(MgF)2As\nCu(OH)2\nH((CO)2F)99\n0\n","output":"14\nUNKNOWN\n98\n7426\n"},{"problem_id":"p00824","input":"4\n\n12 13 14 15 16 17 21\n22 23 24 25 26 27 31\n32 33 34 35 36 37 41\n42 43 44 45 46 47 11\n\n26 31 13 44 21 24 42\n17 45 23 25 41 36 11\n46 34 14 12 37 32 47\n16 43 27 35 22 33 15\n\n17 12 16 13 15 14 11\n27 22 26 23 25 24 21\n37 32 36 33 35 34 31\n47 42 46 43 45 44 41\n\n27 14 22 35 32 46 33\n13 17 36 24 44 21 15\n43 16 45 47 23 11 26\n25 37 41 34 42 12 31\n","output":"0\n33\n60\n-1\n"},{"problem_id":"p00825","input":"4\n1 2 10\n2 3 10\n3 3 10\n1 3 10\n6\n1 20 1000\n3 25 10000\n5 15 5000\n22 300 5500\n10 295 9000\n7 7 6000\n8\n32 251 2261\n123 281 1339\n211 235 5641\n162 217 7273\n22 139 7851\n194 198 9190\n119 274 878\n122 173 8640\n0\n","output":"30\n25500\n38595\n"},{"problem_id":"p00826","input":"8\n-7 9 6 9\n-5 5 6 5\n-10 -5 10 -5\n-6 9 -9 -6\n6 9 9 -6\n-1 -2 -3 10\n1 -2 3 10\n-2 -3 2 -3\n8\n-7 9 5 7\n-5 5 6 5\n-10 -5 10 -5\n-6 9 -9 -6\n6 9 9 -6\n-1 -2 -3 10\n1 -2 3 10\n-2 -3 2 -3\n0\n","output":"yes\nno\n"},{"problem_id":"p00827","input":"700 300 200\n500 200 300\n500 200 500\n275 110 330\n275 110 385\n648 375 4002\n3 1 10000\n0 0 0\n","output":"1 3\n1 1\n1 0\n0 3\n1 1\n49 74\n3333 1\n"},{"problem_id":"p00828","input":"3 3 3\n1 1\n1 1\n1 1\n3 3 7\n2 2\n1 3\n1 1\n2 3\n2 1\n3 3\n3 1\n4 3 15\n1 1\n2 2\n1 1\n3 3\n3 3\n1 1\n3 3\n3 3\n4 4\n1 1\n4 4\n4 4\n4 4\n4 1\n2 2\n0 0 0\n","output":"Draw\nWhite 6\nBlack 15\n"},{"problem_id":"p00829","input":"8\n1 1 1 1 1 1 1 1 8\n3 2 3 2 3 2 3 2 6\n3 4 4 7 7 b a 2 2e\ne1 13 ce 28 ca 6 ab 46 a6d\nb08 49e2 6128 f27 8cf2 bc50 7380 7fe1 723b\n4eba eb4 a352 fd14 6ac1 eed1 dd06 bb83 392bc\nef593c08 847e522f 74c02b9c 26f3a4e1 e2720a01 6fe66007\n7a4e96ad 6ee5cef6 3853cd88\n60202fb8 757d6d66 9c3a9525 fbcd7983 82b9571c ddc54bab 853e52da\n22047c88 e5524401\n","output":"0\n2\n6\n1c6\n4924afc7\nffff95c5\n546991d\n901c4a16\n"},{"problem_id":"p00830","input":"5 6\n\/home\/ACM\/index.html\n\/ICPC\/index.html\n\/ICPC\/general.html\n\/ICPC\/japanese\/index.html\n\/ICPC\/secret\/confidential\/2005\/index.html\n\/home\/ACM\/\n\/home\/ICPC\/..\/ACM\/\n\/ICPC\/secret\/\n\/ICPC\/secret\/index.html\n\/ICPC\n\/ICPC\/..\/ICPC\/index.html\n\/ICPC\n\/ICPC\/general.html\n\/ICPC\/japanese\/..\/.\/\n\/ICPC\/japanese\/.\/..\/\n\/home\/ACM\/index.html\n\/home\/ACM\/index.html\/\n1 4\n\/index.html\/index.html\n\/\n\/index.html\/index.html\n\/index.html\n\/index.html\/index.html\n\/..\n\/index.html\/..\/..\n\/index.html\/\n\/index.html\/index.html\/..\n0 0\n","output":"not found\nnot found\nyes\nno\nyes\nnot found\nnot found\nyes\nnot found\nnot found\n"},{"problem_id":"p00831","input":"8\n2\nomura\ntoshio\nraku\ntanaka\nimura\nyoshoi\nhayashi\nmiura\n3\n1\ntasaka\nnakata\ntanaka\n1\n1\nfoo\n5\n2\npsqt\nabcdef\nabzdefa\npqrst\nabdxcef\n0\n","output":"imura,miura\nimura,omura\nmiura,omura\ntoshio,yoshoi\n4\ntanaka,tasaka\n1\n0\nabcdef,abdxcef\nabcdef,abzdefa\npqrst,psqt\n3\n"},{"problem_id":"p00832","input":"4\n1 1 1\n1 1 1\n1 1 1\n2 2 2\n2 2 2\n2 2 2\n4 3 3\n5 2 2\n4 3 3\n6 1 1\n6 1 1\n6 1 0\n1 0 0\n0 2 0\n0 0 0\n5 1 2\n5 1 2\n0 0 0\n2 0 0\n0 3 0\n0 0 0\n0 0 0\n0 0 0\n3 0 1\n","output":"27\n24\n32 33 36\n0\n"},{"problem_id":"p00833","input":"6\nBlizid\n0 0\n60 0\n60 60\n0 60\n0 50\n50 50\n50 10\n0 10\n-1\nBlizid\n0 10\n10 10\n10 50\n0 50\n-1\nWindom\n10 10\n50 10\n40 20\n20 20\n20 40\n10 50\n-1\nAccent\n50 10\n50 50\n35 50\n35 25\n-1\nPilot\n35 25\n35 50\n10 50\n-1\nBlizid\n20 20\n40 20\n20 40\n-1\n4\nA1234567890123456789\n0 0\n0 100\n100 100\n100 0\n-1\nB1234567890123456789\n100 100\n100 200\n200 200\n200 100\n-1\nC1234567890123456789\n0 100\n100 100\n100 200\n0 200\n-1\nD123456789012345678\n100 0\n100 100\n200 100\n200 0\n-1\n0\n","output":"4\n2\n"},{"problem_id":"p00834","input":"3\n95 20 180 18\n125 20 185 18\n40 27 195 10\n1\n5 5 5 4\n2\n5 5 5 4\n5 5 5 3\n2\n5 5 5 4\n5 7 5 3\n16\n2338 3465 29034 710\n1571 14389 25019 842\n1706 8015 11324 1155\n1899 4359 33815 888\n2160 10364 20511 1264\n2048 8835 23706 1906\n2598 13041 23679 618\n1613 11112 8003 1125\n1777 4754 25986 929\n2707 9945 11458 617\n1153 10358 4305 755\n2462 8450 21838 934\n1822 11539 10025 1639\n1473 11939 12924 638\n1388 8519 18653 834\n2239 7384 32729 862\n0\n","output":"8\n11011000\n2\n10\n2\n10\n2\n10\n28\n1011100100110101101000101100\n"},{"problem_id":"p00835","input":"4\n5 0\n0 10\n7 5\n10 5\n4\n7 5\n10 5\n5 0\n0 10\n4\n0 10\n10 10\n10 0\n0 0\n3\n0 0\n0 10\n10 0\n4\n0 10\n10 5\n0 0\n9 5\n4\n5 0\n0 10\n5 5\n10 10\n4\n0 5\n5 10\n10 5\n5 0\n4\n7 1\n4 1\n0 1\n9 5\n0\n","output":"194.8255\n194.8255\n600.0000\n341.4214\n42.9519\n182.5141\n282.8427\n149.2470\n"},{"problem_id":"p00836","input":"2\n3\n17\n41\n20\n666\n12\n53\n0\n","output":"1\n1\n2\n3\n0\n0\n1\n2\n"},{"problem_id":"p00837","input":"2 1 1\n1\n50\n2 1 2\n1\n50\n1\n60\n2 1 2\n2\n60 61\n1\n70\n4 2 3\n3\n60 61 62\n1\n70\n2\n80 81\n3 1 2\n3\n60 61 62\n2\n70 60\n1 2 5\n2\n87 95\n3\n96 71 35\n2\n68 2\n3\n3 18 93\n2\n57 2\n2 2 1\n5\n1 2 1 3 1\n0 0 0\n","output":"4\n16\n28\n68\n58\n98\n23\n"},{"problem_id":"p00838","input":"3\nscarlet green blue yellow magenta cyan\nblue pink green magenta cyan lemon\npurple red blue yellow cyan green\n2\nred green blue yellow magenta cyan\ncyan green blue yellow magenta red\n2\nred green gray gray magenta cyan\ncyan green gray gray magenta red\n2\nred green blue yellow magenta cyan\nmagenta red blue yellow cyan green\n3\nred green blue yellow magenta cyan\ncyan green blue yellow magenta red\nmagenta red blue yellow cyan green\n3\nblue green green green green blue\ngreen blue blue green green green\ngreen green green green green sea-green\n3\nred yellow red yellow red yellow\nred red yellow yellow red yellow\nred red red red red red\n4\nviolet violet salmon salmon salmon salmon\nviolet salmon salmon salmon salmon violet\nviolet violet salmon salmon violet violet\nviolet violet violet violet salmon salmon\n1\nred green blue yellow magenta cyan\n4\nmagenta pink red scarlet vermilion wine-red\naquamarine blue cyan indigo sky-blue turquoise-blue\nblond cream chrome-yellow lemon olive yellow\nchrome-green emerald-green green olive vilidian sky-blue\n0\n","output":"4\n2\n0\n0\n2\n3\n4\n4\n0\n16\n"},{"problem_id":"p00839","input":"3 5\n0W 1W\n0W 2W\n0W 2E\n0E 1E\n1E 2E\naabbccdee\n-\n-\n-\n-\nbbaadeecc\n3 3\n0E 1W\n1E 2W\n2E 0W\naabb\nbbcc\naa\nbbbb\ncc\naaaa\n3 4\n0E 1W\n0E 2E\n1E 2W\n2E 0W\nababab\n-\n-\naaabbb\n-\n-\n0 0\n","output":"4\n2\n5\n"},{"problem_id":"p00840","input":"5\n1.3\n3\n1\n2\n1\n1.4\n3\n1\n2\n1\n2.0\n3\n1\n2\n1\n1.59\n4\n2\n1\n1\n3\n1.7143\n4\n1\n2\n3\n5\n","output":"-1\n1.3333333333333335\n1.6666666666666667\n1.5833333333333335\n1.7142857142857142\n"},{"problem_id":"p00841","input":"2\n2 3\n1.0\n1 1.0 0.1 0.3\n5\n5 10 15 20 25\n0.15\n1 1.0 0.04 0.5\n10\n1783 3640 3991 4623 5465 5481 6369 6533 6865 8425\n4.172\n72 59.4705 0.0052834 0.0611224\n0\n","output":"3.5397\n31.9249\n168.6682\n"},{"problem_id":"p00842","input":"4\n   0  2  2  2\n   2  0  2  2\n   2  2  0  2\n   2  2  2  0\n4\n   0  2  4  4\n   2  0  4  4\n   4  4  0  2\n   4  4  2  0\n2\n   0 12\n  12  0\n0\n","output":"4\n2 3 3\n2 2 2 2 2 2 2 2 2 2 2\n"},{"problem_id":"p00843","input":"4 3\n10 25 11 20 6 2 1 15 23\n5 21 3 12 23 17 7 26 2\n8 18 4 22 13 27 16 5 11\n19 9 24 2 11 5 14 28 16\n4 3\n12 13 20 24 28 32 15 16 17\n12 13 21 25 29 33 16 17 18\n12 13 22 26 30 34 17 18 15\n12 13 23 27 31 35 18 15 16\n4 3\n11 12 13 14 15 16 17 18 19\n21 22 23 24 25 26 27 28 29\n31 32 33 34 35 36 37 38 39\n41 42 43 44 45 46 47 48 49\n4 4\n2 6 9 21 15 23 17 31 33 12 25 4 8 24 13 36\n22 18 27 26 35 28 3 7 11 20 38 16 5 32 14 29\n26 7 16 29 27 3 38 14 18 28 20 32 22 35 11 5\n36 13 24 8 4 25 12 33 31 17 23 15 21 9 6 2\n0 0\n","output":"5\n4\n12\n0\n"},{"problem_id":"p00844","input":"10.5235\n3\n0 0\n100 100\n0 100\n4\n0 50\n20 50\n20 80\n0 80\n10.0\n4\n120 45\n140 35\n140 65\n120 55\n8\n0 0\n100 0\n100 100\n0 100\n0 55\n80 90\n80 10\n0 45\n10.0\n3\n0 0\n1 0\n0 1\n3\n0 100\n1 101\n0 101\n10.0\n3\n0 0\n1 0\n0 100\n3\n0 50\n100 50\n0 51\n0\n","output":"114.882476\n100\n1\n110.5005\n"},{"problem_id":"p00845","input":"3\n100 0 500\n-500.243 -200.1 -300.5\n0 300 200\n2\n1 1 1 0.65\n-1 0 0 1.57\n3\n1 0 0\n0 1 0\n0 0 1\n4\n1 -1 -1 0.9553\n-1 1 -1 0.9554\n-1 -1 1 0.9553\n-1 1 -1 0.9554\n3\n1 0 0\n0 1 0\n0 0 1\n4\n1 -1 -1 0.9553\n-1 1 -1 0.9553\n-1 -1 1 0.9553\n-1 1 -1 0.9553\n0\n","output":"2\n1\n0\n"},{"problem_id":"p00846","input":"6\n66 13\n96 61\n76 98\n13 94\n4 0\n45 68\n8\n27 21\n55 14\n93 12\n56 95\n15 48\n38 46\n51 65\n64 31\n0\n","output":"1\n0\n"},{"problem_id":"p00847","input":"1 2\nW W W\nE W W\nW W W\n2 1\nR B W\nR W W\nE W W\n3 3\nW B W\nB R E\nR B R\n3 3\nB W R\nB W R\nB E R\n2 1\nB B B\nB R B\nB R E\n1 1\nR R R\nW W W\nR R E\n2 1\nR R R\nB W B\nR R E\n3 2\nR R R\nW E W\nR R R\n0 0\n","output":"0\n3\n13\n23\n29\n30\n-1\n-1\n"},{"problem_id":"p00848","input":"24 3\n24 2\n2 1\n1 1\n4 2\n18 3\n17 1\n17 3\n17 4\n100 5\n1000 10\n1120 14\n0 0\n","output":"2\n3\n1\n0\n0\n2\n1\n0\n1\n55\n200102899\n2079324314\n"},{"problem_id":"p00849","input":"5 5\n0 0 0 0 0\n0 0 0 3 0\n2 0 2 0 0\n1 0 1 1 1\n0 0 0 0 3\n2 3\n2 2 0\n0 3 3\n6 5\n2 0 0 0 0\n0 3 0 0 0\n0 0 0 0 0\n1 1 1 0 0\n0 0 0 0 0\n0 0 2 3 0\n5 9\n0 0 0 0 0 0 0 0 0\n0 0 0 0 3 0 0 0 0\n0 2 0 0 0 0 0 2 0\n0 0 0 0 3 0 0 0 0\n0 0 0 0 0 0 0 0 0\n9 9\n3 0 0 0 0 0 0 0 2\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n2 0 0 0 0 0 0 0 3\n9 9\n0 0 0 1 0 0 0 0 0\n0 2 0 1 0 0 0 0 3\n0 0 0 1 0 0 0 0 2\n0 0 0 1 0 0 0 0 3\n0 0 0 1 1 1 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n9 9\n0 0 0 0 0 0 0 0 0\n0 3 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 2 3 2\n0 0\n","output":"18\n2\n17\n12\n0\n52\n43\n"},{"problem_id":"p00850","input":"1\n31\n70\n91\n473\n512\n811\n953\n0\n","output":"0\n6\n8\n9\n11\n9\n13\n12\n"},{"problem_id":"p00851","input":"3\n3 4 5\n5\n1 2 5 5 5\n6\n195 221 255 260 265 290\n6\n130 145 169 185 195 265\n3\n1 1 2\n6\n3 3 3 3 3 3\n0\n","output":"6\n19\n158253\n-1\n-1\n18\n"},{"problem_id":"p00852","input":"4 3\nA=a\nA=\nS=ASb\nS=Ab\n2 5\nS=aSb\nS=\n1 5\nS=S\n1 0\nS=S\n1 0\nA=\n2 0\nA=\nS=AA\n4 5\nA=aB\nA=b\nB=SA\nS=A\n4 20\nS=AAAAAAAAAA\nA=aA\nA=bA\nA=\n0 0\n","output":"abb\n-\n-\n-\n-\n\naabbb\naaaaaaaaaaaaaaaaaaaa\n"},{"problem_id":"p00853","input":"5 20 10 1 5\n1 2 1\n1 3 2\n1 4 1\n1 5 3\n2 1 1\n2 3 1\n2 4 2\n2 5 2\n3 1 1\n3 2 2\n3 4 1\n3 5 1\n4 1 1\n4 2 1\n4 3 1\n4 5 2\n5 1 1\n5 2 1\n5 3 1\n5 4 1\n4 6 1 1 4\n2 4 2\n1 3 2\n1 2 1\n1 4 3\n2 3 1\n3 4 1\n3 3 5 1 3\n1 2 1\n2 3 1\n1 3 1\n0 0 0 0 0\n","output":"1-2-4-3-5\n1-2-3-4\nNone\n"},{"problem_id":"p00854","input":"8 5 3\n100 9999 98\n10000 10000 10000\n0 0 0\n","output":"1\n93\n2019\n"},{"problem_id":"p00855","input":"10\n11\n27\n2\n492170\n0\n","output":"4\n0\n6\n0\n114\n"},{"problem_id":"p00856","input":"6 1 0 0\n7 1 0 0\n7 2 0 0\n6 6 1 1\n2\n5\n7 10 0 6\n1\n2\n3\n4\n5\n6\n0 0 0 0\n","output":"0.166667\n0.000000\n0.166667\n0.619642\n0.000000\n"},{"problem_id":"p00857","input":"0 0 1 0 0 1\n0 0 5 0 2 5\n-100 -100 100 -100 0 100\n-72 -72 72 -72 0 72\n0 0 0 0 0 0\n","output":"2\n1.49666\n-1\n8.52936\n"},{"problem_id":"p00858","input":"8\n1 1\n4 4\n1 1 4 1\n1 1 1 4\n3 1 3 4\n4 3 5 3\n2 4 3 5\n4 1 4 4\n3 3 2 2\n1 4 4 4\n9\n1 5\n5 1\n5 4 5 1\n1 5 1 1\n1 5 5 1\n2 3 2 4\n5 4 1 5\n3 2 2 1\n4 2 4 1\n1 1 5 1\n5 3 4 3\n11\n5 5\n1 0\n3 1 5 1\n4 3 4 2\n3 1 5 5\n2 3 2 2\n1 0 1 2\n1 2 3 4\n3 4 5 5\n1 0 5 2\n4 0 4 1\n5 5 5 1\n2 3 2 4\n0\n","output":"1 1\n3 1\n3 4\n4 4\n0\n-1\n5 5\n5 2\n3 1\n1 0\n0\n"},{"problem_id":"p00859","input":"4 5\n1 2 3\n1 3 5\n1 4 6\n2 4 6\n3 4 7\n4 6\n1 2 10\n1 3 100\n1 4 90\n2 3 20\n2 4 80\n3 4 40\n2 1\n1 2 1\n3 0\n3 1\n1 2 1\n3 3\n1 2 2\n2 3 5\n1 3 6\n5 10\n1 2 110\n1 3 120\n1 4 130\n1 5 120\n2 3 110\n2 4 120\n2 5 130\n3 4 120\n3 5 110\n4 5 120\n5 10\n1 2 9384\n1 3 887\n1 4 2778\n1 5 6916\n2 3 7794\n2 4 8336\n2 5 5387\n3 4 493\n3 5 6650\n4 5 1422\n5 8\n1 2 1\n2 3 100\n3 4 100\n4 5 100\n1 5 50\n2 5 50\n3 5 50\n4 1 150\n0 0\n","output":"1\n20\n0\n-1\n-1\n1\n0\n1686\n50\n"},{"problem_id":"p00860","input":"5 5 2\n#####\n#A#B#\n#   #\n#b#a#\n#####\n16 4 3\n################\n## ########## ##\n#    ABCcba    #\n################\n16 16 3\n################\n### ##    #   ##\n##  #  ##   # c#\n#  ## ########b#\n# ##  # #   #  #\n#  # ##   # # ##\n##  a#  # # #  #\n### ## #### ## #\n##   #   #  #  #\n#  ##### # ## ##\n####   #B# #   #\n##  C#   #   ###\n#  # # ####### #\n# ######  A##  #\n#        #    ##\n################\n0 0 0\n","output":"7\n36\n77\n"},{"problem_id":"p00861","input":"a[3]\na[0]=a[1]\n.\nx[1]\nx[0]=x[0]\n.\na[0]\na[0]=1\n.\nb[2]\nb[0]=2\nb[1]=b[b[0]]\nb[0]=b[1]\n.\ng[2]\nG[10]\ng[0]=0\ng[1]=G[0]\n.\na[2147483647]\na[0]=1\nB[2]\nB[a[0]]=2\na[B[a[0]]]=3\na[2147483646]=a[2]\n.\n.\n","output":"2\n2\n2\n3\n4\n0\n"},{"problem_id":"p00862","input":"4\n0 0\n10000 0\n10000 10000\n0 10000\n3\n0 0\n10000 0\n7000 1000\n6\n0 40\n100 20\n250 40\n250 70\n100 90\n0 70\n3\n0 0\n10000 10000\n5000 5001\n0\n","output":"5000.000000\n494.233641\n34.542948\n0.353553\n"},{"problem_id":"p00863","input":"3 2 2 2\n3 2 2 3\n2 2 3 4\n31 4 2 3\n3 2 2 7\n0 0 0 0\n","output":"1 0 -10 0 1\n1 0 -9 -4 27 -36 -23\n1 0 -8 0 18 0 -104 0 1\n1 0 0 -8 -93 0 24 -2976 2883 -32 -3720 -23064 -29775\n1 0 -21 0 189 0 -945 -4 2835 -252 -5103 -1260 5103 -756 -2183\n"},{"problem_id":"p00864","input":"3 50\n100\n0\n100\n3 50\n100\n100\n50\n10 10\n1\n2\n3\n4\n5\n16\n17\n18\n29\n30\n0 0\n","output":"0.51\n0.26\n1.4766666666666667\n"},{"problem_id":"p00865","input":"2 6 0\n2 6 3\n3 10 9\n13 3 27\n1 2008 3\n0 0 0\n","output":"7.00000000\n4.11111111\n7.71000000\n1.42902599\n1001.50298805\n"},{"problem_id":"p00866","input":"3\n8 8 18\n32 32 32\n57 2 57\n5\n49 3 49\n7 30 44\n27 21 21\n33 56 56\n21 46 4\n3\n45 52 28\n36 26 36\n20 55 50\n10\n33 8 39\n50 57 43\n35 21 12\n21 17 11\n16 21 58\n45 40 53\n45 30 53\n39 1 8\n55 48 30\n7 48 15\n0\n","output":"00:00:00 00:00:10\n06:14:56 06:32:09\n07:27:37 07:32:02\n05:17:40 05:21:03\n"},{"problem_id":"p00867","input":"9\n60 140 200 300\n300 105 330 135\n330 135 250 215\n240 205 250 215\n298 167 285 154\n30 40 30 90\n30 90 150 90\n150 90 150 20\n30 40 150 40\n8\n320 20 300 60\n320 20 380 50\n380 50 240 330\n10 50 40 20\n10 50 110 150\n110 150 180 80\n40 20 37 17\n37 17 27 27\n20\n72 222 132 182\n204 154 204 54\n510 410 520 370\n404 54 204 54\n530 450 410 450\n204 68 404 68\n80 110 120 30\n130 160 180 60\n520 370 320 320\n310 360 320 320\n120 30 180 60\n60 100 80 110\n404 154 204 154\n80 60 60 100\n430 550 590 550\n510 410 310 360\n430 450 430 550\n404 54 404 154\n232 202 142 262\n142 262 102 202\n0\n","output":"0 1 0 1 0 0 0 0 0 1\n0 0 0 0 0 1 0 1 0 0\n1 0 1 0 2 0 0 0 1 0\n"},{"problem_id":"p00868","input":"3\n-20 -20 -24\n100 100 100 30\n10 8 3 5\n-70 -70 -84 5\n4\n0 47 84\n-23 41 42 8\n45 -10 14 19\n-5 28 47 12\n-27 68 34 14\n0\n","output":"79.0940 79.0940 94.9128\n-21.8647 54.9770 34.1761\n"},{"problem_id":"p00869","input":"10 5\nkkkkkwwwww\nw#wwwrwwww\nwwwwbgwwww\nkwwmcwwwkk\nkkwywwwkkk\nrgbcmy\n10 5\nkkkkkkkkkk\nk#kkkkkkkk\nkwkkkkkwwk\nkcmyrgbwwk\nkwwwwwwwwk\ncmyrgb\n10 5\nkkkkkkkkkk\nk#kkkkkkkk\nkwkkkkkwkk\nkcmyrgbwwk\nkwwwwwwwwk\ncmyrgb\n0 0\n","output":"9\n49\nunreachable\n"},{"problem_id":"p00870","input":"3 1\naa\nb\nccc\naabccczbaacccbaazaabbcccaa\n3 1\na\nb\nc\ncbbcbcbabaacabccaccbaacbccbcaaaccccbcbcbbcacbaacccaccbbcaacbbabbabaccc\n3 4\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n0 0\n","output":"5\n12\n197\n"},{"problem_id":"p00871","input":"start 0 0\narc 2 2 -2\nline 2 5\narc 0 3 -2\nclose\nstart -1 1\nline 2 1\nline 2 2\nline -2 2\narc -3 1 -1\nline -3 -2\narc -2 -3 -1\nline 2 -3\nline 2 -2\nline -1 -2\nline -1 -1\narc -1 0 2\nclose\nstart 0 0\nline 3 0\nline 5 -1\narc 4 -2 -1\nline 6 -2\nline 6 1\nline 7 3\narc 8 2 -1\nline 8 4\nline 5 4\nline 3 5\narc 4 6 -1\nline 2 6\nline 2 3\nline 1 1\narc 0 2 -1\nclose\nend\n","output":"1.00000 2.50000 +\n-1.01522 -0.50000 -\n4.00000 2.00000 +\n"},{"problem_id":"p00872","input":"-(x^3-3x^2+3x-1)\n(x-1)^2\nx^2+10x+25\nx^2+6x+5\nx^3+1\nx-1\n.\n","output":"x^2-2x+1\nx+5\n1\n"},{"problem_id":"p00873","input":"2\n0 0\n10 9\n4\n0 0\n3 1\n0 3\n3 3\n10\n2 2\n4 2\n6 2\n2 4\n4 4\n6 4\n2 6\n4 6\n6 6\n3 3\n10\n0 0\n2 0\n4 0\n0 2\n2 2\n4 2\n0 4\n2 4\n4 4\n6 8\n9\n0 0\n1 0\n3 0\n0 1\n1 1\n3 1\n0 2\n1 2\n2 2\n10\n0 0\n1 0\n0 1\n1 1\n9 9\n9 10\n10 9\n10 10\n0 2\n10 8\n10\n0 0\n0 10\n2 0\n2 1\n2 7\n2 10\n5 1\n6 7\n9 2\n10 9\n0\n","output":"0 13.45362405\n1 18.48683298\n3 24.14213562\n4 24.94813673\n3 12.24264069\n3 60.78289622\n3 502.7804353\n"},{"problem_id":"p00874","input":"5 5\n1 2 3 4 5\n1 2 3 4 5\n5 5\n2 5 4 1 3\n4 1 5 3 2\n5 5\n1 2 3 4 5\n3 3 3 4 5\n3 3\n7 7 7\n7 7 7\n3 3\n4 4 4\n4 3 4\n4 3\n4 2 2 4\n4 2 1\n4 4\n2 8 8 8\n2 3 8 3\n10 10\n9 9 9 9 9 9 9 9 9 9\n9 9 9 9 9 9 9 9 9 9\n10 9\n20 1 20 20 20 20 20 18 20 20\n20 20 20 20 7 20 20 20 20\n0 0\n","output":"15\n15\n21\n21\n15\n13\n32\n90\n186\n"},{"problem_id":"p00875","input":"2\na bb\nb aa\na\nbbbbbbbb\n1\na aa\na\naaaaa\n3\nab aab\nabc aadc\nad dee\nabc\ndeeeeeeeec\n10\na abc\nb bai\nc acf\nd bed\ne abh\nf fag\ng abe\nh bag\ni aaj\nj bbb\na\nabacfaabe\n0\n","output":"3\n-1\n7\n4\n"},{"problem_id":"p00876","input":"2\n10 30\n15 20\n2\n10 240\n15 160\n3\n2 6\n7 2\n8 2\n4\n2 4\n7 2\n8 2\n18 1\n0\n","output":"600\n4800\n36\n40\n"},{"problem_id":"p00877","input":"3 3\n100 700\n200 200\n600 600\n500 100\n500 300\n800 500\n3 3\n100 300\n400 600\n400 100\n600 400\n500 900\n300 300\n3 4\n300 300\n500 300\n400 600\n100 100\n200 900\n500 900\n800 100\n1 2\n300 300\n100 100\n500 500\n1 1\n100 100\n200 100\n2 2\n0 0\n500 700\n1000 1400\n1500 2100\n2 2\n0 0\n1000 1000\n1000 0\n0 1000\n3 3\n0 100\n4999 102\n10000 103\n5001 102\n10000 102\n0 101\n3 3\n100 100\n200 100\n100 200\n0 0\n400 0\n0 400\n3 3\n2813 1640\n2583 2892\n2967 1916\n541 3562\n9298 3686\n7443 7921\n0 0\n","output":"YES\nNO\nNO\nNO\nYES\nYES\nNO\nNO\nNO\nYES\n"},{"problem_id":"p00878","input":"2\n90 90 80 20\n80 20 75 50\n50 35\n2\n90 90 80 20\n75 50 80 20\n55 20\n3\n5 90 15 70\n95 90 85 75\n20 67 20 73\n20 75\n3\n5 90 15 70\n5 10 15 55\n20 67 20 73\n75 80\n8\n1 48 1 50\n10 73 10 75\n31 87 31 89\n91 94 91 96\n63 97 62 96\n63 80 61 82\n39 97 41 95\n62 89 62 90\n41 93\n5\n2 1 1 1\n-95 1 -96 1\n-190 1 -191 1\n-283 1 -284 1\n-373 1 -374 1\n-450 1\n2\n77 17 89 8\n103 13 85 10\n53 36\n0\n","output":"3\n4\n3\n2\n32\n1\n0\n"},{"problem_id":"p00879","input":"N2+H2->NH3.\nNa+Cl2->NaCl.\nCa(OH)2+CO2->CaCO3+H2O.\nCaCl2+AgNO3->Ca(NO3)2+AgCl.\nC2H5OH+O2->CO2+H2O.\nC4H10+O2->CO2+H2O.\nA12B23+C34D45+ABCD->A6D7+B8C9.\nA98B+B98C+C98->A98B99C99.\nA2+B3+C5+D7+E11+F13->ABCDEF.\n.\n","output":"1 3 2\n2 1 2\n1 1 1 1\n1 2 1 2\n1 3 2 3\n2 13 8 10\n2 123 33042 5511 4136\n1 1 1 1\n15015 10010 6006 4290 2730 2310 30030\n"},{"problem_id":"p00880","input":"20 80 -40 -20 120 -20\n20 -20 120 -20 -40 80\n0 0 1 0 0 1\n0 0 999 1 -999 1\n897 -916 847 -972 890 -925\n999 999 -999 -998 -998 -999\n-999 -999 999 -999 0 731\n-999 -999 999 -464 -464 999\n979 -436 -955 -337 157 -439\n0 0 0 0 0 0\n","output":"21.565935 24.409005 27.107493\n9.942044 19.150565 19.913790\n0.148847 0.207107 0.207107\n0.125125 0.499750 0.499750\n0.373458 0.383897 0.100456\n0.706768 0.353509 0.353509\n365.638023 365.638023 365.601038\n378.524085 378.605339 378.605339\n21.895803 22.052921 5.895714\n"},{"problem_id":"p00881","input":"8 1\n11010101\n11 4\n00111001100\n01001101011\n01010000011\n01100110001\n11 16\n01000101111\n01011000000\n01011111001\n01101101001\n01110010111\n01110100111\n10000001010\n10010001000\n10010110100\n10100010100\n10101010110\n10110100010\n11001010011\n11011001001\n11111000111\n11111011101\n11 12\n10000000000\n01000000000\n00100000000\n00010000000\n00001000000\n00000100000\n00000010000\n00000001000\n00000000100\n00000000010\n00000000001\n00000000000\n9 32\n001000000\n000100000\n000010000\n000001000\n000000100\n000000010\n000000001\n000000000\n011000000\n010100000\n010010000\n010001000\n010000100\n010000010\n010000001\n010000000\n101000000\n100100000\n100010000\n100001000\n100000100\n100000010\n100000001\n100000000\n111000000\n110100000\n110010000\n110001000\n110000100\n110000010\n110000001\n110000000\n0 0\n","output":"0\n2\n4\n11\n9\n"},{"problem_id":"p00882","input":"5 2\nC L S R C\nC C S C C\n6 4\nC C C C C C\nS L R R C S\nS S S L C S\nC C C C C C\n6 6\nC L S S S C\nC C C S S C\nC C C S S C\nC L C S S C\nC C L S S C\nC S L S S C\n6 6\nC S S S S C\nS C S L C S\nS C S R C S\nS C L S C S\nS C R S C S\nC S S S S C\n4 4\nS C C S\nS C L S\nS L C S\nC C C C\n6 4\nC R S S L C\nC R L R L C\nC S C C S C\nC S S S S C\n0 0\n","output":"24\n20\n148\n14\n0\n178\n"},{"problem_id":"p00883","input":"3\n...\n.@.\n...\n3\n.##\n.#.\n@##\n3\n##.\n#..\n@..\n5\n....@\n##...\n#....\n...#.\n##.##\n5\n#...#\n...#.\n#....\n...##\n..@..\n5\n#....\n.....\n.....\n.....\n..@..\n5\n#..#.\n#.#.#\n.#.#.\n....#\n.#@##\n5\n..##.\n..#..\n#....\n#....\n.#@..\n0\n","output":"0\n10\n-1\n3\n2\n1\n6\n4\n"},{"problem_id":"p00884","input":"2\ndevelopment:alice,bob,design,eve.\ndesign:carol,alice.\n3\none:another.\nanother:yetanother.\nyetanother:dave.\n3\nfriends:alice,bob,bestfriends,carol,fran,badcompany.\nbestfriends:eve,alice.\nbadcompany:dave,carol.\n5\na:b,c,d,e.\nb:c,d,e,f.\nc:d,e,f,g.\nd:e,f,g,h.\ne:f,g,h,i.\n4\naa:bb.\ncc:dd,ee.\nff:gg.\nbb:cc.\n0\n","output":"4\n1\n6\n4\n2\n"},{"problem_id":"p00885","input":"2\n10 100\n100 270\n2\n10 100\n100 280\n3\n100 150\n10 360\n40 450\n3\n100 150\n10 360\n40 440\n2\n100 10\n50 200\n2\n100 100\n50 110\n1\n15 10\n4\n1 10\n2 20\n3 100\n90 200\n0\n","output":"OK 220\nOK 200\nOK 260\nOK 280\nNG 1\nNG 2\nNG 1\nOK 188\n"},{"problem_id":"p00886","input":"2\n1\n3\n5 3 2\n3\n6 3 2\n5\n9 8 7 6 6 4 3 2 2 1\n6\n9 8 8 7 6 6 5 5 3 3 3 2 2 1 1\n6\n11 10 9 8 7 6 6 5 5 4 3 2 2 1 1\n7\n72 65 55 51 48 45 40 38 34 32 27 25 24 23 21 17 14 13 11 10 7\n20\n190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171\n170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151\n150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131\n130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111\n110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91\n90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71\n70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51\n50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31\n30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11\n10 9 8 7 6 5 4 3 2 1\n19\n60 59 58 56 53 52 51 50 48 48 47 46 45 45 44 43 43 42 42 41 41 40 40 40\n40 40 40 40 39 39 39 38 38 38 37 37 36 36 35 35 34 33 33 32 32 32 31 31\n30 30 30 29 28 28 28 28 27 27 26 26 25 25 25 25 24 24 23 23 23 23 22 22\n22 22 21 21 21 21 20 20 20 20 20 20 20 20 20 20 20 20 20 19 19 19 19 19\n18 18 18 18 18 17 17 17 17 16 16 16 15 15 15 15 14 14 13 13 13 12 12 12\n12 12 11 11 11 10 10 10 10 10 9 9 8 8 8 8 8 8 7 7 7 6 6 6 5 5 5 5 5 5 4\n4 4 3 3 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1\n0\n","output":"1\n-----\n2 3\n3 2\n-----\n-----\n1 2 4 2\n2 4 2 1\n-----\n1 2 3 2 1\n-----\n1 1 4 2 3\n1 5 1 2 2\n2 2 1 5 1\n3 2 4 1 1\n-----\n7 14 11 13 10 17\n17 10 13 11 14 7\n-----\n-----\n1 1 2 3 5 8 1 1 2 3 5 8 1 1 2 3 5 8\n8 5 3 2 1 1 8 5 3 2 1 1 8 5 3 2 1 1\n-----\n"},{"problem_id":"p00887","input":"1 1 1\n1\n2 2 1\n1 1\n1 1\n3 2 1\n1 0 1\n0 1 0\n3 3 1\n1 0 1\n0 1 0\n1 0 1\n4 4 2\n1 1 0 1\n0 0 0 1\n1 0 1 1\n1 0 0 0\n5 5 1\n1 1 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n5 5 2\n0 0 0 0 0\n0 0 0 0 0\n0 0 1 0 0\n0 0 0 0 0\n0 0 0 0 0\n11 11 3\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 1 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n11 11 3\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 1 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0\n13 13 7\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 1 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0\n","output":"1\n1\n0\n1\n0\n0\n1\n1\n0\n1\n"},{"problem_id":"p00888","input":"6\n0 0\n3 4\n9 12\n17 6\n21 9\n33 0\n5\n0 0\n10 0\n20 0\n30 0\n40 0\n10\n0 0\n1 2\n3 0\n6 3\n9 0\n11 2\n13 0\n15 2\n16 2\n18 0\n7\n0 0\n150 997\n300 1\n450 999\n600 2\n750 998\n900 0\n0\n","output":"52.5\n40.0\n30.3356209304689\n10078.072814085803\n"},{"problem_id":"p00889","input":"3 32 64 7\n4 35 89 5\n5 555 442 3\n5 777 465 11\n100000 666 701622763 65537\n0 0 0 0\n","output":"2\n4\n6\n3\n68530\n"},{"problem_id":"p00890","input":"3 3 3\n1 2 3\n2 3 3\n1 3 8\n12 12 2010\n1 2 0\n2 3 3000\n3 4 0\n4 5 3000\n5 6 3000\n6 12 2010\n2 7 100\n7 8 200\n8 9 300\n9 10 400\n10 11 500\n11 6 512\n10 18 1\n1 2 9\n1 3 2\n1 4 6\n2 5 0\n2 6 10\n2 7 2\n3 5 10\n3 6 3\n3 7 10\n4 7 6\n5 8 10\n6 8 2\n6 9 11\n7 9 3\n8 9 9\n8 10 8\n9 10 1\n8 2 1\n0 0 0\n","output":"1\n2\n3\n"},{"problem_id":"p00891","input":"48 3 3\ngAY4I4wA\ngIIgIIgg\nw4IAYAg4\ng\ng\nw\n153 3 3\nkkkkkkkkkkkkkkkkkkkkkkkkkg\nSSSSSSSSSSSSSSSSSSSSSSSSSQ\nJJJJJJJJJJJJJJJJJJJJJJJJJI\ng\nQ\nI\n1 1 2\nA\nA\nA\n384 3 2\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/\nBCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/A\nCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/AB\nA\nA\n0 0 0\n","output":"8\n51\n0\n98\n"},{"problem_id":"p00892","input":"4 3\n7 2\n3 3\n0 2\n3 1\n4 2\n0 1\n8 1\n4 4\n30 2\n30 12\n2 12\n2 2\n15 2\n30 8\n13 14\n2 8\n8 5\n13 5\n21 7\n21 9\n18 15\n11 15\n6 10\n6 8\n8 5\n10 12\n5 9\n15 6\n20 10\n18 12\n3 3\n5 5\n10 3\n10 10\n20 8\n10 15\n10 8\n4 4\n-98 99\n-99 -99\n99 -98\n99 97\n-99 99\n-98 -98\n99 -99\n96 99\n0 0\n","output":"4.708333333333333\n1680.0000000000005\n491.1500000000007\n0.0\n7600258.4847715655\n"},{"problem_id":"p00893","input":"1\nA=[1 2 3;4 5 6].\n1\nA=[[1 2 3;4 5 6] [7 8;9 10] [11;12];13 14 15 16 17 18].\n3\nB=[3 -2 1;-9 8 7].\nC=([1 2 3;4 5 6]+B)(2,3).\nD=([1 2 3;4 5 6]+B)([1 2],[2 3]).\n5\nA=2*[1 2;-3 4]'.\nB=A([2 1 2],[2 1]).\nA=[1 2;3 4]*3.\nA=[2]*[1 2;3 4].\nA=[1 2;3 4]*[3].\n2\nA=[11 12 13;0 22 23;0 0 33].\nA=[A A';--A''' A].\n2\nA=[1 -1 1;1 1 -1;-1 1 1]*3.\nA=[A -A+-A;-A'([3 2 1],[3 2 1]) -A'].\n1\nA=1([1 1 1],[1 1 1 1]).\n3\nA=[1 2 -3;4 -5 6;-7 8 9].\nB=A([3 1 2],[2 1 3]).\nC=A*B-B*A+-A*-B-B*-A.\n3\nA=[1 2 3 4 5].\nB=A'*A.\nC=B([1 5],[5 1]).\n3\nA=[-11 12 13;21 -22 23;31 32 -33].\nB=[1 0 0;0 1 0;0 0 1].\nC=[(A-B) (A+B)*B (A+B)*(B-A)([1 1 1],[3 2 1]) [1 2 3;2 1 1;-1 2 1]*(A-B)].\n3\nA=[11 12 13;0 22 23;0 0 33].\nB=[1 2].\nC=------A((((B))),B)(B,B)''''''.\n2\nA=1+[2]+[[3]]+[[[4]]]+2*[[[[5]]]]*3.\nB=[(-[([(-A)]+-A)])].\n8\nA=[1 2;3 4].\nB=[A A+[1 1;0 1]*4;A+[1 1;0 1]'*8 A+[1 1;0 1]''*12].\nC=B([1],[1]).\nC=B([1],[1 2 3 4]).\nC=B([1 2 3 4],[1]).\nC=B([2 3],[2 3]).\nA=[1 2;1 2].\nD=(A*-A+-A)'(A'(1,[1 2]),A'(2,[1 2])).\n0\n","output":"1 2 3\n4 5 6\n-----\n1 2 3 7 8 11\n4 5 6 9 10 12\n13 14 15 16 17 18\n-----\n3 32766 1\n32759 8 7\n13\n0 4\n13 13\n-----\n2 32762\n4 8\n8 4\n32762 2\n8 4\n3 6\n9 12\n2 4\n6 8\n3 6\n9 12\n-----\n11 12 13\n0 22 23\n0 0 33\n11 12 13 11 0 0\n0 22 23 12 22 0\n0 0 33 13 23 33\n11 0 0 11 12 13\n12 22 0 0 22 23\n13 23 33 0 0 33\n-----\n3 32765 3\n3 3 32765\n32765 3 3\n3 32765 3 32762 6 32762\n3 3 32765 32762 32762 6\n32765 3 3 6 32762 32762\n32765 3 32765 32765 32765 3\n32765 32765 3 3 32765 32765\n3 32765 32765 32765 3 32765\n-----\n1 1 1 1\n1 1 1 1\n1 1 1 1\n-----\n1 2 32765\n4 32763 6\n32761 8 9\n8 32761 9\n2 1 32765\n32763 4 6\n54 32734 32738\n32752 32750 174\n32598 186 32702\n-----\n1 2 3 4 5\n1 2 3 4 5\n2 4 6 8 10\n3 6 9 12 15\n4 8 12 16 20\n5 10 15 20 25\n5 1\n25 5\n-----\n32757 12 13\n21 32746 23\n31 32 32735\n1 0 0\n0 1 0\n0 0 1\n32756 12 13 32758 12 13 32573 32588 180 123 62 32725\n21 32745 23 21 32747 23 32469 32492 276 28 33 15\n31 32 32734 31 32 32736 32365 32396 372 85 32742 32767\n-----\n11 12 13\n0 22 23\n0 0 33\n1 2\n11 12\n0 22\n-----\n40\n80\n-----\n1 2\n3 4\n1 2 5 6\n3 4 3 8\n9 2 13 14\n11 12 3 16\n1\n1 2 5 6\n1\n3\n9\n11\n4 3\n2 13\n1 2\n1 2\n32764 32764\n32764 32764\n-----\n"},{"problem_id":"p00894","input":"14\n04\/21 09:00 I 000\n04\/21 09:00 I 001\n04\/21 09:15 I 002\n04\/21 09:30 O 001\n04\/21 09:45 O 000\n04\/21 10:00 O 002\n04\/28 09:00 I 003\n04\/28 09:15 I 000\n04\/28 09:30 I 004\n04\/28 09:45 O 004\n04\/28 10:00 O 000\n04\/28 10:15 O 003\n04\/29 20:00 I 002\n04\/29 21:30 O 002\n20\n06\/01 09:00 I 001\n06\/01 09:15 I 002\n06\/01 09:15 I 003\n06\/01 09:30 O 002\n06\/01 10:00 I 000\n06\/01 10:15 O 001\n06\/01 10:30 I 002\n06\/01 10:45 O 002\n06\/01 11:00 I 001\n06\/01 11:15 O 000\n06\/01 11:30 I 002\n06\/01 11:45 O 001\n06\/01 12:00 O 002\n06\/01 12:15 I 000\n06\/01 12:30 I 002\n06\/01 12:45 O 000\n06\/01 13:00 I 000\n06\/01 13:15 O 000\n06\/01 13:30 O 002\n06\/01 13:45 O 003\n0\n","output":"45\n120\n"},{"problem_id":"p00895","input":"5 7\nRRCABXT\nAABMFAB\nRROMJAC\nAPTADAB\nYABADAO\n3 13\nABCDEFGHIJKLM\nXMADAMIMADAMY\nACEGIKMOQSUWY\n3 4\nDEFG\nACAB\nHIJK\n3 6\nABCDEF\nGHIAKL\nMNOPQR\n10 19\nJFZODYDXMZZPEYTRNCW\nXVGHPOKEYNZTQFZJKOD\nEYEHHQKHFZOVNRGOOLP\nQFZOIHRQMGHPNISHXOC\nDRGILJHSQEHHQLYTILL\nNCSHQMKHTZZIHRPAUJA\nNCCTINCLAUTFJHSZBVK\nLPBAUJIUMBVQYKHTZCW\nXMYHBVKUGNCWTLLAUID\nEYNDCCWLEOODXYUMBVN\n0 0\n","output":"ABRACADABRA\nMADAMIMADAM\nABAC\n0\nABCDEFGHIJKLMNOPQRSTUVWXYZHHHHHABCDEFGHIJKLMNOPQRSTUVWXYZ\n"},{"problem_id":"p00896","input":"4\nA\nAND\nCAT\nDOG\nZ XUW ZVX Z YZT.\n2\nAZ\nAY\nZA.\n2\nAA\nBB\nCC.\n16\nA\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nL\nM\nN\nO\nABCDEFGHIJKLMNO\nA B C D E F G H I J K L M N O ABCDEFGHIJKLMNO.\n0\n","output":"A DOG AND A CAT.\nAZ.\n-.\nA B C D E F G H I J K L M N O ABCDEFGHIJKLMNO.\n"},{"problem_id":"p00897","input":"6 3 34\nTokyo Kyoto\nTokyo Niigata 335\nTokyo Shizuoka 174\nShizuoka Nagoya 176\nNagoya Kyoto 195\nToyama Niigata 215\nToyama Kyoto 296\nNagoya\nNiigata\nToyama\n6 3 30\nTokyo Kyoto\nTokyo Niigata 335\nTokyo Shizuoka 174\nShizuoka Nagoya 176\nNagoya Kyoto 195\nToyama Niigata 215\nToyama Kyoto 296\nNagoya\nNiigata\nToyama\n0 0 0\n","output":"846\n-1\n"},{"problem_id":"p00898","input":"0 0 1\n3 5 2\n-4 1 3\n13 -13 2\n-32 15 9\n-50 50 0\n0 0 0\n","output":"6\n10\n9\n30\n47\n100\n"},{"problem_id":"p00899","input":"3\n","output":"16\n"},{"problem_id":"p00900","input":"5 6\n","output":"6\n"},{"problem_id":"p00901","input":"4\n........4...2..........\n(.1.-.----.)..*.-.5.+.6\n........2..............\n.......3...............\n3\n...3.\n-.---\n...4.\n4\n.3.+.4.*.-.2.\n-------------\n..........2..\n...-.1.-.2...\n2\n...2..3\n(.4..).\n1\n2.+.3.*.5.-.7.+.9\n1\n(.2.+.3.).*.(.5.-.7.).+.9\n3\n.2....3.\n4..+.---\n......5.\n3\n.2......-.-.3.\n4..-.-.-------\n..........5...\n9\n............1............\n-------------------------\n..............1..........\n.1.+.-------------------.\n................1........\n......1.+.-------------..\n..................1......\n...........1.+.-------...\n................1.+.2....\n15\n.................2......\n................---.....\n.......2.........5....3.\n.(.---------.+.-----.)..\n.....7...........3......\n....---.+.1.............\n.....4..................\n------------------------\n.......2................\n......---...............\n.......5.......2....2...\n...(.-----.+.-----.)....\n.......3.......3........\n..............---.......\n...............4........\n2\n.0....2....\n3..+.4..*.5\n20\n............2............................2......................................\n...........3............................3.......................................\n..........----.........................----.....................................\n............4............................4......................................\n.....2.+.------.+.1...............2.+.------.+.1................................\n............2............................2......................................\n...........2............................2........................2..............\n..........----.........................----.....................3...............\n............2............................2.....................----.............\n...........3............................3........................4..............\n(.(.----------------.+.2.+.3.).*.----------------.+.2.).*.2.+.------.+.1.+.2.*.5\n............2............................2.......................2..............\n...........5............................5.......................2...............\n..........----.........................----....................----.............\n............6............................6.......................2..............\n.........------.......................------....................3...............\n............3............................3......................................\n..........----.........................----.....................................\n............2............................2......................................\n...........7............................7.......................................\n0\n","output":"501\n502\n1\n74\n19\n2010\n821\n821\n1646\n148\n81\n1933\n"},{"problem_id":"p00902","input":"1 10\n5 5 7\n2 12\n5 5 7\n8 6 3\n3 10\n3 11 2\n2 1 1\n2 16 3\n3 15\n-5 2 5\n9 2 9\n5 8 6\n3 38\n-25 -10 8\n30 5 7\n-3 35 11\n3 39\n-25 -10 8\n30 5 7\n-3 35 11\n3 800\n-400 400 2\n300 300 1\n300 302 1\n3 800\n400 -400 2\n300 300 1\n307 300 3\n8 147\n130 80 12\n130 -40 12\n-110 80 12\n-110 -40 12\n70 140 12\n70 -100 12\n-50 140 12\n-50 -100 12\n3 493\n345 154 10\n291 111 75\n-275 -301 46\n4 55\n54 0 1\n40 30 5\n27 36 10\n0 48 7\n3 30\n0 3 3\n-3 0 4\n400 0 3\n3 7\n2 3 2\n-5 -4 2\n-4 3 2\n3 10\n-5 -4 5\n2 3 5\n-4 3 5\n4 6\n4 6 1\n5 5 1\n1 7 1\n0 1 1\n3 493\n345 154 10\n291 111 75\n-275 -301 46\n5 20\n-9 12 5\n0 15 5\n3 -3 3\n12 9 5\n-12 9 5\n0 0\n","output":"81.68140899333463\n106.81415022205297\n74.11215318612639\n108.92086846105579\n0.0\n254.85616536128433\n8576.936716409238\n8569.462129048667\n929.1977057481128\n4181.124698202453\n505.09134735536804\n0.0\n46.82023824234038\n65.66979416387915\n50.990642291793506\n4181.124698202453\n158.87951420768937\n"},{"problem_id":"p00903","input":"3 6\n3 1\n1 2 1\n2 3 1\n3 2 1\n2 1 1\n1 3 4\n3 1 4\n3 6\n5 1\n1 2 1\n2 3 1\n3 2 1\n2 1 1\n1 3 4\n3 1 4\n4 5\n3 1\n3 1\n1 2 5\n2 3 5\n3 4 5\n4 2 5\n3 1 5\n2 1\n2 1 1\n0 0\n","output":"7\n8\n36\n-1\n"},{"problem_id":"p00904","input":"8\n10 0\n0 2\n-3 0\n4 2\n0 -13\n-4 1\n-2 -1\n3 -1\n","output":"C\nC\nP\nC\nC\nP\nP\nC\n"},{"problem_id":"p00905","input":"5 4\n(Follow.my.style\n.........starting.from.round.brackets)\n{then.curly.brackets\n.....[.and.finally\n.......square.brackets.]}\n(Thank.you\n{for.showing.me\n[all\nthe.secrets]})\n4 2\n(This.time.I.will.show.you\n.........(how.to.use.round.brackets)\n.........[but.not.about.square.brackets]\n.........{nor.curly.brackets})\n(I.learned\nhow.to.use.round.brackets)\n4 2\n(This.time.I.will.show.you\n.........(how.to.use.round.brackets)\n.........[but.not.about.square.brackets]\n.........{nor.curly.brackets})\n[I.have.not.learned\nhow.to.use.square.brackets]\n2 2\n(Be.smart.and.let.fear.of\n..(closed.brackets).go)\n(A.pair.of.round.brackets.enclosing\n[A.line.enclosed.in.square.brackets])\n1 2\nTelling.you.nothing.but.you.can.make.it\n[One.liner.(is).(never.indented)]\n[One.liner.(is).(never.indented)]\n2 4\n([{Learn.from.my.KungFu\n...}])\n((\n{{\n[[\n]]}}))\n1 2\nDo.not.waste.your.time.trying.to.read.from.emptiness\n(\n)\n2 3\n({Quite.interesting.art.of.ambiguity\n....})\n{\n(\n)}\n2 4\n({[\n............................................................]})\n(\n{\n[\n]})\n0 0\n","output":"0 9 14 16\n0 9\n0 -1\n0 2\n0 0\n0 2 4 6\n0 -1\n0 -1 4\n0 20 40 60\n"},{"problem_id":"p00906","input":"5 4 1 3 2 0\n0 1 2 0 1\n5 7 1 3 2 1\n0 1 2 0 1\n5 13 1 3 2 11\n0 1 2 0 1\n5 5 2 0 1 100\n0 1 2 0 1\n6 6 0 2 3 1000\n0 1 2 0 1 4\n20 1000 0 2 3 1000000000\n0 1 2 0 1 0 1 2 0 1 0 1 2 0 1 0 1 2 0 1\n30 2 1 0 1 1000000000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0\n30 2 1 1 1 1000000000\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n30 5 2 3 1 1000000000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0\n","output":"0 1 2 0 1\n2 0 0 4 3\n2 12 10 9 11\n3 0 4 2 1\n0 4 2 0 4 4\n0 376 752 0 376 0 376 752 0 376 0 376 752 0 376 0 376 752 0 376\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0\n1 1 3 2 2 2 3 3 1 4 3 1 2 3 0 4 3 3 0 4 2 2 2 2 1 1 2 1 3 0\n"},{"problem_id":"p00907","input":"2\n1.0\n4.0\n12.0\n16.0\n25.0\n1\n-30.5893962764\n5.76397083962\n39.3853798058\n74.3727663177\n4\n42.4715310246\n79.5420238202\n28.0282396675\n-30.3627807522\n-49.8363481393\n-25.5101480106\n7.58575761381\n5\n-21.9161699038\n-48.469304271\n-24.3188578417\n-2.35085940324\n-9.70239202086\n-47.2709510623\n-93.5066246072\n-82.5073836498\n0\n","output":"2\n1\n1\n6\n"},{"problem_id":"p00908","input":"3 3\noo.\noXX\n.XX\n3 3\nXXo\nXX.\no.o\n3 5\n.o*XX\noooXX\noooo.\n7 12\noooooooooooo\nooooo*****oo\noooooo****oo\no**ooo***ooo\no***ooooo..o\no**ooooooXXo\nooooo****XXo\n5 30\noooooooooooooooooooooooooooooo\noooooooooooooooooooooooooooooo\no***************************oo\nXX.ooooooooooooooooooooooooooo\nXX.ooooooooooooooooooooooooooo\n0 0\n","output":"11\n0\n-1\n382\n6807\n"},{"problem_id":"p00909","input":"2 2\n! 1 2 1\n? 1 2\n2 2\n! 1 2 1\n? 2 1\n4 7\n! 1 2 100\n? 2 3\n! 2 3 100\n? 2 3\n? 1 3\n! 4 3 150\n? 4 1\n0 0\n","output":"1\n-1\nUNKNOWN\n100\n200\n-50\n"},{"problem_id":"p00910","input":"12 5 4\n0 10 0 1\n1 5 0 2\n1 4 0 2\n0 0 0 2\n10 0 0 1\n3 -1 0 2\n5 -1 0 2\n10 10 0 15\n0 -10 0 1\n10 -10 0 1\n-10 -10 0 1\n10 10 0 1\n0 10 0 240\n10 0 0 200\n10 -2 0 52\n-10 0 0 100\n1 1 0 2\n0 0 0\n12 5 4\n0 10 0 1\n1 5 0 2\n1 4 0 2\n0 0 0 2\n10 0 0 1\n3 -1 0 2\n5 -1 0 2\n10 10 0 15\n0 -10 0 1\n10 -10 0 1\n-10 -10 0 1\n10 10 0 1\n0 10 0 260\n10 0 0 200\n10 -2 0 52\n-10 0 0 100\n1 1 0 2\n0 0 0\n5 1 3\n1 2 0 2\n-1 8 -1 8\n-2 -3 5 6\n-2 1 3 3\n-4 2 3 5\n1 1 2 7\n0 0 0\n5 1 2\n1 2 0 2\n-1 8 -1 8\n-2 -3 5 6\n-2 1 3 3\n-4 2 3 5\n1 1 2 7\n0 0 0\n0 0 0\n","output":"3.5\n3.6\n1.1666666666666667\n0.0\n"},{"problem_id":"p00911","input":"4 5\n1 2 1\n1 3 2\n1 1 3\n3 1 3\n1 3 1\n4 4\n1 2 1\n1 3 2\n1 1 3\n4 1 3\n4 5\n1 2 1\n1 3 2\n1 1 3\n4 1 3\n5 1 3\n2 3\n1 1 2\n2 1 2\n3 1 2\n0 0\n","output":"3\n4\n4\n2\n"},{"problem_id":"p00912","input":"11 4\n4 2 1 3\n5 7\n1 1 1 2 2 1 2\n11 7\n3 1 3 1 3 3 4\n100 3\n30 30 39\n30 3\n2 5 3\n0 0\n","output":"2\n1\n2\n40\n1\n"},{"problem_id":"p00913","input":"0 0 0 3 3 3\n###\n###\n###\n###\n###\n###\n###\n###\n###\n3 3 0 0 0 3\n#..\n###\n###\n###\n###\n###\n#.#\n###\n###\n0 0 2 2 2 2\n...\n...\n...\n.#.\n#..\n...\n##.\n##.\n...\n0 1 2 2 1 1\n...\n...\n...\n.#.\n#..\n...\n##.\n##.\n...\n3 2 0 2 3 2\n###\n..#\n...\n..#\n...\n.#.\n..#\n..#\n.##\n0 0 0 0 0 0\n","output":"6.70820393249936941515\n6.47870866461907457534\n2.82842712474619029095\n2.23606797749978980505\n2.82842712474619029095\n"},{"problem_id":"p00914","input":"9 3 23\n9 3 22\n10 3 28\n16 10 107\n20 8 102\n20 10 105\n20 10 155\n3 4 3\n4 2 11\n0 0 0\n","output":"1\n2\n0\n20\n1542\n5448\n1\n0\n0\n"},{"problem_id":"p00915","input":"3 6\nR 1\nL 2\nL 5\n1 10\nR 1\n2 10\nR 5\nL 7\n2 10\nR 3\nL 8\n2 99\nR 1\nL 98\n4 10\nL 1\nR 2\nL 8\nR 9\n6 10\nR 2\nR 3\nL 4\nR 6\nL 7\nL 8\n0 0\n","output":"5 1\n9 1\n7 1\n8 2\n98 2\n8 2\n8 3\n"},{"problem_id":"p00916","input":"3\n4 28 27 11\n15 20 42 5\n11 24 33 14\n5\n4 28 27 11\n12 11 34 2\n7 26 14 16\n14 16 19 12\n17 28 27 21\n2\n300000 1000000 600000 0\n0 600000 1000000 300000\n0\n","output":"8\n6\n6\n"},{"problem_id":"p00917","input":"12 0 0 0\n12 11 59 59\n12 1 56 0\n12 1 56 3\n12 1 56 34\n12 3 9 43\n12 3 10 14\n12 7 17 58\n12 7 18 28\n12 7 23 0\n12 7 23 31\n2 0 38 29\n2 0 39 0\n2 0 39 30\n2 1 6 20\n2 1 20 1\n2 1 20 31\n3 2 15 0\n3 2 59 30\n4 0 28 48\n5 1 5 40\n5 1 6 10\n5 1 7 41\n11 0 55 0\n0 0 0 0\n","output":"0 0 43200 1427\n0 0 43200 1427\n1 56 4080 1427\n1 56 47280 1427\n1 57 4860 1427\n3 10 18600 1427\n3 10 61800 1427\n7 18 39240 1427\n7 18 82440 1427\n7 23 43140 1427\n7 24 720 1427\n0 38 4680 79\n0 39 2340 79\n0 40 0 1\n1 6 3960 79\n1 20 2400 79\n1 21 60 79\n2 15 0 1\n0 0 2700 89\n0 28 48 1\n1 6 320 33\n1 6 40 1\n1 8 120 11\n0 55 0 1\n"},{"problem_id":"p00918","input":"4 9\n6 3 0\n8 1 2\n4 5 7\n6 3 0\n8 1 2\n4 5 7\n31 31\n4 3 6\n0 1 5\n8 2 7\n0 3 6\n4 1 5\n8 2 7\n92 4\n1 5 3\n4 0 7\n8 2 6\n1 5 0\n4 7 3\n8 2 6\n12 28\n3 4 5\n0 2 6\n7 1 8\n5 7 1\n8 6 2\n0 3 4\n0 0\n","output":"0\n31\n96\n312\n"},{"problem_id":"p00919","input":"4 0 2013 1124\n1 1 1\n2 2 2\n2 1 1\n1 2 1\n2 100 131832453 129800231\n42 40 46\n42 40 46\n0 100000 7004674 484521438\n0 0 0 0\n","output":"1 1 1 1 2 1\n42 40 46 83 79 91\n92 92 79 99 99 85\n"},{"problem_id":"p00920","input":"6 0 1 1\n0 0 0\n0 2 2\n1 1 1\n2 0 2\n2 2 0\n2 2 2\n5 0 1 1\n0 0 0\n1 1 1\n2 2 2\n3 3 3\n4 4 4\n10 0 1 1\n3 0 0\n2 1 0\n2 0 1\n1 2 0\n1 1 1\n1 0 2\n0 3 0\n0 2 1\n0 1 2\n0 0 3\n0 10 1 1\n0 0 0 0\n","output":"3\n5\n1\n3\n"},{"problem_id":"p00921","input":"5 16\n70 66 40\n38 52 20\n40 35 10\n70 30 10\n20 60 10\n1 100\n54 75 200\n1 10\n90 10 1\n1 11\n54 75 200\n3 10\n53 60 1\n61 38 1\n45 48 1\n4 10\n20 20 10\n20 80 10\n80 20 10\n80 80 10\n0 0\n","output":"26.00000\n39.00000\n130.00000\n49.49777\n85.00000\n95.00000\n"},{"problem_id":"p00922","input":"9\n3 4 1 3 1 2 4 4 6\n4\n3 12 6 3\n10\n10 9 8 7 6 5 4 3 2 1\n11\n10 9 8 7 6 5 4 3 2 1 1\n8\n1 1 1 1 1 1 1 1\n0\n","output":"6\n2\n1\n5\n8\n"},{"problem_id":"p00923","input":"2 2\n^(C|I|T|Y)*\n","output":"IC\nPC\nHE\nLP\nALLY\nOUNE\nEDIS\nLOVE\nambiguous\nnone\nARKA\nNSAS\n"},{"problem_id":"p00924","input":"6 3\n1 0 0 1 0 1\n1 3 2\n","output":"1\n"},{"problem_id":"p00925","input":"1+2*3+4\n11\n","output":"M\n"},{"problem_id":"p00926","input":"10 3\n3 7\n8 9\n2 5\n","output":"23\n"},{"problem_id":"p00927","input":"100 1 0\n50 100\n","output":"14.57738\n"},{"problem_id":"p00928","input":"4 2 1 1\n1 1 1 2\n2 2 2 1\n2 2 1 2\n1 1 2 1\n9 N\n","output":"1 1\n2 2\n"},{"problem_id":"p00929","input":"4 4\n1 2 3\n1 3 3\n2 3 3\n2 4 3\n","output":"1 3\n"},{"problem_id":"p00930","input":"6 3\n((()))\n4\n3\n1\n","output":"2\n2\n1\n"},{"problem_id":"p00931","input":"8 900 0\n40 100\n70 -80\n350 30\n680 -20\n230 230\n300 400\n530 130\n75 -275\n","output":"1210.99416\n"},{"problem_id":"p00932","input":"2 5 4\n5 7\n4 8\n","output":"8 7\n"},{"problem_id":"p00933","input":"6 5 1 2 3\n5 5 5\n1 5 5\n2 5 4\n3 5 3\n4 5 2\n5 5 1\n","output":"0.631579\n"},{"problem_id":"p00934","input":"3 2 4 0\n2 2\n-2 -2\n-2 2\n","output":"15\n"},{"problem_id":"p00935","input":"3\n3 0 1\n","output":"2\n"},{"problem_id":"p00936","input":"2\n10 10\n","output":"40.00000000\n"},{"problem_id":"p00937","input":"3 3 1 2 4\n1 2\n2 3\n3 1\n","output":"IMPOSSIBLE\n"},{"problem_id":"p00938","input":"2 10 6\n4 4 E\n6 4 W\n","output":"2\n"},{"problem_id":"p00939","input":"20\n","output":"4\n"},{"problem_id":"p00940","input":"2 2 7\n3 4\n3 2\n1 3\n1 1\n2 2\n1 2\n2 1\n1 2\n2 2\n1 1\n","output":"5\n"},{"problem_id":"p00941","input":"crc\n1\n","output":"crc\n"},{"problem_id":"p00942","input":"4 6 5\n-2 5\n-2 -1\n2 -1\n2 5\n-2 1\n-2 0\n0 0\n0 -2\n2 -2\n2 1\n","output":"8\n"},{"problem_id":"p00943","input":"6 6\n3\n1\n9\n4\n3\n6\n1 2\n1 4\n2 6\n5 4\n6 5\n3 2\n","output":"17\n"},{"problem_id":"p00944","input":"8 8\n1 2\n1 3\n2 4\n2 5\n2 8\n3 5\n3 6\n4 7\n1000\n100\n100\n10\n10\n10\n1\n1\n3\n2 8 6\n2 4 7\n2 7 8\n","output":"1000\n10\n100\n"},{"problem_id":"p00945","input":"5 Alice\n10 20 30 40 50\n","output":"30\n"},{"problem_id":"p00946","input":"5 3\n4\n2\n5\n","output":"5\n2\n4\n1\n3\n"},{"problem_id":"p00947","input":"0 3 1 7 5 9 8 6 4 2\n7 0 9 2 1 5 4 8 6 3\n4 2 0 6 8 7 1 3 5 9\n1 7 5 0 9 8 3 4 2 6\n6 1 2 3 0 4 5 9 7 8\n3 6 7 4 2 0 9 5 8 1\n5 8 6 9 7 2 0 1 3 4\n8 9 4 5 3 6 2 0 1 7\n9 4 3 8 6 1 7 2 0 5\n2 5 8 1 4 3 6 7 9 0\n","output":"0\n"},{"problem_id":"p00948","input":"4 3\n1000 1\n2000 2\n3000 3\n","output":"2 3 4 4\n"},{"problem_id":"p00949","input":"anagram\ngrandmother\n","output":"4\n"},{"problem_id":"p00950","input":"ACM\n","output":"0\n"},{"problem_id":"p00951","input":"Alice Bob\n3\n2\nAlice Bob\nBob Clare\n2\nBob Clare\nClare David\n2\nClare David\nDavid Alice\n","output":"No\n"},{"problem_id":"p00952","input":"6\n2\n3\n1\n1\n4\n2\n","output":"Yes\nYes\nYes\nNo\nYes\nNo\n"},{"problem_id":"p00953","input":"2 1\n1 2 2\n","output":"1\n"},{"problem_id":"p00954","input":"2\n5 6\n1000000000 2\n","output":"4\n5 6\n0 6\n0 0\n5 0\n3\n1000000000 0\n0 2\n999999999 0\n"},{"problem_id":"p00955","input":"4 4\n0 0\n6 0\n6 6\n0 6\n","output":"35.759506\n"},{"problem_id":"p00956","input":"4\nB\nW\nWB\nWB\n","output":"5\n"},{"problem_id":"p00957","input":"5 3\n","output":"6\n"},{"problem_id":"p00958","input":"4\n0 0\n1 1\n0 2\n2 4\n","output":"1\n"},{"problem_id":"p00959","input":"3 20\n5\n7\n3\n","output":"5\n3\n2\n"},{"problem_id":"p00960","input":"10\n-53 62\n-19 58\n-11 11\n-9 -22\n45 -7\n37 -39\n47 -58\n-2 41\n-37 10\n13 42\n","output":"72.96316928\n"},{"problem_id":"p00961","input":"4 4\nBWWB\nWBBW\n","output":"2\n"},{"problem_id":"p00962","input":"4 5\n1 3 5\n3 4 6\n4 2 7\n2 1 18\n2 3 12\n","output":"SAD\nSAD\nSAD\nSOSO\nHAPPY\n"},{"problem_id":"p00963","input":"CD 30 1\nDB 30 1\n","output":"YES\n"},{"problem_id":"p00964","input":"6 3\n1 2\n1 5\n2 3\n2 6\n4 5\n4 6\n","output":"6\n2\n"},{"problem_id":"p00965","input":"4\n1 3\n1 3\n3 6\n3 6\n","output":"2 2\n"},{"problem_id":"p00966","input":"9 4 5 4\n3 C\n4 I\n7 C\n9 P\n2 1\n4 0\n6 2\n7 0\n8 4\n8\n1\n9\n6\n","output":"ICPC\n"},{"problem_id":"p00967","input":"4 5\n1 2\n1 3\n1 4\n2 3\n3 4\n","output":"3\n"},{"problem_id":"p00968","input":"2\nfile10\nfile20\nfile3\n","output":"+\n-\n"},{"problem_id":"p00969","input":"6\n0 1 3 5 6 9\n","output":"4\n"},{"problem_id":"p00970","input":"5 2 7\n1 1\n1 2\n1 3\n2 3\n2 4\n4 4\n5 2\n","output":"9\n"},{"problem_id":"p00971","input":"0101\n1100001\n","output":"0010\n"},{"problem_id":"p00972","input":"4 2\n1 2\n3 4\n","output":"2\n1 4\n2 3\n"},{"problem_id":"p00973","input":"4\n0 0\n10 0\n10 10\n0 10\n","output":"10\n14.142135623730950488\n"},{"problem_id":"p00974","input":"7\n3 1 4 1 5 9 2\n","output":"3\n"},{"problem_id":"p00975","input":"5 8\n0 0\n2 0\n0 2\n2 2\n1 1\n1 2\n1 3\n1 5\n2 4\n2 5\n3 4\n3 5\n4 5\n","output":"1\n2\n2\n1\n3\n"},{"problem_id":"p00976","input":"2 3\n001\n101\n","output":"-0-\n-00\n"},{"problem_id":"p00977","input":"5\n1 2\n2 3\n3 4\n2 5\n1 2 1 2 3\n11\nQ 1\nQ 2\nQ 3\nQ 4\nU 5 1\nQ 1\nU 3 2\nQ 1\nQ 2\nU 5 4\nQ 1\n","output":"2\n2\n0\n-1\n3\n2\n2\n0\n"},{"problem_id":"p00978","input":"5\n1 2 3 4 5\n1 2 3 4 5\n","output":"2 3 4 5 1\n"},{"problem_id":"p00979","input":"19\n","output":"5\n"},{"problem_id":"p00980","input":"5 4 2\n1 1 10\n5 4 3\n","output":"130\n"},{"problem_id":"p00981","input":"8 5 10 5\n1 1 7\n3 1 2\n1 5 6\n3 1 4\n3 6 8\n","output":"70\n"},{"problem_id":"p00982","input":"3\n0 0 0\n1 0 0\n3 0 0\n1 2\n2 3\n0 0 0\n0 2 2\n0 3 3\n4 5\n5 6\n","output":"1\n"},{"problem_id":"p00983","input":"6 3\n1 3 4 2 6 5\n","output":"4\n"},{"problem_id":"p00984","input":"2 0\n5 1 2 1 1\n10 1 3 2 2\n","output":"9\n"},{"problem_id":"p00985","input":"3\n0\n01\n10\n","output":"3\n"},{"problem_id":"p00986","input":"(()())---)\n","output":"0\n0\n1\n1\n3\n4\n3\n1\n1\n2\n"},{"problem_id":"p00987","input":"3 2\n1 2\n2 3\n3\n1 2\n1 3\n2 3\n","output":"Yes\n1 2\n2 3\n"},{"problem_id":"p00988","input":"4\n10 0\n20 10\n10 30\n0 10\n","output":"300.00\n"},{"problem_id":"p00989","input":"3 3 1 2 3\n.#.\n###\n.#.\n","output":"10\n"},{"problem_id":"p00990","input":"5\n5*57*\n2\n3 9\n","output":"1\n"},{"problem_id":"p00991","input":"4 4 0 0 3 3\n","output":"2\n"},{"problem_id":"p00992","input":"2\n5\n5\n","output":"11\n"},{"problem_id":"p00993","input":"2\n","output":"8\n2\n3\n"},{"problem_id":"p00994","input":"3 3\n.1.\n1.1\n.1.\n","output":"0\n"},{"problem_id":"p00995","input":"4 4\n0 1 3\n1 3 4\n0 2 2\n2 3 1\n4\n0 0\n2 2\n2 1\n3 4\n","output":"1\n1\n2\n1\n"},{"problem_id":"p00996","input":"3 3\n4o.\n4o.\n4o.\n","output":"\uff13\n"},{"problem_id":"p00997","input":"4\n0 1 3\n1 2 5\n1 3 2\n","output":"23\n"},{"problem_id":"p00998","input":"10 3\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n1 5 7\n0 2 5\n1 5 7\n","output":"5\n4\n"},{"problem_id":"p00999","input":"70 100 340 4 200\n1 1 4\n70 100 340 4 200\n0 1 3\n70 100 340 4 200\n1 1 2\n0 0 0 0 0\n","output":"970\n800\n800\n"},{"problem_id":"p01000","input":"5\n00000\n01010\n00000\n00100\n00000\n\n00000\n01010\n00000\n01010\n00000\n\n00000\n00100\n00000\n01010\n00000\n\n00000\n01010\n00000\n00100\n00000\n\n00000\n00000\n00100\n00000\n00000\n\n1 2\n2 3 4\n4\n01110\n00100\n00100\n00100\n01110\n\n01110\n10001\n10000\n10001\n01110\n\n11111\n10001\n11111\n10000\n10000\n\n01110\n10001\n10000\n10001\n01110\n\n00000\n00000\n00000\n00000\n00000\n\n2 3 4\n1 2\n100\n00100\n01010\n01110\n10001\n10001\n\n01110\n00100\n00100\n00100\n01110\n\n00000\n00000\n00000\n00000\n00000\n\n11111\n00010\n00100\n01000\n11111\n\n10001\n10001\n10001\n10001\n01110\n\n5 1 3 5 7 9\n5 0 2 4 6 8\n0\n","output":"Case 1:\n00000\n00000\n01010\n01110\n10101\n\n00000\n10001\n00000\n00000\n00000\n\n00000\n00000\n11111\n10001\n00000\n\n00000\n00000\n00000\n00000\n01010\n\n00000\n00000\n01110\n00100\n11111\n\nCase 2:\n00010\n10110\n00000\n11000\n10000\n\n00001\n00000\n10101\n00010\n00100\n\n10001\n00000\n00000\n00000\n00010\n\n01110\n10001\n00000\n00001\n10000\n\n00000\n00000\n00111\n01001\n01000\n\nCase 3:\n00000\n00000\n00000\n00000\n00000\n\n00000\n00000\n00000\n00000\n00000\n\n00000\n00000\n00000\n00000\n00000\n\n00000\n00000\n00000\n00000\n00000\n\n00000\n00000\n00000\n00000\n00000\n"},{"problem_id":"p01001","input":"9 0 0 0\n0 9 0 0\n0 0 0 0\n0 0 0 0\n5\n1 1 1 1 1\n1000 500\n10 10 10 10\n10 10 10 10\n10 10 10 10\n10 10 10 10\n5\n1 0 2 0 1\n1000 2000\n3 8 6 10\n0 1 6 8\n10 2 4 7\n8 6 6 8\n19\n2 2 0 2 2 0 2 1 0 1 2 0 1 2 0 1 0 2 2\n200 100\n-1 -1 -1 -1\n","output":"0.3024000000\n0.0000000000\n0.5120000000\n"},{"problem_id":"p01002","input":"0\n1 1 1 5 5\n5 5 5 5 5\n5 5 1 5 5\n5 1 1 1 5\n5 5 5 5 5\n0 0 0 0 1\n2\n1 2 3 4 5\n2 3 4 5 5\n2 3 4 5 5\n3 4 5 5 1\n5 4 3 2 1\n100 99 98 97 96\n5\n1 2 3 4 5\n2 3 4 5 1\n1 2 3 4 5\n5 4 3 2 1\n1 2 3 4 5\n99 79 31 23 56\n-1\n","output":"17\n2040\n926\n"},{"problem_id":"p01003","input":"9 14 5 10\n1 2 1\n1 4 5\n2 4 4\n2 3 3\n2 6 2\n3 6 3\n3 7 2\n4 6 5\n4 5 6\n5 8 8\n6 7 3\n7 8 1\n7 9 9\n8 9 2\n1 9\n1\n2\n5\n7\n9\n4 5 1 3\n1 2 1\n1 3 2\n2 3 2\n2 4 9\n3 4 1\n1 4\n2\n4 5 1 10\n1 2 1\n1 3 2\n2 3 2\n2 4 9\n3 4 1\n1 4\n2\n4 3 1 1\n1 2 1\n2 3 1\n3 4 1\n1 4\n1\n4 3 1 2\n1 2 1\n2 3 1\n3 4 1\n1 4\n1\n4 3 1 10\n1 2 1\n2 3 1\n3 4 1\n1 4\n1\n2 1 1 1\n1 2 1\n1 2\n1\n2 1 1 10\n1 2 1\n1 2\n1\n4 2 1 4\n1 2 1\n3 4 1\n1 4\n2\n0 0 0 0\n","output":"27\n6\n8\n3\n5\n7\n1\n19\nNA\n"},{"problem_id":"p01004","input":"3 4\n10 75\n50 5\n90 75\n50 50 10 10 2\n40 90 1 1 3\n10 20 10 15 1\n50 70 50 50 4\n4 2\n25 25\n25 75\n75 75\n75 25\n50 50 10 10 1\n50 50 15 15 2\n1 1\n5 5\n1 1 1 1 1\n0 0\n","output":"5.442857\n0.750000\n1.000000\n"},{"problem_id":"p01005","input":"18 10\n0\n4 1\n1 1\n4 1\n0\n1 1\n0\n2 2\n1 10\n0\n1 1\n0\n1 1\n0\n1 5\n3 4 0\n3 4 1\n0\n9 10\n4 1\n2 2\n3 5 5\n0\n4 1\n2 2\n3 5 5\n0\n2 1\n0 0\n","output":"distance 10\ndistance 9\nhit\ndamage 2\nbomb 1\nbomb 2\nend\ndistance -1\nmiss\nbomb 0\ndistance 10\nmiss\nbomb 1\nhit\nend\n"},{"problem_id":"p01006","input":"ABCFI\nABCABCABC\nAEI\nEFC\n\uff08\u4e2d\u7565\uff09\nDEHED\nEEEEE\n\uff08\u4ee5\u4e0a\u3067\u3061\u3087\u3046\u30691000\u500b\uff09\n","output":"ABCFI\nEFC\n\uff08\u4e2d\u7565\uff09\nDEHED\n"},{"problem_id":"p01007","input":"3 1\n1 1 0\n0 1 1\n1 0 1\n0 2 2 2 90\n","output":"1 1 0\n0 0 1\n1 1 1\n"},{"problem_id":"p01008","input":"1\n10 1\n","output":"win\n"},{"problem_id":"p01009","input":"3 5\nCOMPARE 1 2\nIN 1 2 5\nIN 2 3 3\nCOMPARE 2 3\nCOMPARE 1 3\n","output":"WARNING\n3\n11\n"},{"problem_id":"p01010","input":"1\n90 10 20\n3 3 1 90 10 315 10\n6 0 1\n","output":"30\n"},{"problem_id":"p01011","input":"3 3\n0 0 0\n0 18 0\n0 0 0\n","output":"16\n"},{"problem_id":"p01012","input":"1 1 1\n1 1 1\n","output":"0.562500\n"},{"problem_id":"p01013","input":"0 0 10\n0 0 0 4\n0 0 1\n","output":"91.769438 75.782170\n"},{"problem_id":"p01014","input":"5 5 2\n#####\n#S.G#\n#...#\n#...#\n#####\n","output":"4\n"},{"problem_id":"p01015","input":"10 2\n9 left : 9 left\n9 right : 9 right\n","output":"9\n"},{"problem_id":"p01016","input":"ABCDE\nABC\n","output":"Yes\n"},{"problem_id":"p01017","input":"4 4\n10 2 -1 6\n8 1 -100 41\n22 47 32 11\n-41 99 12 -8\n1 0 0 1\n0 0 1 0\n0 1 0 1\n0 0 1 0\n2 3\n1 0 1\n0 1 0\n","output":"193\n"},{"problem_id":"p01018","input":"10 3\n2 2 1\n4 2 1\n8 1 1\n","output":"8\n"},{"problem_id":"p01019","input":"4\n1 1 1 5\n3 3 5 3\n4 2 4 4\n7 1 7 5\n","output":"2\n"},{"problem_id":"p01020","input":"4\n1 2 3 4\n","output":"11\n"},{"problem_id":"p01021","input":"1 2\n18\n6 9\n","output":"1\n"},{"problem_id":"p01022","input":"3\n1 1\n2 2\n3 3\n","output":"1\n"},{"problem_id":"p01023","input":"5 8 3\n#.......\n#.####2#\n#.#.3..#\n#.######\n.1Sabcde\n","output":"14\n"},{"problem_id":"p01024","input":"1 1 9\n","output":"9\n"},{"problem_id":"p01026","input":"7\n1\n2\n3\n4\n5\n6\n7\n1 2\n1 3\n3 4\n3 5\n5 6\n5 7\n10\n0 1 7\n0 2 7\n1 1 15\n0 1 7\n0 2 7\n0 1 1\n1 1 -15\n0 1 7\n0 2 7\n0 1 1\n","output":"16\n18\n31\n33\n16\n16\n18\n1\n"},{"problem_id":"p01027","input":"3\nfrence 1\nusi 1\npowland 1\n2\nusi 0 frence 0 10\nfrence 0 powland 0 10\n2\nusi 0\npowland 0\n","output":"20\nusi 0 frence 0\nfrence 0 powland 0\n-----\nImpossible\n-----\n"},{"problem_id":"p01028","input":"1 10\n1 2 3 4 5 6 7 8 9 10\n","output":"0\n"},{"problem_id":"p01029","input":"3 3\nc ? ?\n0 1\n0 2\n1 2\n","output":"cab\n"},{"problem_id":"p01030","input":"2 2\nS.\n.G\n1\n3\n##\n##\n","output":"2\n"},{"problem_id":"p01031","input":"6 25 3\n8 5 1 1 2 6\n","output":"1\n"},{"problem_id":"p01032","input":"6 3\n4\n4\n5\n","output":"Alice\n"},{"problem_id":"p01033","input":"3 3\n3\n0 0\n1 1\n2 2\n2\n1 0\n2 1\n3\n1 1\n2 2\n0 1\n2\n1 0\n2 0\n","output":"2 0 0\n"},{"problem_id":"p01034","input":"3 2 -3\n0 1 1\n0 2 5\n","output":"-2\n"},{"problem_id":"p01035","input":"3\n1 2 3\n3\n0 2 2\n0 2 4\n0 0 2\n","output":"0\n1\n1\n"},{"problem_id":"p01036","input":"1 2 2 1\n4 1\n0 0\n2 0\n2 2\n0 2\n","output":"0.2500000000\n"},{"problem_id":"p01037","input":"5 3\n0 1\n2 1\n3 1\n","output":"2 1\n1 1\n"},{"problem_id":"p01038","input":"5 1 2 3 4 3\n","output":"0 0 0 1 0\n"},{"problem_id":"p01039","input":"2 5\n1 1\n2 1\n","output":"3\n"},{"problem_id":"p01040","input":"2015 3 13 2015 3 13\n","output":"1\n"},{"problem_id":"p01041","input":"3\napple\napp\nbanana\n9\n1 1\n3 1\n3 2\n3 3\n2 1\n1 2\n3 1\n3 2\n3 3\n","output":"1\n1\n-1\n-1\n2\n-1\n"},{"problem_id":"p01042","input":"2 5 3 3 11\n","output":"3\n"},{"problem_id":"p01043","input":"3 1\n4\n0 4\n2 4\n2 7\n0 7\n1 6\n5\n1 0\n6 0\n4 5\n2 2\n1 4\n4 2\n3\n2 6\n6 4\n6 7\n5 6\n","output":"14.6502815399\n"},{"problem_id":"p01044","input":"3 3\nRGR\nRBP\nYEB\n1\n1 1\n","output":"\u2026\nYBG\nEBP\n"},{"problem_id":"p01045","input":"3 3 2\n...\n...\n...\n","output":"Chieno\n"},{"problem_id":"p01046","input":"3 3 1 10\n@0.\n...\n...\n0 100\n","output":"100\n"},{"problem_id":"p01047","input":"2 1\n1 2\n5 0 0\n","output":"3\n"},{"problem_id":"p01048","input":"1\n","output":"1\n"},{"problem_id":"p01049","input":"5\n2 3\n3\n0 2 5\n0 3 5\n1 2 4\n2\n","output":"11\n"},{"problem_id":"p01050","input":"0ig3he12fz99\n","output":"9\n"},{"problem_id":"p01051","input":"5 5\nS....\n.....\n.....\n.....\n....G\n","output":"14\n"},{"problem_id":"p01052","input":"4\n1 31\n2 2\n2 3\n3 3\n","output":"1700\n"},{"problem_id":"p01053","input":"6 3 1 10\n0 1 0\n0 2 0\n0 3 0\n1 3 3\n0 2 1\n2 2 2\n2 3 2\n2 2 0\n1 1 1\n2 2 1\n","output":"1\n3\n9\n9\n0\n3\n9\n3\n1\n0\n"},{"problem_id":"p01054","input":"3\nabc\nxyz\n","output":"0\n"},{"problem_id":"p01055","input":"2 2 1\n2 1\n3 1 1 1 2 2 2\n","output":"1\n"},{"problem_id":"p01056","input":"3 1\n0 4\n","output":"27\n"},{"problem_id":"p01057","input":"2 1\nabcd\nefgh\n1 1 2 2 3\n","output":"agh\nefbcd\n"},{"problem_id":"p01058","input":"2 2 0 0 0 1\n","output":"0\n"},{"problem_id":"p01059","input":"3 2\n1 3\n","output":"1\n"},{"problem_id":"p01060","input":"11 11\n5\n0 0 0 0 0\n","output":"0\n"},{"problem_id":"p01061","input":"3 1\n1 2\n","output":"0\n"},{"problem_id":"p01062","input":"4 1 4\n1 2\n2 3\n3 4\n","output":"Yes\n"},{"problem_id":"p01063","input":"3\n0 0 0\n1 2 2\n","output":"3\n"},{"problem_id":"p01064","input":"4\n2 1\n3\n0 1 2\n1 1 4\n2 2 4\n3\n","output":"2\n"},{"problem_id":"p01065","input":"3\n3 3\n3 2 4 1\n5 1 2 1\n3 1 3 2\n","output":"3\n"},{"problem_id":"p01066","input":"3\n0 0\n0 1\n1 0\n","output":"2\n"},{"problem_id":"p01067","input":"3\n0 0 2\n3 3 1\n6 1 1\n","output":"1\n"},{"problem_id":"p01068","input":"2 1\n0 0 1\n0 1 0\n0\n","output":"2\n"},{"problem_id":"p01069","input":"3 3 1\n1 2 3\n3 1 2\n3\n","output":"6\n"},{"problem_id":"p01070","input":"rupcrupc 5\n0 3 rupc\n0 7 rupc\n2 7 ru\n2 7 pc\n1 5 u\n","output":"1\n2\n1\n2\n2\n"},{"problem_id":"p01071","input":"5 4\n5\n1 1 3 3\n3 2 4 2\n4 3 5 4\n1 4 5 4\n4 1 4 1\n","output":"9\n9\n13\n13\n14\n"},{"problem_id":"p01072","input":"3 3 3\n5\n2 0 0\n0 1 0\n1 1 1\n1 2 1\n2 2 0\n0 0 0\n0 1 0\n0 0 0\n","output":"1\n"},{"problem_id":"p01073","input":"5 100 3\n2 3 4 5 6\n50 40 20 10 5\n","output":"280\n"},{"problem_id":"p01074","input":"3 7 3\n0 1 1 1\n0 1 1 2\n1 1 3 4\n1 1 1 1\n1 2 1 2\n2 1 1 3\n2 2 2 1\n","output":"9\n"},{"problem_id":"p01075","input":"3 2\n1 2 10\n2 3 20\n","output":"20\n"},{"problem_id":"p01076","input":"4 3\n","output":"3\n"},{"problem_id":"p01077","input":"1 10\no........@\n","output":"yes\n"},{"problem_id":"p01078","input":"5 2\n","output":"1.12256994\n"},{"problem_id":"p01079","input":"5 4 40\n0 1 1 1 0\n1 2 5\n2 3 5\n3 4 5\n4 5 5\n","output":"6\n"},{"problem_id":"p01080","input":"2\n1 2\n","output":"1\n1\n"},{"problem_id":"p01081","input":"acca\n","output":"0\n"},{"problem_id":"p01082","input":"20 10 1\n0 0\n","output":"28\n"},{"problem_id":"p01083","input":"2\n3 3 2\n8 3 2\n0 3\n3 7\n8 0\n8 7\n","output":"13.8190642862\n"},{"problem_id":"p01084","input":"1\n0111f\n","output":"1\n0111f\n"},{"problem_id":"p01085","input":"5 2 4\n100\n90\n82\n70\n65\n5 2 4\n100\n90\n80\n75\n65\n3 1 2\n5000\n4000\n3000\n4 2 3\n10000\n10000\n8000\n8000\n4 2 3\n10000\n10000\n10000\n8000\n5 2 3\n100\n80\n68\n60\n45\n0 0 0\n","output":"3\n4\n2\n2\n3\n2\n"},{"problem_id":"p01086","input":"9\ndo\nthe\nbest\nand\nenjoy\ntoday\nat\nacm\nicpc\n14\noh\nyes\nby\nfar\nit\nis\nwow\nso\nbad\nto\nme\nyou\nknow\nhey\n15\nabcde\nfghijkl\nmnopq\nrstuvwx\nyzz\nabcde\nfghijkl\nmnopq\nrstuvwx\nyz\nabcde\nfghijkl\nmnopq\nrstuvwx\nyz\n0\n","output":"1\n2\n6\n"},{"problem_id":"p01087","input":"1\n9\n4\n+\n.1\n.2\n.3\n9\n+\n.0\n.+\n..*\n...1\n...*\n....1\n....2\n..0\n10\n+\n.+\n..6\n..2\n.+\n..1\n..*\n...7\n...6\n.3\n0\n","output":"9\n6\n2\n54\n"},{"problem_id":"p01088","input":"4\n800\n700\n1600\n600\n4\n300\n700\n1600\n600\n4\n300\n700\n1600\n650\n3\n1000\n2000\n500\n3\n250\n250\n1000\n4\n1251\n667\n876\n299\n0\n","output":"2 2900\n3 2500\n3 3250\n1 500\n3 1500\n3 2217\n"},{"problem_id":"p01089","input":"11\n01u12u0123u\n6\n01u10u\n8\n201u210u\n9\n01u12u20u\n3\n77u\n12\n9u8u845u954u\n0\n","output":"SAFE\nUNSAFE\nSAFE\nUNSAFE\nUNSAFE\nUNSAFE\n"},{"problem_id":"p01090","input":"4 5 2\n1 2 2 A\n1 3 2 A\n1 4 2 A\n2 3 1 B\n3 4 1 B\n5 8 2\n1 2 1 A\n2 3 1 A\n3 4 3 A\n4 5 3 A\n1 2 5 B\n2 3 5 B\n3 4 8 B\n4 5 8 B\n5 5 1\n1 2 1 A\n2 3 1 A\n3 4 1 A\n4 5 1 B\n3 5 1 B\n4 5 3\n1 2 2 A\n2 4 3 B\n3 4 4 B\n2 3 5 A\n3 1 6 A\n0 0 0\n","output":"5\n16\n-1\n-1\n"},{"problem_id":"p01091","input":"4\n0 0\n10 0\n10 5\n0 5\n3\n5 0\n17 3\n7 10\n4\n0 5\n5 0\n10 0\n7 8\n4\n0 0\n40 0\n50 5\n0 5\n4\n0 0\n10 0\n20 5\n10 5\n7\n4 0\n20 0\n24 1\n22 10\n2 10\n0 6\n0 4\n18\n728 997\n117 996\n14 988\n1 908\n0 428\n2 98\n6 54\n30 28\n106 2\n746 1\n979 17\n997 25\n998 185\n999 573\n999 938\n995 973\n970 993\n910 995\n6\n0 40\n0 30\n10 0\n20 0\n40 70\n30 70\n0\n","output":"23.090170\n28.528295\n23.553450\n97.135255\n34.270510\n57.124116\n3327.900180\n142.111776\n"},{"problem_id":"p01092","input":"2\n1 2 8\n1 1 1\n8 8 1\n3 3 3 3 2\n3\n3 2 3\n1 1 2\n1 1 2\n1 1 2\n1 1 1 1 2\n1 2 1 2 2\n2 1 2 1 2\n2\n2 3 100\n100 50 1\n1 50 3\n100 1 100 100 3\n1 1 1 100 2\n5\n6 7 60\n11 11 1\n11 51 1\n51 11 1\n51 51 1\n31 31 1\n11 11 51 51 2\n11 11 51 51 3\n11 11 51 51 4\n11 11 51 51 5\n18 1 54 42 6\n1 43 59 60 7\n5\n6 4 9\n5 5 3\n1 1 1\n1 9 1\n9 1 1\n9 9 1\n3 3 7 7 4\n4 4 6 6 2\n1 1 2 2 3\n1 8 2 9 3\n8 1 9 2 3\n8 8 9 9 3\n5\n10 5 50\n3 40 1\n29 13 2\n39 28 1\n50 50 1\n25 30 5\n3 5 10 10 2\n11 11 14 14 2\n15 15 20 23 2\n40 40 41 50 2\n1 49 3 50 2\n30 30 50 50 3\n1 1 10 10 4\n1 30 1 50 5\n20 30 20 50 5\n40 30 40 50 5\n15\n2 2 1000000\n514898 704203 1\n743530 769450 1\n202298 424059 1\n803485 898125 1\n271735 512227 1\n442644 980009 1\n444735 799591 1\n474132 623298 1\n67459 184056 1\n467347 302466 1\n477265 160425 2\n425470 102631 2\n547058 210758 2\n52246 779950 2\n291896 907904 2\n480318 350180 768473 486661 2\n776214 135749 872708 799857 2\n0\n","output":"216\n6\n497\n3181\n1365\n1930\n6485356\n"},{"problem_id":"p01093","input":"5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n","output":"0\n1\n5\n"},{"problem_id":"p01094","input":"1\nA\n4\nA A B B\n5\nL M N L N\n6\nK K K K K K\n6\nX X X Y Z X\n10\nA A A B A C A C C B\n10\nU U U U U V V W W W\n0\n","output":"A 1\nTIE\nTIE\nK 4\nX 5\nA 7\nU 8\n"},{"problem_id":"p01095","input":"3 1\n3 4\n10 20\n100 50\n2 500000\n0 0\n","output":"4\n11\n47\n150\n7368791\n"},{"problem_id":"p01096","input":"4\n1 2 3 4\n4\n1 2 3 1\n5\n5 1 2 3 6\n14\n8 7 1 4 3 5 4 1 6 8 10 4 6 5\n5\n1 3 5 1 3\n0\n","output":"4\n4\n2\n12\n0\n"},{"problem_id":"p01097","input":"1 1 100\n100 100 100\n6 4 10\n100 100 100\n106 102 102\n112 110 104\n104 116 102\n100 114 104\n92 107 100\n10 4 10\n-100 101 100\n-108 102 120\n-116 103 100\n-124 100 100\n-132 99 100\n-92 98 100\n-84 100 140\n-76 103 100\n-68 102 100\n-60 101 100\n10 4 10\n100 100 100\n108 101 100\n116 102 100\n124 100 100\n132 102 100\n200 100 103\n192 100 102\n184 100 101\n176 100 100\n168 100 103\n4 4 10\n100 100 100\n108 94 100\n116 100 100\n108 106 100\n23 6 10\n100 100 100\n96 109 100\n100 118 100\n109 126 100\n118 126 100\n127 118 98\n127 109 104\n127 100 97\n118 91 102\n109 91 100\n111 102 100\n111 102 109\n111 102 118\n111 102 91\n111 102 82\n111 114 96\n111 114 105\n102 114 114\n93 114 114\n84 114 105\n84 114 96\n93 114 87\n102 114 87\n10 3 10\n100 100 100\n116 116 102\n132 132 104\n148 148 106\n164 164 108\n108 108 108\n124 124 106\n140 140 104\n156 156 102\n172 172 100\n0 0 0\n","output":"60000\n1856\n-1\n1632\n1856\n2796\n1640\n"},{"problem_id":"p01098","input":"3 6\n.#..#.\n#.##.#\n.#..#.\n8 7\n.#####.\n#.....#\n#..#..#\n#.#.#.#\n#..#..#\n#..#..#\n.#####.\n...#...\n3 3\n#..\n...\n#..\n3 3\n#..\n.#.\n#..\n3 3\n...\n...\n...\n3 3\n...\n.#.\n...\n3 3\n.#.\n#.#\n.#.\n3 3\n.#.\n###\n.#.\n7 7\n.#####.\n#.....#\n#..#..#\n#.#.#.#\n#..#..#\n#.....#\n.#####.\n7 7\n.#####.\n#.....#\n#..#..#\n#.#.#.#\n#..#..#\n#..#..#\n.#####.\n7 7\n.#####.\n#.....#\n#..#..#\n#.#.#.#\n#..#..#\n#.....#\n.#####.\n7 11\n.#####.....\n#.....#....\n#..#..#..#.\n#.#.#.#.#.#\n#..#..#..#.\n#.....#....\n.#####.....\n7 3\n.#.\n#.#\n.#.\n#.#\n.#.\n#.#\n.#.\n7 7\n.#####.\n#..#..#\n#..#..#\n#.#.#.#\n#..#..#\n#..#..#\n.#####.\n3 1\n#\n#\n.\n1 2\n#.\n0 0\n","output":"yes\nno\nno\nno\nno\nno\nyes\nyes\n"},{"problem_id":"p01099","input":"3 4\n100 4\n100 0\n0 0\n1 2 1.00\n2 1 1.00\n3 1 9.99\n3 2 9.99\n7 6\n0 0\n1 0\n2 0\n0 10\n1 10\n2 10\n20 5\n1 7 1.00\n2 7 1.00\n3 7 1.00\n4 7 1.00\n5 7 1.00\n6 7 1.00\n4 4\n-1 -1\n1 -1\n-1 1\n1 1\n1 4 1.10\n4 2 2.10\n2 3 3.10\n3 1 4.10\n8 12\n-91 0\n-62 0\n-18 0\n2 0\n23 0\n55 0\n63 0\n80 0\n2 7 3.96\n3 2 2.25\n2 4 5.48\n8 7 9.74\n5 6 6.70\n7 6 1.51\n4 1 7.41\n5 8 1.11\n6 3 2.98\n3 4 2.75\n1 8 5.89\n4 5 5.37\n0 0\n","output":"1.414214\n0.816497\n0.356001\n5.854704\n"},{"problem_id":"p01100","input":"3 3\n1 2\n2 3\n1 3\n4 3\n1 2\n1 3\n1 4\n4 6\n1 2\n1 3\n1 4\n2 3\n3 4\n2 4\n0 0\n","output":"1 1\n0 1\n1 2\n"},{"problem_id":"p01101","input":"3 45\n10 20 30\n6 10\n1 2 5 8 9 11\n7 100\n11 34 83 47 59 29 70\n4 100\n80 70 60 50\n4 20\n10 5 10 16\n0 0\n","output":"40\n10\n99\nNONE\n20\n"},{"problem_id":"p01102","input":"print\"hello\";print123\nprint\"hello\";print123\nread\"B1input\";solve;output;\nread\"B2\";solve;output;\nread\"C1\";solve;output\"C1ans\";\nread\"C2\";solve;output\"C2ans\";\n\"\"\"\"\"\"\"\"\n\"\"\"42\"\"\"\"\"\nslow\"program\"\nfast\"code\"\n\"super\"fast\"program\"\n\"super\"faster\"program\"\nX\"\"\nX\nI\"S\"\"CREAM\"\nI\"CE\"\"CREAM\"\n11\"22\"11\n1\"33\"111\n.\n","output":"IDENTICAL\nCLOSE\nDIFFERENT\nCLOSE\nDIFFERENT\nDIFFERENT\nDIFFERENT\nCLOSE\nDIFFERENT\n"},{"problem_id":"p01103","input":"3 3\n2 3 2\n2 1 2\n2 3 1\n3 5\n3 3 4 3 3\n3 1 0 2 3\n3 3 4 3 2\n7 7\n1 1 1 1 1 0 0\n1 0 0 0 1 0 0\n1 0 1 1 1 1 1\n1 0 1 0 1 0 1\n1 1 1 1 1 0 1\n0 0 1 0 0 0 1\n0 0 1 1 1 1 1\n6 6\n1 1 1 1 2 2\n1 0 0 2 0 2\n1 0 0 2 0 2\n3 3 3 9 9 9\n3 0 0 9 0 9\n3 3 3 9 9 9\n0 0\n","output":"0\n3\n1\n9\n"},{"problem_id":"p01104","input":"4 3\n110\n101\n011\n110\n7 1\n1\n1\n1\n1\n1\n1\n1\n4 5\n10000\n01000\n00100\n00010\n6 6\n111111\n011000\n100000\n000010\n100001\n100100\n0 0\n","output":"3\n6\n0\n6\n"},{"problem_id":"p01105","input":"0\n(a*(1*b))\n(1^a)\n(-(-a*-b)*a)\n(a^(b^(c^d)))\n.\n","output":"1\n5\n2\n1\n13\n"},{"problem_id":"p01106","input":"3 3 2\n12 578 2214\n59 471605241352156968 431565444592236940\n0 0 0\n","output":"LRR\nRLLLRRRLRRLL\nLRRRLRRLLRRRRLLLLRLLRRRLRRLLRLLLLLLRLRLLRLRLLLRLRLLRLLRRRLL\n"},{"problem_id":"p01107","input":"3 3\n...\n.#.\n...\n5 5\n..#..\n.....\n#....\n.....\n.....\n3 8\n..#.....\n........\n.....#..\n3 5\n..#..\n.....\n..#..\n4 4\n....\n....\n..##\n..#.\n0 0\n","output":"YES\nNO\nYES\nNO\nNO\n"},{"problem_id":"p01108","input":"0 1\n2 2\n1 0\n1 3\n5 2\n4 3\n\n0 0\n0 1\n1 0\n0 3\n0 2\n1 -1\n\n-5 -4\n0 1\n0 15\n-10 14\n-5 10\n0 -8\n\n-110 221\n-731 525\n-555 -258\n511 -83\n-1000 -737\n66 -562\n\n533 -45\n-525 -450\n-282 -667\n-439 823\n-196 606\n-768 -233\n\n0 0\n0 1\n1 0\n99 1\n100 1\n55 2\n\n354 -289\n89 -79\n256 -166\n131 -196\n-774 -809\n-519 -623\n\n-990 688\n-38 601\n-360 712\n384 759\n-241 140\n-59 196\n\n629 -591\n360 -847\n936 -265\n109 -990\n-456 -913\n-787 -884\n\n-1000 -1000\n-999 -999\n-1000 -998\n1000 1000\n999 999\n1000 998\n\n-386 -83\n404 -83\n-408 -117\n-162 -348\n128 -88\n296 -30\n\n-521 -245\n-613 -250\n797 451\n-642 239\n646 309\n-907 180\n\n-909 -544\n-394 10\n-296 260\n-833 268\n-875 882\n-907 -423\n","output":"4\n3\n3\n3\n3\n4\n4\n4\n4\nMany\nMany\nMany\nMany\n"},{"problem_id":"p01109","input":"7\n15 15 15 15 15 15 15\n4\n10 20 30 60\n10\n1 1 1 1 1 1 1 1 1 100\n7\n90 90 90 90 90 90 10\n7\n2 7 1 8 2 8 4\n0\n","output":"7\n3\n9\n1\n4\n"},{"problem_id":"p01110","input":"2 1 1 1\n1 1\n0 0\n1 3 2 1\n2 1\n2 1\n0 0\n10 8 3 2\n2 2\n1 3\n1 1\n0 1\n3 4\n3 3 3 2\n1 2\n2 1\n1 1\n0 1\n0 0\n0 0 0 0\n","output":"2\n3\n8\n1\n3\n6\n"},{"problem_id":"p01111","input":"15\n16\n2\n3\n9699690\n223092870\n847288609\n900660121\n987698769\n999999999\n0\n","output":"1 5\n16 1\n2 1\n1 2\n16 4389\n129 20995\n4112949 206\n15006 30011\n46887 17718\n163837 5994\n"},{"problem_id":"p01112","input":"5\n3\n3 2\n4 1\n5 1\n3\n1\n1 2\n3\n2\n1 2\n3 2\n5\n4\n4 1\n4 2\n5 1\n5 2\n5\n3\n4 1\n4 2\n5 1\n5\n4\n3 2\n4 1\n5 1\n5 2\n9\n11\n6 1\n6 4\n7 2\n7 3\n7 4\n8 2\n8 3\n8 4\n9 1\n9 3\n9 5\n9\n10\n6 1\n6 4\n7 2\n7 3\n7 4\n8 2\n8 3\n8 4\n9 1\n9 3\n5\n6\n4 3\n2 1\n5 1\n2 4\n1 3\n2 3\n9\n1\n1 2\n0\n","output":"2\n1\n0\n0\n1\n0\n0\n16\n0\n1615040\n"},{"problem_id":"p01113","input":"1\n0000000000000000000000000000000000000000000000000000\n2\n0000000000000000000000000000000000000000000000000000\n3\n0000000000000000000000000000000000000000000000000000\n4\n0000000000000000000000000000000000000000000000000000\n7\n1101000000000000000000000000000000000000000000000000\n100\n1100011010100001100111100101000111001001111100101011\n123456789\n1010101010101010101010101010101010101010101010101010\n1000000000000000000\n1111111111111111111111111111111111111111111111111111\n0\n","output":"0000000000010000000000000000000000000000000000000000000000000000\n0000000000011000000000000000000000000000000000000000000000000000\n0000000000100000000000000000000000000000000000000000000000000000\n0000000000100100000000000000000000000000000000000000000000000000\n0000000000111101000000000000000000000000000000000000000000000000\n0000000001110110011010111011100001101110110010001001010101111111\n0000000110111000100001110101011001000111100001010011110101011000\n0000001101010000000000000000000000000000000000000000000000000000\n"},{"problem_id":"p01114","input":"4\n1\n0 1\n1 2\n-1 2\n2 1\n4\n1\n1 1\n2 2\n1 3\n1 4\n4\n1\n1 1\n2 2\n3 1\n4 1\n4\n1\n1 2\n2 1\n3 2\n4 2\n5\n2\n0 1\n0 2\n0 3\n0 4\n0 5\n6\n3\n0 2\n2 2\n1 1\n0 3\n2 3\n1 4\n0\n","output":"6.000000000000\n6.928203230276\n6.000000000000\n7.732050807569\n6.928203230276\n6.000000000000\n"},{"problem_id":"p01115","input":"3\n(1+2)*3+3\n2\n1*1*1+1*1*1\n587\n1*(2*3*4)+5+((6+7*8))*(9)\n0\n","output":"4\n9\n2\n"},{"problem_id":"p01116","input":"3 10\n5 4 3\n1 2 3\n1 2\n5 2\n5 40\n10 10 10 10 8\n1 2 3 4 5\n1 1 2 3\n10 10 10 10\n5 10\n2 2 2 5 2\n2 2 2 5 2\n1 1 2 2\n2 1 2 1\n0 0\n","output":"18\n108\n35\n"},{"problem_id":"p01117","input":"5 2\n10 20 30 40 50\n15 25 35 45 55\n6 3\n10 20 30 15 25 35\n21 34 11 52 20 18\n31 15 42 10 21 19\n4 2\n0 0 0 0\n0 0 0 0\n0 0\n","output":"105\n83\n0\n"},{"problem_id":"p01118","input":"3 9\nABCDEFGHI\nJKLMNOPQR\nSTUVWXYZ_\nICPC\n5 11\n___________\n____A______\n________M__\n___________\n_C_________\nACM\n4 21\n1_2_3_4_5_6_7_8_9_0_-\nQqWwEeRrTtYyUuIiOoPp@\nAaSsDdFfGgHhJjKkLl;_:\nZzXxCcVvBbNnMm,_._\/__\nICPC2019,AsiaYokohamaRegional,QualificationRound\n0 0\n","output":"28\n23\n493\n"},{"problem_id":"p01119","input":"4 2\n9 2 7 11\n2 9\n6 2\n7 3 6 12 16 9\n2 9\n5 2\n7 3 6 12 17\n2 9\n7 5\n15 21 33 48 51 75 111\n36 54 57 93 113\n0 0\n","output":"0\n5\n-1\n5\n"},{"problem_id":"p01120","input":"4 5\n2 3 1 4\n2 5 5 2\n3 100\n1 10 100\n1 10 100\n5 10000\n4971 7482 1238 8523 1823\n3287 9013 9812 297 1809\n0 0\n","output":"4\n0\n14731\n"},{"problem_id":"p01121","input":"5\n..XX.\n.XXX.\nXXXXX\nXXXXX\nX....\n....X\nXXXXX\n.XXX.\n.XXX.\n.....\n..XXX\nXXXX.\n.XXXX\n.XXXX\n...X.\n...X.\n.XXXX\nXXXX.\nXXXX.\n.X.X.\nXXX.X\n.XXXX\nXXXXX\n.XXXX\n.XXXX\nXX...\n.XXXX\nXXXXX\nXXXXX\nXX...\n5\n..XX.\n.XXX.\nXXXXX\nXXXX.\nX....\n....X\nXXXXX\n.XXX.\n.XXX.\n.....\n.XXXX\nXXXX.\n.XXXX\n.XXXX\n...X.\n...X.\n.XXXX\nXXXX.\nXXXX.\n.X.X.\nXXX.X\n.XXXX\nXXXXX\n.XXXX\n.XXXX\nXX...\nXXXXX\nXXXXX\n.XXXX\nXX...\n0\n","output":"Yes\nNo\n"},{"problem_id":"p01122","input":"4\n3 3 1\n2 6\n-4\n3\n1 -10\n100\n5\n-2 -2 -2 -2\n-1 -1 -1\n-1 -1\n1\n4\n-4 7 6\n2 3\n-1\n0\n","output":"7\n11\n-1\n9\n"},{"problem_id":"p01123","input":"4\n..E.\n.AD.\nB...\n..C.\nD\n4\n..E.\n.AD.\nB...\n..C.\nDR\n3\n...\n.A.\nBC.\n((URD)3L)2R\n5\n...P.\nPPPPP\nPPP..\nPPPPP\n..P..\nLRLR(LR)12RLLR\n20\n....................\n....................\n.III..CC..PPP...CC..\n..I..C..C.P..P.C..C.\n..I..C....P..P.C....\n..I..C....PPP..C....\n..I..C....P....C....\n..I..C..C.P....C..C.\n.III..CC..P.....CC..\n....................\n..XX...XX...X...XX..\n.X..X.X..X..X..X..X.\n....X.X..X..X..X..X.\n...X..X..X..X..X..X.\n...X..X..X..X...XXX.\n..X...X..X..X.....X.\n..X...X..X..X.....X.\n.XXXX..XX...X...XX..\n....................\n....................\n((LDRU)1000(DLUR)2000(RULD)3000(URDL)4000)123456789012\n6\n...NE.\nMFJ..G\n...E..\n.FBN.K\n....MN\nRA.I..\n((((((((((((((((((((((((URD)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L\n0\n","output":"....\n..E.\n..D.\nBAC.\n....\n...E\n...D\n.BAC\n...\n..C\n.AB\n....P\nPPPPP\n..PPP\nPPPPP\n....P\n....................\n....................\n....................\n....................\n....................\nXXXX................\nPXXXX...............\nCXXXX...............\nXXXXX...............\nXXPCXX..............\nCCXXCX..............\nCXXXXX..............\nCXXXXX..............\nCPCIXXX.............\nCXPPCXX.............\nPCXXXIC.............\nCPPCCXI.............\nCXCIPXXX............\nXCPCICIXX...........\nPIPPICIXII..........\n......\n......\nN.....\nJNG...\nRMMKFE\nBEAIFN\n"},{"problem_id":"p01124","input":"5 3\n0 0\n2 0\n2 1\n1 2\n0 2\n0 0\n1 0\n0 1\n4 4\n0 0\n5 0\n5 5\n0 5\n0 0\n2 0\n2 2\n0 2\n3 3\n0 0\n1 0\n0 1\n0 1\n0 0\n1 1\n3 3\n0 0\n1 0\n1 1\n0 0\n1 0\n1 1\n4 4\n0 0\n2 0\n2 2\n0 2\n0 0\n1 0\n1 2\n0 2\n4 4\n0 0\n3 0\n3 1\n0 1\n0 0\n1 0\n1 1\n0 1\n0 0\n","output":"3\n2\n2\n1\n0\n2\n"},{"problem_id":"p01125","input":"2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 2\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 10\nS 10\nN 20\nE 10\nS 10\n0\n","output":"Yes\nNo\nNo\n"},{"problem_id":"p01126","input":"4 4 1\n3 1 2\n2 2 3\n3 3 4\n1 3 4\n0 0 0\n","output":"4\n"},{"problem_id":"p01127","input":"6\n1 1\n.\n3 3\n...\n.W.\n...\n10 10\n..........\n.DDDDCCC..\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA..CCC..\nAAABBBBC..\nAAABBBB...\n..BBBBB...\n..........\n10 10\n..........\n.DDDDDD...\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA..CCC..\nAAABBBBC..\nAAABBBB...\n..BBBBB...\n..........\n10 10\nR..E..C.T.\nR.EEE.C.T.\n.EEEEE....\nEEEEEEE...\n.EEEEEEE..\n..EEEEEEE.\n...EEEEEEE\n....EEEEE.\n.....EEE..\n......E...\n16 50\n..................................................\n.........AAAAAAAAAAAAAAAA.........................\n....PPP...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.....\n....PPP...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.....\n....PPP...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA....\n....PPP..............AAAAA.AAAAAAAAAAAAAAAA.......\n....PPP................A....AAA.AAAAAAAAAA........\n....PPP...........IIIIIAAIIAIII.AAAAAAAAAA........\n..CCCCCCCCCCCCC...IIIIIIAAAAAAAAAAAAAAAAAA........\n..CCCCCCCCCCCCC...IIIIIIIIIIIII...AAAAAAAAAA......\n....PPP............................AAAAAAAAAA.....\nMMMMPPPMMMMMMMMMMMMMMM.............AAAAAAAAAAA....\nMMMMPPPMMMMMMMMMMMMMMM..............AAAAAAAAAAA...\nMMMMMMMMMMMMMMMMMMMMMM...............AAAAAAAAAA...\nMMMMMMMMMMMMMMMMMMMMMM...............AAAAAAAAAA...\nMMMMMMMMMMMMMMMMMMMMMM............................\n","output":"SAFE\nSAFE\nSAFE\nSUSPICIOUS\nSUSPICIOUS\nSUSPICIOUS\n"},{"problem_id":"p01128","input":"2\n-10 1 10 1\n4\n-6 2 -2 -2 0 1\n-6 -2 -2 2 1 0\n6 2 2 -2 0 0\n6 -2 2 2 1 1\n8 12 -7 -3\n8\n4 -5 4 -2 1 1\n4 -2 4 9 1 0\n6 9 6 14 1 1\n-7 6 7 6 0 0\n1 0 1 10 0 0\n-5 0 -5 10 0 1\n-7 0 7 0 0 1\n-1 0 -1 -5 0 1\n","output":"1\n3\n"},{"problem_id":"p01129","input":"5 2\n5000\n10 20 0 30 5\n10 1000 6 1\n20 500 8 1\n3 40 25 30\n0 0\n","output":"50 84.000\n"},{"problem_id":"p01130","input":"4 5 1 3 4\n1 2 5\n2 3 5\n2 4 5\n1 3 8\n1 4 8\n0 0 0 0 0\n","output":"15\n"},{"problem_id":"p01131","input":"5\n20\n220\n222220\n44033055505550666011011111090666077705550301110\n000555555550000330000444000080000200004440000\n","output":"a\nb\nb\nhello, world!\nkeitai\n"},{"problem_id":"p01132","input":"160\n1 1 2 0\n160\n1 0 2 10\n0\n","output":"10 1\n50 1\n100 1\n\n10 1\n100 2\n"},{"problem_id":"p01133","input":"2 0 0 10 10\n1 1\n4 4\n2 0 0 10 10\n1 1\n6 6\n2 0 0 10 10\n1 1\n5 5\n0 0 0 0 0\n","output":"YES\nNO\nNO\n"},{"problem_id":"p01134","input":"2\n-100 -20 100 20\n-20 -100 20 100\n2\n-100 -20 -20 -100\n20 100 100 20\n0\n","output":"4\n3\n"},{"problem_id":"p01135","input":"4 5\n1 2 10\n1 3 15\n2 3 5\n2 4 3\n3 4 10\n2\n1 4 10 LoveLetter\n2 3 20 Greetings\n3 3\n1 2 1\n2 3 1\n3 1 1\n3\n1 2 1 BusinessMailC\n2 3 1 BusinessMailB\n3 1 1 BusinessMailA\n0 0\n","output":"Greetings 25\nLoveLetter 33\n\nBusinessMailA 2\nBusinessMailB 2\nBusinessMailC 2\n"},{"problem_id":"p01136","input":"4\n1 1\n2 2 3\n2 1 2\n3 3 4 5\n0\n","output":"3\n"},{"problem_id":"p01137","input":"1\n2\n4\n27\n300\n1250\n0\n","output":"1\n2\n2\n3\n18\n44\n"},{"problem_id":"p01138","input":"3\n05:47:15 09:54:40\n12:12:59 12:13:00\n16:30:20 21:18:53\n6\n00:00:00 03:00:00\n01:00:00 03:00:00\n02:00:00 03:00:00\n03:00:00 04:00:00\n03:00:00 05:00:00\n03:00:00 06:00:00\n0\n","output":"1\n3\n"},{"problem_id":"p01139","input":"10 10\n.....W....\n....W.W...\n...W...W..\n....W...W.\n.....W...W\n......W.W.\nBBB....W..\n..B..BBBBB\n..B..B....\n..B..B..W.\n5 3\n...B.\n...BB\n.....\n1 1\n.\n0 0\n","output":"6 21\n12 0\n0 0\n"},{"problem_id":"p01140","input":"3 3\n1\n1\n4\n2\n3\n1\n1 2\n10\n10\n10\n0 0\n","output":"6\n2\n"},{"problem_id":"p01141","input":"4\n0 0 10 0 10 10 0 10\n10\n12\n0 5\n9 5\n4\n0 0 10 0 10 10 0 10\n10\n12\n0 0\n9 1\n4\n0 0 10 0 10 10 0 10\n10\n12\n0 1\n9 1\n8\n2 0 4 0 6 2 6 4 4 6 2 6 0 4 0 2\n10\n12\n3 0\n3 5\n0\n","output":"108.0\n96.63324958071081\n103.2664991614216\n60.0\n"},{"problem_id":"p01142","input":"5 3\n#####\n#K.M#\n#####\n9 5\n#########\n#.....###\n#.###..M#\n#K#######\n#########\n9 5\n#########\n#K......#\n####.####\n####M####\n#########\n9 5\n#########\n#M......#\n####.####\n####K####\n#########\n7 9\n#######\n#####M#\n#####.#\n#.....#\n#.###.#\n#.....#\n#.#####\n#K#####\n#######\n7 6\n#######\n#####.#\n##....#\n#K..#.#\n###M#.#\n#######\n7 8\n#######\n##...##\n###.#M#\n#.....#\n#.#...#\n#.#..##\n#.K####\n#######\n9 6\n#########\n###..##.#\n##......#\n#K....#.#\n##..#M#.#\n#########\n9 6\n#########\n#.#######\n#....#M.#\n#.#...#.#\n###K#...#\n#########\n12 7\n############\n###...####.#\n##K#...M##.#\n##.....#...#\n#........#.#\n###..#...#.#\n############\n23 16\n#######################\n#########...###########\n##########.###.########\n##########.....########\n##########.#.#.###...##\n########.#.#.######.###\n########............###\n########.###.######.###\n############.######.###\n#K...........######.###\n####.#######.######.###\n####.#######.######.###\n####.................M#\n####.#######.##########\n###...#####...#########\n#######################\n46 16\n##############################################\n#..............#..############################\n#..#..........#.#.###....#...................#\n#.................###.#.#.#...............#..#\n#...#..#....#...#.###.#......................#\n#...#....#....#.#.###.#.#...#....#....#..#...#\n#.#........#..........#.#.#....#....#....#...#\n#...#...#.......###.#........#.........#...#.#\n#.#...#.........###.#..##.......#........#...#\n#...#........#..###.#..##.........#........#.#\n#...............###.#..##..#.........#...#...#\n############.######.#..##....................#\n###########K...........#.########.############\n###################...............M###########\n##################.......#####################\n##############################################\n0 0\n","output":"He can accomplish his mission.\nHe can accomplish his mission.\nHe cannot bring tea to his master.\nHe cannot return to the kitchen.\nHe can accomplish his mission.\nHe can accomplish his mission.\nHe cannot return to the kitchen.\nHe cannot return to the kitchen.\nHe can accomplish his mission.\nHe can accomplish his mission.\nHe cannot return to the kitchen.\nHe can accomplish his mission.\n"},{"problem_id":"p01143","input":"3 2 50\n1\n2\n3\n4 4 75\n1\n2\n3\n0\n3 1 10\n8\n1\n1\n0 0 0\n","output":"150\n0\n112\n"},{"problem_id":"p01144","input":"2 8\n5 6\n4 5\n3 1\n5 10\n5 10\n5 10\n0 0\n","output":"5\n140\n"},{"problem_id":"p01145","input":"kusa\nhaha\nhakata\nkippu\nsasakisan\nsosonokasu\nhottokouhii\ni\n#\n","output":"k(u)sa\nh(a)ha\nh(a)kata\nk(i)ppu\ns(a)sak(i)san\ns(o)sonokas(u)\nhott(o)kouhii\ni\n"},{"problem_id":"p01146","input":"2 1 0 1 0 1\n0 1 2\n3 1 1 2 0 1\n2\n0 2 1\n1 2 1\n3 2 1 2 0 1\n2\n0 2 1\n1 2 1\n4 4 1 4 1 3\n2\n0 1 2\n1 2 4\n0 2 1\n3 0 3\n5 3 2 6 0 3\n1 2\n2 1 2\n1 0 1\n3 4 1\n2 4 1\n4 1 2\n2 0 2\n5 4 2 6 0 3\n1 2\n4 2 4\n2 1 2\n4 3 1\n0 1 5\n1 4 2\n2 0 3\n0 0 0 0 0 0\n","output":"Help!\n3\n2\n10\n5\n12\n"},{"problem_id":"p01147","input":"4\napple\nlength\nthings\nthin\n2\nicp\ncpc\n3\nzeta\neta\nalphabet\n2\nuntil\ntill\n0\n","output":"applengthings\nicpc\nzetalphabet\nuntill\n"},{"problem_id":"p01148","input":"4 1 1\n1 1\n1 2\n-1 2\n-1 1\n2 1 0\n0 1 0 1 2\n0 0 0\n","output":"1\n1.000\n"},{"problem_id":"p01149","input":"4\n5 4\n9 2 8 3 7 4 6 5\nA J\nK Q J T 9 8 7 6\nT 4\n7 J A 6 Q T K 7\n2 2\n2 3 4 K 2 3 4 K\n","output":"18\nblackjack\n21\nbust\n"},{"problem_id":"p01150","input":"8\n16\n17\n0\n","output":"0\n0\n685440\n"},{"problem_id":"p01151","input":"5\n1 2 3 3 7\n4\n2 3 3 3\n0\n","output":"3 3 1 7 2\nNo\n"},{"problem_id":"p01152","input":"5\n3 C E G\n3 C E G#\n4 C A G E\n5 F A C E D\n3 C D E\n","output":"C Em(+5)\nC(+5) E(+5) G#(+5)\nC(13) Am7 Am(+13)\nDm7(9) FM7(13)\nUNKNOWN\n"},{"problem_id":"p01153","input":"2\n4 0 1 2 3\n6 1 8 0 3 5 9\n","output":"6\n34\n"},{"problem_id":"p01154","input":"4\n0 0\n2 0\n2 2\n0 2\n1 1\n6\n2 2\n2 5\n0 5\n0 0\n5 0\n5 2\n1 4\n0\n","output":"0.000\n3.000\n"},{"problem_id":"p01155","input":"33 40\n57 144\n0 0\n","output":"22\n94\n"},{"problem_id":"p01156","input":"8\nLightning\nGun\nPaper\nSponge\nWater\nDragon\nDevil\nAir\n3\nRock\nScissors\nPaper\n0\n","output":"Sponge\nDraw\n"},{"problem_id":"p01157","input":"3 2\n1 2 10\n3\n0 3420 o\n1 4589 o\n2 4638 x\n3\n1 6577 SUZUMIYA\n2 7644 SUZUMIYA\n0 19979 YASUZUMI\n4 2\n150 150 150 150\n4\n0 1344 HOGEHOGE\n1 1466 HOGEHOGE\n2 1789 HOGEHOGE\n3 19100 GEHO\n2\n2 1200 SETTEN\n3 700 SETTEN\n0 0\n","output":"177 57\n19 58\n19 57\n19 62\n\n253 70\n13 58\n13 58\n24 66\n20 71\n"},{"problem_id":"p01158","input":"3\ngu 20 pa 10\nci 20 gu 10\npa 20 ci 10\n2\ntool 20 tool 10\nproduct 1000 tool 10\n8\nfishhook  21 disk     3\nmill      14 axe      7\nboomerang 56 sundial 28\nflint     35 fishhook 5\naxe       35 flint   14\ndisk      42 disk     2\nsundial   14 disk     7\nhammer    28 mill     7\n0\n","output":"40\n30\n113\n"},{"problem_id":"p01159","input":"3 1\n0 0\n1 1\n2 0\n11 1.5\n0 0\n2 7\n5 3\n7 8\n10 -5\n13 4\n15 -1\n17 3\n20 -7\n23 9\n24 0\n0 0\n","output":"0.166666666666667\n165.213541666667\n"},{"problem_id":"p01160","input":"YMAOKDOAMIMHAADAMMA\nLELVEEL\n","output":"MADAMIMADAM\nLEVEL\n"},{"problem_id":"p01161","input":"4 4\n2 2 2\n2 2 2\n99 1 0\n1 99 1\n1 99 1\n1 99 1\n1 99 1\n1 99 1\n1 99 1\n99 1 0\n99 1 0\n1 99 1\n1 99 1\n1 99 1\n1 99 1\n1 99 1\n1 99 1\n99 1 0\n1 0\n1 6\n2 2\n10\n10\n5 5 0\n5 5 0\n5 5 0\n5 5 0\n5 0\n5 10\n0 0\n","output":"28\n25\n"},{"problem_id":"p01162","input":"4\n0 4 2 4\n0 2 2 0\n3 0 4 2\n6 2 6 0\n0\n","output":"8.0000\n"},{"problem_id":"p01163","input":"10\n12\n15\n777\n4999\n5000\n0\n","output":"0\n1\n2\n110\n2780\n0\n"},{"problem_id":"p01164","input":"4\nWBWB\nBWBW\n8\nWWWWBWBB\nWWBBWBWW\n0\n","output":"3\n9\n"},{"problem_id":"p01165","input":"5 1 1\n0 0 2 0\n1 1 2 1\n1 2 3 2\n1 0 1 2\n2 0 2 2\n0 0\n3 2\n2 1\n1 2\n2 1 1\n1 0 1 2\n0 1 2 1\n1 0\n0 1\n1 0\n2 1\n2 1 1\n1 0 1 2\n0 1 2 1\n1 0\n0 1\n1 2\n2 1\n4 1 1\n0 0 2 0\n1 1 3 1\n1 0 1 1\n2 0 2 1\n0 0\n3 1\n1 0\n2 1\n5 1 1\n0 0 2 0\n1 1 2 1\n1 2 3 2\n1 0 1 2\n2 0 2 2\n0 0\n3 2\n3 2\n0 0\n8 3 3\n1 1 3 1\n0 2 4 2\n1 3 5 3\n2 4 4 4\n1 1 1 3\n2 0 2 4\n3 1 3 5\n4 2 4 4\n0 2\n1 1\n2 0\n3 5\n4 4\n5 3\n3 5\n4 4\n5 3\n0 2\n1 1\n2 0\n0 0 0\n","output":"3\n1\n2\n2\n7\n18\n"},{"problem_id":"p01166","input":"3 1\n1 09:00 3 10:00\n3\n1 09:10\n2 09:30\n3 09:40\n3 2\n1 09:00 1 10:00\n3\n1 09:10\n2 09:30\n3 09:40\n3\n3 09:20\n2 09:30\n1 10:00\n1 0\n1 09:00 1 10:00\n1 0\n1 10:00 1 09:00\n3 1\n1 09:00 3 09:35\n3\n1 09:10\n2 09:30\n3 09:40\n4 3\n1 09:00 4 11:00\n3\n1 09:10\n2 09:20\n4 09:40\n3\n1 10:30\n3 10:40\n4 10:50\n4\n1 08:50\n2 09:30\n3 10:30\n4 11:10\n0 0\n","output":"30\n30\n0\nimpossible\nimpossible\n60\n"},{"problem_id":"p01167","input":"czujthebdgfoliskax\nbdgchuptzefliskaox\nfox\nfennec\noinarisama\nxiaorong\ncustomizedrevisedfoooox\naccurateredundantfooooooooox\nfox\n*\n","output":"cutefox\nImpossible\ncuteredfox\n"},{"problem_id":"p01168","input":"23 18 53\n46 30 47\n-1 -1 -1\n","output":"49\n-1\n"},{"problem_id":"p01169","input":"5 4\n0 0 20 0 20 10 0 10 1 5\n10 3 12 5 10 7 8 5\n10 5\n4 3\n0 0 10 0 10 5 0 5\n3 1 6 1 5 4\n0 0\n5 3\n0 0 10 0 10 10 0 10 3 5\n1 1 4 1 4 6\n0 0\n0 0\n","output":"360.0000000\n12.6803835\n3.3722867\n"},{"problem_id":"p01170","input":"2\n1.0 0.0\n0.5\n0.0 0.0 1\n2.0 0.0 -1\n2\n1.0 0.0\n0.5\n0.0 0.0 -1\n2.0 0.0 1\n0\n","output":"0.500000\nSAFE\n"},{"problem_id":"p01171","input":"10 15\n30 20\n0 0\n","output":"a\nb\n"},{"problem_id":"p01172","input":"1 3\n1 6\n3 5\n2 200\n25 99\n0 0\n","output":"0 1\n1 1\n1 0\n2 0\n0 2\n"},{"problem_id":"p01173","input":"3\n2 1\n0 0\n50 50\n100 0\n3\n1 1\n0 0\n50 50\n100 0\n3\n1 2\n0 0\n50 50\n100 0\n3\n2 1\n0 0\n100 100\n150 50\n6\n1 2\n0 0\n50 50\n100 0\n150 0\n200 50\n250 0\n0\n","output":"70.710678\n100.000000\n50.000000\n106.066017\n150.000000\n"},{"problem_id":"p01174","input":"3\n0.0 0.0\n1.0 1.0\n0.0 1.0\n3.0 3.0\n2.0 2.0\n3.0 2.0\n0\n","output":"3.14159265359\n"},{"problem_id":"p01175","input":"3\nR2R2\nR1R2R4R8R16R32R64\nR1R4R16\n","output":"R1\nR1......\nR16R1R4\n"},{"problem_id":"p01176","input":"2 1\n0 1\n0 0\n2 1\n0 0\n1 0\n3 3\n0 1 1\n0 0 1\n0 0 0\n3 3\n0 1 0\n0 0 0\n1 1 0\n3 1\n0 1 0\n0 0 0\n1 1 0\n3 3\n0 1 0\n0 0 1\n1 0 0\n6 4\n0 0 0 0 0 1\n1 0 1 0 1 0\n1 0 0 1 1 0\n1 1 0 0 1 0\n1 0 0 0 0 0\n0 1 1 1 1 0\n7 2\n0 1 0 0 0 1 0\n0 0 1 0 1 1 1\n1 0 0 1 1 0 0\n1 1 0 0 0 1 0\n1 0 0 1 0 0 1\n0 0 1 0 1 0 0\n1 0 1 1 0 1 0\n8 6\n0 0 0 0 1 0 0 0\n1 0 1 1 0 0 0 0\n1 0 0 0 1 0 0 0\n1 0 1 0 0 1 0 1\n0 1 0 1 0 0 1 0\n1 1 1 0 1 0 0 1\n1 1 1 1 0 1 0 0\n1 1 1 0 1 0 1 0\n0 0\n","output":"1\n0\n0\n3\n0\n1\n11\n139\n78\n"},{"problem_id":"p01177","input":"3 2 3\n10 2 1 2\n20 2 3 2\n1\n2\n3\n5 2 5\n10 3 1 2 4\n20 3 2 3 5\n1\n2\n3\n4\n5\n4 1 4\n10 2 1 4\n1\n2\n3\n4\n4 3 4\n30 2 1 4\n20 2 2 4\n10 2 3 4\n1\n2\n3\n4\n4 3 4\n10 2 1 4\n20 2 2 4\n30 2 3 4\n1\n2\n3\n4\n4 3 4\n10 2 1 2\n15 2 1 4\n20 2 2 3\n1\n2\n3\n4\n3 2 3\n10 2 2 3\n20 2 1 2\n1\n2\n3\n1 0 1\n1\n0 0 0\n","output":"1\n2\n3\n\n1\n2\n3\n5\n4\n\n1\n4\n2\n3\n\n1\n4\n2\n3\n\n1\n2\n3\n4\n\n1\n4\n2\n3\n\n1\n2\n3\n\n1\n"},{"problem_id":"p01178","input":"1 4 100\n7\n10 1 50 50\n15 2 50 50\n25 1 50 50\n35 3 50 50\n1 2 100\n5\n30 3 20 50\n40 4 40 50\n1 2 100\n5\n49 3 20 50\n60 4 50 30\n1 2 100\n5\n50 3 20 50\n60 4 50 30\n2 3 100\n4 2\n10 4 20 20\n30 2 20 20\n40 4 20 20\n0 0 0\n","output":"0.7428571428571429\n0.4285714285714285\n0.5542857142857143\n-0.1428571428571428\n0.8000000000000000\n"},{"problem_id":"p01179","input":"7\nC is A\u2019s father\u2019s brother\u2019s son\u2019s aunt\nC is A\u2019s mother\u2019s brother\u2019s son\u2019s aunt\nC is A\u2019s son\u2019s mother\u2019s mother\u2019s son\nC is A\u2019s aunt\u2019s niece\u2019s aunt\u2019s niece\nC is A\u2019s father\u2019s son\u2019s brother\nC is A\u2019s son\u2019s son\u2019s mother\nC is A\n","output":"5 3\n5 1\n2 2\n6 0\n2 0\n1 1\n0 0\n"},{"problem_id":"p01180","input":"4\n1.0 0.0 0.0\n1.5 0.0 3.0\n2.0 4.0 0.0\n1.0 3.0 4.0\n0\n","output":"0.5\n"},{"problem_id":"p01181","input":"3 1 6 8 10 7 0 0 2 5\n0 0 0 0 0 0 0 0 0 1\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n","output":"2\n362880\n"},{"problem_id":"p01182","input":"5 4\nRamen 3 10\nChahan 5 5\nGyoza 5 10\nRice 1 1\nSoup 1 1\n5 2 Ramen Gyoza\n10 6 Chahan Gyoza Soup Ramen Gyoza Rice\n20 1 Chahan\n25 1 Ramen\n0 0\n","output":"25\n42\n40\n35\n"},{"problem_id":"p01183","input":"7 1 2 2 2 2 2 2\n0\n","output":"0.942809\n"},{"problem_id":"p01184","input":"3 4\nEnglish\nFrench\nJapanese\n1 English\n2 French English\n2 Japanese English\n1 Japanese\n2 2\nEnglish\nJapanese\n1 English\n1 Japanese\n6 7\nEnglish\nDutch\nGerman\nFrench\nItalian\nSpanish\n1 English\n2 English Dutch\n2 Dutch German\n2 German French\n2 French Italian\n2 Italian Spanish\n1 Spanish\n0 0\n","output":"2\nEnglish\nJapanese\n\nImpossible\n\nImpossible\n"},{"problem_id":"p01185","input":"2\n0 0 3 3\n0 4 3 1\n1 1\n0\n","output":"4.243\n"},{"problem_id":"p01186","input":"4\nOmoikkiriTV 12:00 13:00 5 1\nWaratteIitomo 12:00 13:00 10 2\nWatarusekennhaOnibakari 20:00 21:00 10 3\nSuzumiyaharuhiNoYuuutsu 23:00 23:30 100 40\n5\na 0:00 1:00 100 100\nb 0:00 1:00 101 101\nc 0:00 1:00 102 102\nd 0:00 1:00 103 103\ne 0:00 1:00 104 104\n0\n","output":"121\n207\n"},{"problem_id":"p01187","input":"3\n3 1 3 5\n2 1 4\n4 1 2 3 6\n1 3\n0\n","output":"2\n"},{"problem_id":"p01188","input":"3\n10 30\n......#############...........\n....##_____________#..........\n...#________________####......\n..#________####_________#.....\n.#________#....##________#....\n#_________#......#________#...\n#__________###...#_____^^_#...\n.#__________A_#...#____^^_#...\n..#___________#...#_>__###....\n...###########.....####.......\n7 17\n......#..........\n.....#_##........\n.#...#_A_#.......\n#^####___#.......\n#_______#........\n#>_____#.........\n########.........\n6 5\n#####\n#_A_#\n#___#\n#_>_#\n#___#\n#####\n","output":"2\n1\n0\n"},{"problem_id":"p01189","input":"2\n0 -12 0 0 2\n0 0 12 0 2\n0\n","output":"39.14159\n"},{"problem_id":"p01190","input":"4\na list of A, B, C and D\na list of A, a list of P and Q, B, a list of X, Y and Z and C\na list of A\na list of a list of A and B\n","output":"(A B C D)\n(A (P Q) B (X Y Z) C)\n(A)\nAMBIGUOUS\n"},{"problem_id":"p01191","input":"2\n1 2\n1\n42 3.141592653589793\n5 20\n3\n0 307.09242465218927\n180 307.09242465218927\n90 728.30573874452591\n","output":"2.0 3.141592653589793\n8.660254038 5.235987756\n"},{"problem_id":"p01192","input":"3 1 5 25\n3 7 77 777\n4 1 8 27 64\n0\n","output":"Case #1: OK\nCase #2: Cannot pay some amount\nCase #3: Cannot use greedy algorithm\n"},{"problem_id":"p01193","input":"1+2+3+4+5+6+7+8+9+10=\n1000-500-250-125=\n1*2*3*4*5*6=\n5000*5000=\n10-100=\n100*100=\n10000=\n","output":"55\n125\n720\nE\nE\nE\nE\n"},{"problem_id":"p01194","input":"5 1\n2 1 3 2\n2 1 2 2\n0 0\n","output":"4.18\n"},{"problem_id":"p01195","input":"3\nphilosopher\u2019s-stone\n4 10\ntongue 1\ntear 1\ndunkelheit 1\naroma-materia 1\n\naroma-materia\n4 5\nsolt 1\nholy-water 1\ngolden-rock 1\nneutralizer 2\n\nneutralizer\n1 1\nred-rock 5\n\n7\ntongue 1\ntear 1\ndunkelheit 1\nsolt 2\nholy-water 3\ngolden-rock 2\nred-rock 10\n\n2\nphilosopher\u2019s-stone\n5 3\nninjin 1\njagaimo 3\ntamanegi 1\nbarmont 12\n\nbarmont\n3 1\ncurry 5\nkomugiko 20\nbatar 10\n\n7\nninjin 3\njagaimo 2\ntamanegi 5\ncurry 150\nkomugiko 750\nbatar 200\n\n0\n","output":"16\nimpossible\n"},{"problem_id":"p01196","input":"4 4\n3 3 5 3\n3 5 5 6\n4 4\n3 3 5 3\n3 5 5 5\n0 0\n","output":"4\nTOO MANY\n"},{"problem_id":"p01197","input":"2\n\n3 3\n0 2\n0 2 240 80\n0 1 130 60\n1 2 260 60\n\n3 3\n0 2\n0 2 180 60\n0 1 130 60\n1 2 260 60\n","output":"3.2500\n3.0000\n"},{"problem_id":"p01198","input":"1\n3\n2 4 6\n4\n10 100\n2 3\n10 6\n7 6\n","output":"crash\ntry again\ngood 1.000\nperfect\n"},{"problem_id":"p01199","input":"1 0 1\n51\n50\n2 1 1\n1 2 1\n1000 0\n0 1000\n4 3 5\n1 2 4\n1 3 1\n3 4 2\n0 1000 1000 1000\n3000 0 0 0\n","output":"50\n0\n3000\n"},{"problem_id":"p01200","input":"2 3\n10.00\n3 10 10 20 10 10 20\n4 30 10 40 10 40 20 30 20\n1.00 3 0 0 10 0 0 10\n0.50 4 20 15 25 15 25 20 20 20\n0.75 6 40 35 50 40 40 50 30 50 25 45 30 40\n4 1\n5.00\n3 0 0 24 0 0 24\n3 50 0 50 24 26 0\n3 0 50 0 26 24 50\n3 50 50 26 50 50 26\n1.00 4 25 0 50 25 25 50 0 25\n0 0\n","output":"35.4\n5.6\n\n133.3\n133.3\n133.3\n133.3\n"},{"problem_id":"p01201","input":"push 1\npush 2\nsqrt\ndiv\npush 1\npush 3\nsqrt\ndiv\nadd\ndisp\npush 8\nsqrt\npush 3\npush 2\nsqrt\nmul\nadd\ndisp\nstop\n","output":"1\/2*sqrt(2) + 1\/3*sqrt(3)\n5*sqrt(2)\n"},{"problem_id":"p01202","input":"3\nUU\nRDUL\nULDURDULDURDULDURDULDURD\n","output":"No\nYes\nYes\n"},{"problem_id":"p01203","input":"6 1\n2 1\n2 1\n2 1\n2 1\n2 1\n5 1\n1 1\n4 2\n0 0\n","output":"2\nImpossible\n"},{"problem_id":"p01204","input":"2\n0 0 0 0 2 0\n0 0 1 0 0 -1\n2 0 0 0 2 0\n3\n0 5 0 3 1 4\n0 1 0 0 -1 0\n1 0 1 -1 0 1\n3 1 -1 3 1 1\n2\n0 0 0 3 0 0\n0 0 0 0 1 0\n3 0 0 3 1 0\n0\n","output":"1.414\n2.000\n3.000\n"},{"problem_id":"p01205","input":"4 4\n4 3 2 2\n4 4\n4 3 2 3\n0 0\n","output":"1111001\nGoofy\n"},{"problem_id":"p01206","input":"4 4 1 1\n2 2 2 2\n2 1 1 2\n2 1 1 2\n2 1 2 2\n1 1\n4 4 1 1\n2 2 2 2\n2 1 1 2\n2 1 1 2\n2 1 2 2\n2 2\n4 4 1 1\n2 2 2 2\n2 1 1 2\n2 1 1 2\n2 1 1 2\n1 1\n3 6 6 1\n1 6 7 1 7 1\n5 1 2 8 1 6\n1 4 3 1 5 1\n1 4\n5 6 21 1\n1 3 3 3 3 1\n3 1 1 1 1 3\n3 1 1 3 2 2\n3 1 1 1 1 3\n1 3 3 3 3 1\n3 4\n0 0 0 0\n","output":"Yes\nNo\nNo\nNo\nYes\n"},{"problem_id":"p01207","input":"2\n1234 3 0\n1245 3 0\n1\n1234 0 0\n2\n0123 0 4\n1230 0 4\n0\n","output":"1235\n????\n0132\n"},{"problem_id":"p01208","input":"2 1\nKarasumaKitaoji 0 6150\nKarasumaNanajo 0 0\nKarasumaNanajo KarasumaKitaoji\nKarasumaKitaoji KarasumaNanajo\n3 2\nKujoOmiya 0 0\nKujoAburanokoji 400 0\nOmiyaNanajo 0 1150\nKujoOmiya KujoAburanokoji\nKujoOmiya OmiyaNanajo\nKujoAburanokoji OmiyaNanajo\n10 12\nKarasumaGojo 745 0\nHorikawaShijo 0 870\nShijoKarasuma 745 870\nShijoKawaramachi 1645 870\nHorikawaOike 0 1700\nKarasumaOike 745 1700\nKawaramachiOike 1645 1700\nKawabataOike 1945 1700\nKarasumaMarutamachi 745 2445\nKawaramachiMarutamachi 1645 2445\nKarasumaGojo ShijoKarasuma\nHorikawaShijo ShijoKarasuma\nShijoKarasuma ShijoKawaramachi\nHorikawaShijo HorikawaOike\nShijoKarasuma KarasumaOike\nShijoKawaramachi KawaramachiOike\nHorikawaOike KarasumaOike\nKarasumaOike KawaramachiOike\nKawaramachiOike KawabataOike\nKarasumaOike KarasumaMarutamachi\nKawaramachiOike KawaramachiMarutamachi\nKarasumaMarutamachi KawaramachiMarutamachi\nKarasumaGojo KawabataOike\n8 9\nNishikojiNanajo 0 0\nNishiojiNanajo 750 0\nNishikojiGojo 0 800\nNishiojiGojo 750 800\nHorikawaGojo 2550 800\nNishiojiShijo 750 1700\nEnmachi 750 3250\nHorikawaMarutamachi 2550 3250\nNishikojiNanajo NishiojiNanajo\nNishikojiNanajo NishikojiGojo\nNishiojiNanajo NishiojiGojo\nNishikojiGojo NishiojiGojo\nNishiojiGojo HorikawaGojo\nNishiojiGojo NishiojiShijo\nHorikawaGojo HorikawaMarutamachi\nNishiojiShijo Enmachi\nEnmachi HorikawaMarutamachi\nHorikawaGojo NishiojiShijo\n0 0\n","output":"2\nimpossible\n13\n4\n"},{"problem_id":"p01209","input":"10 500\n16 A\n0 0\n","output":"124\n2\n"},{"problem_id":"p01210","input":"1\nSA\n1\nC2\n2\nSA HA\n2\nC2 C3\n5\nS3 S5 S8 S9 S2\n3\nH7 H3 H4\n10\nH7 CJ C5 CA C6 S2 D8 DA S6 HK\n10\nC2 D6 D4 H5 DJ CX S8 S9 D3 D5\n0\n","output":"A wins.\nB wins.\nB wins.\nA wins.\n"},{"problem_id":"p01211","input":"3 2 1\n3 2 0\n0 0 0\n","output":"13.36\n6.28\n"},{"problem_id":"p01212","input":"8 3\n########\n#<A.@.a#\n########\n8 3\n########\n#<AaAa@#\n########\n8 4\n########\n#<EeEe@#\n#FG.e#.#\n########\n8 8\n########\n#mmm@ZZ#\n#mAAAbZ#\n#mABBBZ#\n#mABCCd#\n#aABCDD#\n#ZZcCD<#\n########\n0 0\n","output":"7\n-1\n7\n27\n"},{"problem_id":"p01213","input":"ABCABCABAB\nZZZZZZZZZZZZ\n#END\n","output":"ABAB\nZZZZZZ\n"},{"problem_id":"p01214","input":"5\n4 4\n....\n....\n####\n....\n12 8\n........\n........\n........\n........\n........\n.......#\n##.##..#\n.#######\n.#######\n.#######\n.#######\n.####.#.\n4 4\n....\n....\n.###\n...#\n12 8\n........\n........\n........\n........\n........\n........\n........\n##...###\n##.#####\n#######.\n#######.\n#######.\n4 4\n####\n#..#\n#..#\n####\n12 8\n........\n........\n........\n........\n........\n.......#\n##.##..#\n##....##\n##.##.##\n##.##.##\n##....##\n.####.#.\n2 2\n##\n#.\n3 3\n.##\n.##\n##.\n4 4\n....\n.##.\n.##.\n....\n2 2\n..\n..\n","output":"4\n1\n4\n-1\n2\n"},{"problem_id":"p01215","input":"3\n1\n120 1000\n100 100 180 20\n170 10 270 30\n270 40 400 20\n0\n","output":"403.87458314\n"},{"problem_id":"p01216","input":"8 3\nA 6 9000\na1\na2\na3\na4\na5\na6\nB 6 8000\nb1\nb2\nb3\nb4\nb5\nb6\nC 4 3000\nc1\nc2\nc3\nc4\n2\na7 A 2000\nb2 B 4000\n3\na8 A 1500\nc3 C 500\nb1 B 1000\n2\nc2 C 2328\na3 A 2327\n2\nb5 B 2345\nc5 C 4000\n43\nA 3 2500\na1\na2\na3\nB 3 1500\nb1\nb2\nb3\nC 1 150\nc1\n2\na4 A 1500\nb4 B 1000\n2\na5 A 700\nb5 B 800\n0 0\n","output":"a1\na2\na3\na8\nb1\nb2\nb3\nc2\nc5\n\na1\na2\na4\nb5\n"},{"problem_id":"p01217","input":"1\n2\n3\n4\n0\n","output":"6\n30\n30\n6\n"},{"problem_id":"p01218","input":"1 1\n0 0 0\n4 4\n0 0 0\n1 1 1\n2 2 2\n3 3 3\n3 4\n0 0 0\n1 1 1\n2 2 2\n4 1\n1 0 1\n0 0 0\n1 1 0\n0 1 -1\n5 2\n0 0 100\n0 0 99\n1 0 99\n1 0 98\n1 0 -100\n7 4\n71 55 -77\n-43 -49 50\n73 -22 -89\n32 99 -33\n64 -22 -25\n-76 -1 6\n39 4 23\n0 0\n","output":"0\n0\n0\n-1\n200\n197.671366737338417\n"},{"problem_id":"p01219","input":"2 2\n6 3\nMonday Tuesday Wednesday\n8 4\nThursday Friday Saturday Sunday\n2 2\n7 3\nMonday Tuesday Wednesday\n9 4\nThursday Friday Saturday Sunday\n0 0\n","output":"Yes\nNo\n"},{"problem_id":"p01220","input":"1\n2\n3\n4\n5\n6\n0\n","output":"0.433013\n0.577350\n0.433013\n0.732051\n0.776798\n0.577350\n"},{"problem_id":"p01221","input":"14\nVAR ga;\nVAR gb;\nIF(ga > gb) {\n  VAR saa;\n  VAR sab;\n  IF(saa > ga) {\n    saa = sab;\n  }\n}\nWHILE(gb > ga) {\n  VAR sba;\n  sba = ga;\n  ga = gb;\n}\n7\nVAR thisisthelongest;\nIF(thisisthelongest \/ 0) {\n  VARone;\n  one = thisisthelongest + 1234567890123456789012345;\n}\nVAR another;\n32 = another;\n0\n","output":"73\n59\n"},{"problem_id":"p01222","input":"1 1\n4 10 0 0 10 0 10 10 0 10\n-5 -20 30 15\n135 45\n0 -15 15 0\n0 0\n","output":"11.213\n"},{"problem_id":"p01223","input":"5\n5\n10 70 30 50 90\n2\n20 100\n2\n100 30\n3\n50 50 50\n7\n123 45 678 901 234 567 890\n","output":"60 40\n80 0\n0 70\n0 0\n633 667\n"},{"problem_id":"p01224","input":"1\n2\n3\n4\n6\n12\n16\n28\n33550336\n99999998\n99999999\n100000000\n0\n","output":"deficient number\ndeficient number\ndeficient number\ndeficient number\nperfect number\nabundant number\ndeficient number\nperfect number\nperfect number\ndeficient number\ndeficient number\nabundant number\n"},{"problem_id":"p01225","input":"5\n1 2 3 3 4 5 7 7 7\nR R R R R R G G G\n1 2 2 3 4 4 4 4 5\nR R R R R R R R R\n1 2 3 4 4 4 5 5 5\nR R B R R R R R R\n1 1 1 3 4 5 6 6 6\nR R B G G G R R R\n2 2 2 3 3 3 1 1 1\nR G B R G B R G B\n","output":"1\n0\n0\n0\n1\n"},{"problem_id":"p01226","input":"4\n4 6\n*.*..*\n*.....\n..-...\n^.*#..\n10\nSRSSRRUSSR\n2 2\n<.\n..\n12\nDDSRRSUUSLLS\n3 5\n>-#**\n.-*#*\n.-**#\n15\nSSSDRSSSDRSSSUU\n5 5\nv****\n*****\n*****\n*****\n*****\n44\nSSSSDDRSDRSRDSULUURSSSSRRRRDSSSSDDLSDLSDLSSD\n","output":"*....*\n......\n..-...\n..>#..\n\n<.\n..\n\n^-#**\n.-.#*\n.-..#\n\n.....\n.***.\n..*..\n..*..\n....v\n"},{"problem_id":"p01227","input":"6\n5 2\n10 30 40 70 100\n7 3\n3 6 10 17 21 26 28\n1 1\n100\n2 1\n0 1000000\n3 5\n30 70 150\n6 4\n0 10 20 30 40 50\n","output":"60\n13\n0\n1000000\n0\n20\n"},{"problem_id":"p01228","input":"5\n2\n01000100\n00020202\n2\n0102\n00000810\n1\n0200020008000200\n5\n0001\n000001\n0000000001\n00000000000001\n0000000000000000000001\n1\n000000\n","output":"01020302\n01000A10\n02020802\nToo complex.\n00\n"},{"problem_id":"p01229","input":"7\n1\n2\n2\n1 2\n3\n4 1 4\n3\n4 0 4\n5\n4 1 4 0 4\n5\n4 1 4 1 4\n5\n4 2 4 0 4\n","output":"2\n2\n8\n4\n7\n12\n11\n"},{"problem_id":"p01230","input":"2 1 1\n1 2\n2 1 2\n1 2\n3 1 2\n1 2\n8 8 5778\n1 2\n2 3\n2 4\n3 5\n5 6\n6 7\n7 8\n4 8\n8 8 5777\n1 2\n2 3\n2 4\n3 5\n5 6\n6 7\n7 8\n4 8\n0 0 0\n","output":"yes\nno\nno\nyes\nno\n"},{"problem_id":"p01231","input":"6\n8\n0 1 0 0 0 0 0 0\n1 0 1 0 0 0 0 0\n0 1 0 1 1 0 0 0\n0 0 1 0 0 0 0 0\n0 0 1 0 0 1 1 0\n0 0 0 0 1 0 0 0\n0 0 0 0 1 0 0 1\n0 0 0 0 0 0 1 0\n3 0\n4\n0 1 1 0\n1 0 0 1\n1 0 0 1\n0 1 1 0\n1 0\n5\n0 1 0 1 0\n1 0 0 1 0\n0 0 0 0 1\n1 1 0 0 0\n0 0 1 0 0\n2 0\n5\n0 1 0 0 1\n1 0 1 1 1\n0 1 0 1 0\n0 1 1 0 1\n1 1 0 1 0\n2 4\n5\n0 1 0 1 0\n1 0 1 1 0\n0 1 0 0 1\n1 1 0 0 1\n0 0 1 1 0\n3 0\n5\n0 1 0 1 1\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n1 1 0 1 0\n0 4\n","output":"5\ninfinity\ninfinity\n2\ninfinity\n1\n"},{"problem_id":"p01232","input":"2\n3\nR 1 =\nL 2 + -\nL 2 * \/\n6\na+b*c-d\n(p-q)\/q\/d\na+b*c=d-e\nt+t+t+t+t\ns=s=s=s=s\n(((((z)))))\n3\nR 3 = < >\nL 3 & | ^\nL 4 + - * \/\n1\na>b*c=d<e|f+g^h&i<j>k\n","output":"((a+(b*c))-d)\n(((p-q)\/q)\/d)\n((a+(b*c))=(d-e))\n((((t+t)+t)+t)+t)\n(s=(s=(s=(s=s))))\nz\n\n(a>((b*c)=(d<((((e|(f+g))^h)&i)<(j>k)))))\n"},{"problem_id":"p01233","input":"4\n0 1 3 2 0 1\n1 1 2 2 9 9\n0 0 1 4 5 5\n0 0 1 4 5 10\n","output":"0\n1\n2\n3\n"},{"problem_id":"p01234","input":"2\n150 1 50 30 50\n100 1 20 30 40\n","output":"Case 1:\nFire at 37.995392 degree(s).\nProjectile destroyed in 2.290123 second(s).\n\nCase 2:\nProjectile reaches the land.\n"},{"problem_id":"p01235","input":"2\n2 1 2 2\n0 0 1 0\n0 1 0 2\n0\n","output":"Case 1: 3.00000\n"},{"problem_id":"p01236","input":"5 5\n#####\n#####\n#####\n#####\n#####\n4 4\n####\n####\n####\n####\n4 4\n#...\n....\n....\n...#\n4 4\n.#.#\n#.#.\n.#.#\n#.#.\n0 0\n","output":"Case 1: 10\nCase 2: 6\nCase 3: 2\nCase 4: Impossible\n"},{"problem_id":"p01237","input":"3 3 1\n1 0 0\n0 0 0 0\n0 0 0 0 0\n0 0 0 0\n0 0 1\n3 3 2\n1 0 0\n0 0 0 0\n0 0 0 0 0\n0 0 0 0\n0 0 1\n0 0 0\n","output":"Case 1: 8\nCase 2: 18\n"},{"problem_id":"p01238","input":"1\n2\n0\n","output":"Case 1: 3 2\nCase 2: 2 1\n"},{"problem_id":"p01239","input":"4\n0 1 0 9\n10 1 10 9\n1 0 9 0\n1 10 9 10\n2\n1.2 3.4 5.6 7.8\n5.6 3.4 1.2 7.8\n0\n","output":"Case 1: 36.24264\nCase 2: 16.84508\n"},{"problem_id":"p01240","input":"2\n2 2\n2 3\n3 5\n3 2\n4 1 1\n2 1 4\n","output":"Case 1: 7\nCase 2: 8\n"},{"problem_id":"p01241","input":"2 1\n10 5\n15 10\n0 0\n","output":"Case 1: 1\nCase 2: 11\nCase 3: 210\n"},{"problem_id":"p01242","input":"4 3\nooxx\nooxx\nooxx\n4 1\nnull\n4 4\naabb\naabb\nccdd\nccdd\n0 0\n","output":"Case 1:\no 0 0\nx 2 0\nCase 2:\nl 2 0\nn 0 0\nu 1 0\nCase 3:\na 0 0\nb 2 0\nc 0 2\nd 2 2\n"},{"problem_id":"p01243","input":"5 4\n0 0\n4 0\n4 4\n2 2\n0 4\n8 80\n45 41\n70 31\n86 61\n72 64\n80 79\n40 80\n8 94\n28 22\n0 0\n","output":"case 1: 16.0\ncase 2: 3375.0\n"},{"problem_id":"p01244","input":"1\n2\n3\n10\n50\n0\n","output":"1.000000\n1.500000\n1.500000\n2.000000\n2.583333\n"},{"problem_id":"p01245","input":"7 8\n0 2 3\n2 3 -20\n3 4 3\n4 1 -5\n1 5 1\n5 4 5\n1 3 2\n3 6 -2\n0 6 30\n7 8\n0 2 3\n2 3 -20\n3 4 3\n4 1 -5\n1 5 1\n5 4 5\n1 3 2\n3 6 -2\n0 6 20\n4 4\n0 1 -10\n1 2 -50\n2 1 51\n1 3 1\n0 3 20\n11 14\n0 1 -49\n1 2 1\n2 3 40\n3 1 -40\n1 4 -9\n4 5 40\n5 1 -30\n1 6 -19\n6 7 40\n7 1 -20\n1 8 -30\n8 9 40\n9 1 -9\n1 10 1\n0 10 50\n3 4\n0 1 -49\n1 2 10\n2 0 50\n2 1 10\n0 1 50\n0 0\n","output":"Case 1: 25\nCase 2: GAME OVER\nCase 3: 11\nCase 4: 31\nCase 5: 1\n"},{"problem_id":"p01246","input":"8\n1 0\n2 0\n3 1\n3 2\n2 3\n1 3\n0 2\n0 1\n1 2 3 4 5 6 7 8\n8\n1 0\n2 0\n3 1\n3 2\n2 3\n1 3\n0 2\n0 1\n4 3 2 1 8 7 6 5\n4\n0 0\n1 0\n1 1\n0 1\n1 2 3 4\n0\n","output":"Case 1: 10.00000\nCase 2: No area\nCase 3: Infinity\n"},{"problem_id":"p01247","input":"3\n0.7 0.1 0.2\n0.1 0.8 0.1\n0.0 0.0 1.0\n4 3 2\n8\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125\n2 2 2 2 2 2 2 2\n2\n1 0\n1 0\n2 2\n0\n","output":"Case 1: -1.89723999\nCase 2: -8.14438201\nCase 3: -INFINITY\n"},{"problem_id":"p01248","input":"4 10\n8\n6\n9\n1\n4 7\n1\n2\n3\n4\n0 0\n","output":"Case 1: 4\nCase 2: 1\n"},{"problem_id":"p01249","input":"3\nbillion 9\nmillion 6\nthousand 3\nbillionmillionthousand\n3\noku 8\nsen 3\nman 4\nokusenman\n2\nnico 2\nvideo 4\nniconicovideo\n6\nabcd 1\nefgh 2\nabcde 4\nfgh 6\ny 8\nyy 10\nabcdefgh\n0\n","output":"Case 1: 14\nCase 2: 9\nCase 3: 10\nCase 4: 2\n"},{"problem_id":"p01250","input":"0.15\n0.05\n0.0\n","output":"3\/1\n19\/6\n"},{"problem_id":"p01251","input":"3 3 3\n1 0 1 2\n1 2 2 2\n2 2 2 1\n0 0 1 0 1 1\n3 3 4\n1 0 1 2\n1 2 2 2\n2 2 2 1\n2 1 1 1\n0 0 1 0 1 1\n3 3 0\n0 0 1 0 1 1\n0 0 0\n","output":"9\nImpossible\nImpossible\n"},{"problem_id":"p01252","input":"1\n3 3 7 7\n2 2 8 2\n2\n2 5 5 9\n6 1 9 5\n1 5 10 5\n2\n2 1 3 2\n2 3 3 4\n1 1 4 4\n1\n3 3 7 7\n1 5 9 5\n1\n3 3 7 7\n1 5 8 5\n1\n3 3 7 7\n1 5 10 5\n0\n","output":"0.000\n0.000\n0.000\n5.657\n6.406\n4.992\n"},{"problem_id":"p01253","input":"6 1\nRBRBRB\n10 1\nRBBBRBBBBB\n10 2\nRBBBRBBBBB\n10 10\nRBBBBBBBBB\n0 0\n","output":"0.50000000\n0.33333333\n0.22222222\n0.10025221\n"},{"problem_id":"p01254","input":"4\n1 4\n4\n1 2\n2 3\n3 4\n4 1\n0\n","output":"1 4\n"},{"problem_id":"p01255","input":"2\n2\n0 0\n10 0\n2\n0 10\n10 10\n2\n2\n0 0\n10 10\n2\n0 10\n10 0\n3\n2\n0 0\n10 10\n2\n0 10\n10 0\n2\n1 0\n1 10\n0\n","output":"1\n2\n3\n"},{"problem_id":"p01256","input":"7 6\n#######\n#.._..#\n#.*.*.#\n#.@.*.#\n#_..._#\n#######\n10 13\n##########\n####___###\n####...###\n####...###\n#####.####\n#.....#..#\n#.#*.*.*.#\n#...###..#\n###.#.#.##\n###.#.#.##\n###.....##\n###..@..##\n##########\n0 0\n","output":"15\n118\n"},{"problem_id":"p01257","input":"6 330\n1 5 10 50 100 500\n7 127\n1 2 4 8 16 32 64\n2 10000\n1000 2000\n0 0\n","output":"2\n1\n4\n"},{"problem_id":"p01258","input":"2\n4\n6\n8\n10\n52\n0\n","output":"0.0000000000\n0.6666666667\n1.3333333333\n1.9238095238\n2.5523809524\n15.4435236099\n"},{"problem_id":"p01259","input":"4\n3 1 2 3\n1 1 0 1\n2 0 2 2\n3 1 2 3\n5\n3 3 3 0 0\n3 3 3 0 0\n3 3 0 4 4\n0 0 4 4 4\n0 0 4 4 4\n0\n","output":"1 0 0 0\n0 0 0 0\n0 0 0 0\n0 0 0 2\n\n0 0 0 0 0\n0 3 0 0 0\n0 0 0 0 0\n0 0 0 4 0\n0 0 0 0 0\n"},{"problem_id":"p01260","input":"6\n1 GB\n3 GBGBBB\n9 BBBGBBBGGG\n9 GGBGBBGBBB\n7 GBGGGGBGGG\n3 BBBBBGBBBB\n","output":"1\n4\n4\n1\n0\n8\n"},{"problem_id":"p01261","input":"3 3\n3 5\n0 0\n","output":"010\n011\n"},{"problem_id":"p01262","input":"5 2 1\n0.1 0.2 0.3 0.4 0.5\n6 2 2\n0.1 0.2 0.3 0.4 0.5 0.6\n0 0 0\n","output":"0.01\n0.00\n"},{"problem_id":"p01263","input":"2 2\n1 1\n1 1\n4\nA 10\nB 20\nC 30\nD 40\n4\n1 1 3 A A A\n1 2 2 B C\n2 1 1 D\n2 2 3 A A B\n2 2\n1 2\n2 1\n3\nScroll 50\nBastard 100\nHeal100 10\n3\n1 1 1 Scroll\n2 1 1 Bastard\n2 2 1 Heal100\n0 0\n","output":"90\n200\n"},{"problem_id":"p01264","input":"1 1 1\n10 15 5\n15 10 100\n0 0 0\n","output":"8.000\n409.479\n861.420\n"},{"problem_id":"p01265","input":"6 23\n#######################\n#%.^.^#################\n#^^^^^######^^^^^^^^^^#\n#^^^...^^^^...^^*^^..*#\n#^^^^^^^^^^^^^^^^^^^^^#\n#######################\n5 16\n################\n#^^^^^^^^^^^^^^#\n#*..^^^.%.^^..*#\n#^^#####^^^^^^^#\n################\n0 0\n","output":"1 44\n2 28\n"},{"problem_id":"p01266","input":"4 2\n2 0 0 1\n0 4 1 0\n4 6 0 -1\n6 2 -1 0\n4 6\n2 0 0 1\n0 4 1 0\n4 6 0 -1\n6 2 -1 0\n0 0\n","output":"6.00000000\n4.24264069\n"},{"problem_id":"p01267","input":"1 5 7 11 10\n10\n2 5 7 11 10\n2 4\n2 1 1 256 0\n128 255\n2 0 0 1 0\n1234 5678\n2 1 1 100 0\n99 98\n2 1 1 100 0\n99 99\n2 1 1 10000 0\n1 0\n2 1 1 10000 0\n2 1\n0 0 0 0 0\n","output":"0\n3\n255\n-1\n198\n199\n10000\n-1\n"},{"problem_id":"p01268","input":"0 55\n0 1\n0 2\n0 3\n10 1\n10 2\n10 3\n10 4\n10 5\n10 6\n11 1\n11 2\n11 3\n100000 100\n-1 -1\n","output":"42\n4\n5\n6\n22\n24\n26\n28\n30\n30\n26\n30\n32\n200274\n"},{"problem_id":"p01269","input":"3 2 10\n1 2 8 6\n2 3 10 3\n3 2 10\n1 2 3 8\n2 3 7 7\n3 3 10\n1 3 17 6\n1 2 2 4\n2 3 9 13\n4 4 5\n1 3 9 3\n1 4 7 25\n2 3 8 2\n2 4 9 3\n0 0 0\n","output":"3\n0\n4\n8\n"},{"problem_id":"p01270","input":"6\nW 0 2\nW 1 2\nD 0\nW 2 4\nR 3\nR 1\n1\nR 1000000000\n0\n","output":"1\n2\n\n-1\n"},{"problem_id":"p01271","input":"5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .%.\n4 1\nL.%. %..R\n0 0\n","output":"Yes\nYes\nNo\n"},{"problem_id":"p01272","input":"3 1\n0 0\n10 0\n5 10\n3 1\n0 0\n10 0\n0 10\n4 1\n0 0\n10 0\n10 10\n0 10\n0 0\n","output":"22.6524758425\n23.8994949366\n32.0000000000\n"},{"problem_id":"p01273","input":"3 2\n1 1 2\n2 2 3\n3 2\n2 3 2\n1 2 1\n0 0\n","output":"3\n1\n"},{"problem_id":"p01274","input":"3\n8000 15000 30000\n3\nFlare 45 Single 8000\nMeteor 62 All 6000\nUltimate 80 All 9999\n0\n","output":"232\n"},{"problem_id":"p01275","input":"4\n1357 4680\n6\n777777 003330\n0\n","output":"1\n2\n"},{"problem_id":"p01276","input":"5\n5 5\n4 4\n3 3\n2 2\n1 1\n5\n1 5\n3 4\n2 5\n2 3\n1 4\n8\n8 3\n4 2\n6 4\n3 5\n5 8\n7 1\n2 6\n1 7\n0\n","output":"15\n9\n21\n"},{"problem_id":"p01277","input":"4\n0 1\n1 0\n0 0\n1 1\n","output":"Yes\n"},{"problem_id":"p01278","input":"3 3\n0 0\n8 0\n0 8\n2 2\n4 2\n2 4\n0 0\n","output":"9.0\n11.5\n11.5\n"},{"problem_id":"p01279","input":"2 2\n10 20 1\n0 10 1\n0 10\n10 0\n0 0\n","output":"14.14213562\n"},{"problem_id":"p01280","input":"2\n4 0 1 2 3 4\n2 0 2 1\n0\n","output":"5\n"},{"problem_id":"p01281","input":"3 4\n4 4\n0 0\n","output":"4\n2\n"},{"problem_id":"p01282","input":"3 1\n3 2\n3 3\n4 2\n10 5\n1000 500\n0 0\n","output":"0\n2\n4\n2\n90\n570682\n"},{"problem_id":"p01283","input":"5\n5 4 3 2 1\n5\n7 7 7 7 7\n10\n186 8 42 24 154 40 10 56 122 72\n0\n","output":"0 1 1\n0 0 0\n8 7 14\n"},{"problem_id":"p01284","input":"2\n1 23\n3\n1 1\n2 1\n3 1\n0\n","output":"2\n"},{"problem_id":"p01285","input":"2\n-35 -35 100 100\n-49 49 2000 -2000\n4\n0 0 0 3\n0 0 3 0\n0 3 3 3\n3 0 3 3\n4\n0 3 -4 6\n3 0 6 -4\n2 3 6 6\n-1 2 -4 6\n0\n","output":"Many\n1.5000 1.5000\n1.000 1.000\n"},{"problem_id":"p01286","input":"2 1 1 1 1 1 1\n1 1\n1 1\n1 1\n1 1 1 1 0 0 0\n1 1\n1 1\n1 1\n1 0 1 0 1 0 1\n0\n1 1 0 1 0 1 0\n0\n0\n1 1 0 1 0 1 0\n1 1\n0\n-1 -1 -1 -1 -1 -1 -1\n","output":"2\n1\n1\n0\n1\n"},{"problem_id":"p01287","input":"blue blue blue blue blue blue blue blue\nred blue blue blue blue blue blue blue\nred red blue blue blue blue blue blue\n","output":"1\n1\n3\n"},{"problem_id":"p01288","input":"6 3\n1\n1\n2\n3\n3\nQ 5\nM 3\nQ 5\n0 0\n","output":"4\n"},{"problem_id":"p01289","input":"5 1 5\n1 0 1 0 0\n0 2 1 0 0\n2 0 0 1 0\n1 0 0 1 0\n0 1 1 0 1\n0 0 0 1 0\n0 0 0\n","output":"8.50000000\n"},{"problem_id":"p01290","input":"2 2\nQE\nEA\n3 1\nQAE\n3 1\nAQE\n5 5\n..E..\n.###.\nA###Q\n.###.\n..E..\n5 1\nA.E.Q\n5 5\nA....\n####.\n..E..\n.####\n....Q\n0 0\n","output":"Queen can not escape and Army can not catch Queen.\nArmy can catch Queen.\nQueen can escape.\nQueen can not escape and Army can not catch Queen.\nArmy can catch Queen.\nArmy can catch Queen.\n"},{"problem_id":"p01291","input":"5 2\n4\n1 1\n1 2\n2 2\n2 1\n4\n3 3\n3 4\n4 4\n4 3\n0 0\n","output":"3.41421356\n"},{"problem_id":"p01292","input":"50 100\n2\n50 50 0\n51 51 50\n2\n0 0 0\n1 1 50\n0\n0 0\n","output":"50\n"},{"problem_id":"p01293","input":"H\n4C 8H QS 5D JD KS 8S AH 6H 7H 3S 7S 6D\nTC JC JS KD AC QC QD 2H QH 3H 3C 7C 4D\n6C 9C AS TD 5H 6S 5S KH TH AD 9S 8D 2D\n8C 5C 2S 7D KC 4S TS JH 4H 9H 2C 9D 3D\nD\n8D 9D 9S QS 4H 5H JD JS 9H 6S TH 6H QH\nQD 9C 5S 7S 7H AC 2D KD 6C 3D 8C TC 7C\n5D QC 3S 4S 3H 3C 6D KS JC AS 5C 8H TS\n4D 4C 8S 2S 2H KC TD JH 2C AH 7D AD KH\n#\n","output":"EW 1\nEW 2\n"},{"problem_id":"p01294","input":"3 3\n3 4 1 1\n2 1 5\n2 3 3\n3 3\n3 2 3 1\n2 1 5\n2 3 3\n0 0\n","output":"Yes\nNo\n"},{"problem_id":"p01295","input":"4 5\n6 7\n0 0\n","output":"45678\n6789101\n"},{"problem_id":"p01296","input":"4\n0 0 x\n2 0 x\n0 1 x\n2 1 x\n4\n1 0 x\n0 1 x\n2 1 x\n1 2 x\n4\n0 0 x\n2 0 y\n0 1 y\n1 2 x\n0\n","output":"Yes\nNo\nYes\n"},{"problem_id":"p01297","input":"100 100 1 1\n50 0 50 100 50\n640 480 1 1\n0 0 640 480 100\n0 0 0 0\n","output":"No\nYes\n"},{"problem_id":"p01298","input":"1 100\n0 86400 1\n1 100\n43200 86400 1\n0 0\n","output":"1.000000\n0.997685\n"},{"problem_id":"p01299","input":"3\n0 0 100 100\n60 100 50\n100 100 10\n80 80 50\n4\n0 0 100 100\n50 50 50\n150 50 50\n50 150 50\n150 150 50\n0\n","output":"2\n0\n"},{"problem_id":"p01300","input":"17819\n1111\n11011\n1234567891011121314151617181920\n0\n","output":"1\n4\n4\n38\n"},{"problem_id":"p01301","input":"3 3 3 5\n3 2 2\n***\n.*.\n\n.*.\n...\n\n3 2 1\n***\n**.\n\n3 1 3\n..*\n\n.**\n\n**.\n\n3 2 2\n..*\n...\n\n***\n..*\n\n3 1 3\n.**\n\n.**\n\n***\n\n3 3 3 2\n3 3 3\n***\n***\n***\n\n***\n*.*\n***\n\n***\n***\n***\n\n1 1 1\n*\n\n3 2 1 2\n3 1 1\n***\n\n2 2 1\n**\n*.\n\n0 0 0 0\n","output":"Yes\nYes\nNo\n"},{"problem_id":"p01302","input":"5\n0 1\n0 0\n5 0\n1 1\n5 2\n0 2\n7\n9999 9998\n0 0\n2 0\n3 1\n1 1\n10000 9999\n2 2\n0 2\n0\n","output":"2.00\n2.2500000\n"},{"problem_id":"p01303","input":"2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10\n","output":"2\n2\n"},{"problem_id":"p01304","input":"4\n2 2\n0\n1 1\n2\n0 0 0 1\n0 0 1 0\n4 3\n4\n1 0 0 0\n3 3 4 3\n4 1 4 0\n0 2 0 3\n15 15\n0\n","output":"6\nMiserable Hokusai!\n5\n155117520\n"},{"problem_id":"p01305","input":"2\n1 3 5 7 9 11 13 15 17\n2 4 6 8 10 12 14 16 18\n1 5 7 9 11 13 15 17 18\n2 3 4 6 8 10 12 14 16\n","output":"0.30891 0.69109\n0.92747 0.07253\n"},{"problem_id":"p01306","input":"7\n12.3 kilo meters\n0.45 mega watts\n0.000000000000000000000001 yotta grams\n1000000000000000000000000 yocto seconds\n42 amperes\n0.42 joules\n1234.56789012345678901234567890 hecto pascals\n","output":"1.23 * 10^4 meters\n4.5 * 10^5 watts\n1 * 10^0 grams\n1.000000000000000000000000 * 10^0 seconds\n4.2 * 10^1 amperes\n4.2 * 10^-1 joules\n1.23456789012345678901234567890 * 10^5 pascals\n"},{"problem_id":"p01307","input":"3\n1234\n5555\n9\n","output":"Audrey wins.\nFabre wins.\nAudrey wins.\n"},{"problem_id":"p01308","input":"4\n6 4\nC E D# F G A\nC E F G\n6 4\nC E D# F G A\nC D# F G\n3 6\nC D D\nD# B D B D# C#\n8 8\nC B B B B B F F\nC B B B B B B B\n","output":"Yes\nNo\nYes\nNo\n"},{"problem_id":"p01309","input":"4\n3 3 5\n0 0\n10 0\n40 40\n40 90\n4 5 10\n100 100\n50 100\n50 150\n100 50\n100 150\n4 60 10\n100 100\n90 100\n110 100\n100 90\n100 110\n4 60 10\n100 100\n80 100\n110 100\n100 80\n100 110\n","output":"9\n0\n60\nYou're always welcome!\n"},{"problem_id":"p01310","input":"4\n3 2 1\n20 1\n10 2\n5 7 3\n70 1\n60 4\n50 2\n40 4\n30 1\n20 3\n10 2\n1 0 1\n4 2 1\n10 1\n10 3\n","output":"1\n0\n1\n1\n0\n1\n1\n2\n0\n1\n0\n1\n2\n"},{"problem_id":"p01311","input":"2\n4 6\n1 2\n1 2 N\n2 3 N\n3 4 N\n4 1 N\n1 4 L\n4 0 L\n4 6\n1 2\n1 2 N\n2 3 N\n3 4 N\n4 1 N\n1 4 L\n4 0 N\n","output":"1\n3\n"},{"problem_id":"p01312","input":"2\n0 0\n0 0\n15:00:00\n18:00:00\n1\n4 0 7199 1125 7199 1125 8324 0 8324\n0 0\n0 0\n15:00:00\n18:00:00\n1\n4 0 7201 1125 7201 1125 8326 0 8326\n","output":"1\n17 59 59.076923\n0\n15 00 00.000000\n"},{"problem_id":"p01313","input":"4\n1 1\n1 3\n1 4\n2 2\n","output":"1 5\n2 7\n7 119\nNo cats.\n13 53\n18 63\n33 88\n35 91\n"},{"problem_id":"p01314","input":"9\n500\n0\n","output":"2\n3\n"},{"problem_id":"p01315","input":"5\napple 1 1 1 1 1 1 1 10 1\nbanana 1 2 2 2 2 2 1 10 1\ncarrot 1 2 2 2 2 2 1 10 2\ndurian 1 3 3 3 3 3 1 10 1\neggplant 1 3 3 3 3 3 1 100 1\n4\nenoki 1 3 3 3 3 3 1 10 1\ntomato 1 3 3 3 3 3 1 10 1\npotato 1 3 3 3 3 3 1 10 1\nonion 1 3 3 3 3 3 1 10 1\n3\na 10 1 1 1 1 1 1 10 1\nb 10 2 2 2 2 2 2 10 1\nc 10 2 2 2 2 2 2 10 1\n0\n","output":"eggplant\napple\ncarrot\nbanana\ndurian\n#\nenoki\nonion\npotato\ntomato\n#\nb\nc\na\n#\n"},{"problem_id":"p01316","input":"2 7\n4\n2\n1\n0\n-1\n-2\n-4\n131\n137\n2 7\n4\n2\n1\n0\n-1\n-2\n-4\n131\n123\n10 7\n-4\n-2\n-1\n0\n1\n2\n4\n132\n134\n135\n134\n132\n128\n124\n122\n121\n122\n5 1\n255\n0\n0\n0\n0\n0\n4 1\n0\n255\n0\n255\n0\n0 0\n","output":"2\n8\n0\n325125\n65026\n"},{"problem_id":"p01317","input":"3 3\n1 2 5 L\n1 2 7 S\n2 3 11 S\n3\n1 2 3\n5 5\n1 2 15 L\n2 3 10 L\n4 5 7 L\n1 3 30 S\n3 4 100 S\n5\n1 3 5 4 1\n0 0\n","output":"18\n269\n"},{"problem_id":"p01318","input":"6\n-2 -2 1 1\n2 2 2 0\n5 7 1 1\n8 0 3 1\n13 4 1 1\n16 1 1 2\n3\n0 0 2 1\n10 0 2 1\n0 10 2 1\n3\n0 0 2 1\n10 0 2 1\n0 6 2 1\n3\n0 0 2 1\n10 0 2 1\n0 4 2 1\n1\n0 0 1 1\n0\n","output":"4\n2\n3\n3\n1\n"},{"problem_id":"p01319","input":"1 1 100\n50 200 20 40 0\n1\n2 4 100\n7 4 1 4 1\n19 5 1 4 0\n5\n3\n7\n9\n1 2 3\n1 1 1 1 0\n1\n3\n1 2 10\n5 10 1 1 1\n2\n3\n0 0 0\n","output":"110\n46.6666666667\n5\n41.6666666667\n"},{"problem_id":"p01320","input":"4 4 1\n1 0\n0 1\n-1 0\n0 -1\n5 6 2\n1 1\n4 4\n2 -4\n-4 2\n1 5\n0 0 0\n","output":"1.000000000\n6.797434948\n"},{"problem_id":"p01321","input":"3\n49 50 87 78 41\n27 61 100 45 84\n28 88 40 95 66\n2\n100 100 100 100 100\n0 0 0 0 0\n1\n89 90 85 93 82\n0\n","output":"317 305\n500 0\n439 439\n"},{"problem_id":"p01322","input":"3 3\n*******1 100\n******22 1000\n11111112 1000000\n01203291\n02382022\n11111111\n10 10\n****3228 149416\n****3992 198635\n****4286 77783\n****4843 225244\n***49835 231046\n***59393 379996\n*5763748 437345\n*6726222 58054\n*8117882 16375\n*9244339 537727\n77885716\n96726222\n26971031\n66652868\n89599648\n37772338\n64679621\n65479161\n92959393\n57855682\n0 0\n","output":"1200\n438050\n"},{"problem_id":"p01323","input":"3\n......\n......\n......\n......\n......\n......\n......\n......\n.RGB..\nRGOP..\nRGBPB.\nRGBPP.\nGBRGYP\nGBRRYP\nBGGRBB\nBPRGYY\nGGPRRY\nBYPPRB\nYGGGPB\nGYYYPR\nYRBRBR\nYBRBRB\nBRBRBR\nBRBRBR\n......\n......\n......\n......\n......\n......\n......\n......\n......\n......\n..OO..\n..OO..\n","output":"3\n18\n0\n"},{"problem_id":"p01324","input":"3\n1 km = 10^3 m\n1 m = 10^2 cm\n1 km = 10^5 cm\n7\n1 kilometre = 10^3 metre\n1 megametre = 10^3 kilometre\n1 metre = 10^-6 megametre\n1 terametre = 10^3 gigametre\n1 petametre = 10^3 terametre\n1 gigametre = 10^-6 petametre\n1 metre = 10^-15 petametre\n4\n1 a = 10^2 b\n1 a = 10^3 c\n1 b = 10^2 c\n1 c = 10^1 d\n4\n1 acm = 10^2 icpc\n1 icpc = 10^3 utpc\n1 utpc = 10^4 topcoder\n1 topcoder = 10^-1 acm\n0\n","output":"Yes\nYes\nNo\nNo\n"},{"problem_id":"p01325","input":"2\n1 2\n2 1\n3\n2 1 2\n2 1 2\n10\n0 1 1 2 5 5 5 8 8 9\n0 1 3 3 3 6 6 6 7 9\n0\n","output":"Yes\nNo\nYes\n"},{"problem_id":"p01326","input":"1\nxxxxxxxx\n3\n11100000\n10x00000\n10111111\n3\n11100000\n10000000\n10111111\n4\nxxxxxxxx\nxxxxxxxx\nxxxxxxxx\nxxxxxxxx\n0\n","output":"128\n1\n0\n778240\n"},{"problem_id":"p01327","input":"3\n7\/7 18:30\n3\nAquila 8\n359.216 -32.936\n358.624 -49.913\n352.155 -43.404\n346.852 -35.279\n345.110 -36.796\n342.448 -44.407\n343.088 -38.981\n336.070 -43.369\nCygnus 11\n357.838 6.615\n355.808 5.107\n353.475 -18.553\n348.868 -10.771\n347.949 1.298\n344.907 -4.637\n342.909 1.163\n338.483 -9.293\n338.854 -1.786\n338.515 1.304\n331.752 -10.737\nLyra 4\n5.063 -7.812\n2.708 -13.386\n1.327 -2.841\n0.815 -14.109\n9\/3 02:40\n3\nSevenStars 7\n40.483 50.729\n48.968 50.637\n50.421 42.796\n44.855 40.960\n43.493 35.637\n42.111 31.430\n44.997 25.256\nSummerTriangle 3\n342.909 1.163\n345.110 -36.796\n5.063 -7.812\nWinterTriangle 3\n165.368 51.176\n207.400 51.262\n184.960 31.381\n7\/7 19:00\n91\nAndromeda 25\n300.224 10.559\n313.114 22.235\n304.593 17.311\n305.145 18.508\n299.557 18.169\n295.825 15.561\n296.928 16.703\n290.573 13.699\n304.020 24.766\n300.872 24.287\n296.636 24.636\n304.470 32.153\n303.783 32.893\n298.697 32.261\n306.181 35.986\n296.619 37.096\n301.005 41.728\n319.394 10.944\n323.303 16.879\n313.853 10.187\n313.295 13.504\n317.463 18.294\n315.012 16.124\n315.502 17.165\n316.369 19.322\nAntila 5\n150.199 5.822\n143.663 11.282\n144.808 2.868\n138.069 2.334\n136.680 -6.080\nApus 6\n159.498 -45.403\n165.358 -47.196\n157.404 -51.717\n166.529 -52.133\n167.065 -52.812\n162.765 -60.430\nAquarius 28\n318.790 -48.408\n321.209 -45.287\n318.270 -46.509\n310.269 -47.366\n305.625 -45.668\n308.937 -39.175\n306.021 -39.676\n303.902 -30.310\n293.964 -39.757\n296.515 -33.643\n282.661 -42.871\n299.661 -28.583\n300.287 -26.468\n290.965 -33.635\n281.107 -39.811\n297.231 -25.827\n293.848 -28.361\n279.450 -36.914\n284.435 -32.529\n288.734 -27.776\n281.899 -32.844\n273.078 -34.510\n284.834 -23.654\n282.207 -25.447\n282.043 -24.537\n271.558 -31.463\n273.631 -23.685\n269.813 -26.206\nAquila 19\n0.874 -31.730\n359.216 -32.936\n358.624 -49.913\n355.895 -52.798\n355.474 -35.099\n353.377 -34.624\n352.155 -43.404\n349.613 -47.552\n349.977 -38.924\n345.808 -53.003\n346.852 -35.279\n339.294 -54.454\n345.110 -36.796\n342.448 -44.407\n343.088 -38.981\n340.624 -37.632\n336.070 -43.369\n340.114 -29.343\n329.215 -43.658\nAra 8\n139.371 -64.281\n128.988 -67.070\n126.140 -67.495\n133.937 -70.565\n146.948 -68.649\n115.206 -73.448\n124.296 -74.895\n129.807 -78.284\nAries 16\n275.089 19.700\n277.208 23.346\n277.494 27.270\n273.485 25.417\n269.538 23.135\n277.570 29.777\n272.582 27.036\n270.956 32.094\n275.776 36.366\n274.279 37.296\n262.543 29.989\n266.391 34.798\n273.056 41.891\n263.012 36.658\n263.680 38.088\n262.590 39.297\nAuriga 21\n258.333 63.534\n282.118 68.223\n274.900 67.732\n274.775 68.507\n266.432 68.904\n287.684 71.012\n269.744 70.488\n245.605 69.176\n303.422 75.275\n259.211 76.033\n324.841 73.413\n322.545 74.855\n284.226 78.538\n218.521 73.350\n316.324 81.078\n231.890 84.097\n278.842 87.076\n336.299 83.829\n155.787 85.774\n127.797 86.332\n120.527 85.282\nBootes 24\n63.869 9.873\n69.774 4.070\n67.862 3.467\n60.529 5.629\n63.774 0.539\n40.081 23.036\n44.262 19.473\n67.421 -4.525\n38.676 22.314\n61.891 -1.179\n53.418 6.177\n47.886 11.938\n53.387 5.299\n42.612 15.477\n64.297 -9.243\n54.097 1.616\n42.092 9.644\n50.239 -1.089\n36.476 15.172\n51.041 -3.111\n44.417 2.429\n40.498 4.563\n37.434 6.614\n36.639 5.466\nCaelum 3\n206.749 -2.707\n206.383 0.705\n207.503 3.802\nCamelopardis 9\n336.366 53.550\n306.868 63.261\n314.379 64.832\n333.859 61.000\n324.283 65.152\n333.999 66.052\n347.170 66.444\n358.133 64.282\n22.412 70.692\nCancer 14\n152.932 60.247\n141.543 68.586\n149.220 52.365\n129.286 67.634\n139.314 59.869\n141.009 55.655\n133.303 60.477\n128.079 59.843\n131.349 56.985\n116.140 64.655\n132.656 49.904\n105.407 64.702\n130.791 47.655\n118.700 56.309\nCanesVenatici 9\n63.515 33.891\n54.117 37.264\n64.014 31.442\n60.753 31.416\n60.907 26.172\n61.859 23.114\n58.947 24.067\n56.181 24.166\n56.197 23.490\nCanisMajor 12\n189.554 16.222\n191.117 30.052\n187.145 25.454\n184.960 31.381\n182.841 15.253\n182.535 34.807\n180.964 19.769\n180.236 20.737\n179.917 24.636\n179.696 32.436\n178.624 21.184\n175.070 17.938\nCanisMinor 5\n169.498 54.684\n167.330 58.263\n165.368 51.176\n160.497 56.218\n161.829 47.153\nCapricornus 15\n327.283 -54.381\n319.640 -62.109\n327.152 -54.307\n324.725 -55.607\n313.330 -57.369\n302.734 -61.915\n300.239 -61.281\n305.714 -52.841\n295.483 -58.754\n302.466 -49.134\n294.302 -53.161\n297.453 -46.446\n300.104 -41.866\n295.158 -45.704\n296.821 -42.155\nCarina 7\n186.061 -4.875\n171.511 -4.945\n169.452 -13.029\n167.374 -24.125\n162.642 -15.652\n163.244 -28.369\n156.225 -25.313\nCassiopeia 18\n324.796 30.076\n326.794 34.518\n317.285 30.327\n319.592 32.153\n311.156 28.226\n340.196 40.324\n322.818 35.995\n315.615 34.775\n320.474 39.098\n330.339 41.508\n332.996 42.444\n336.611 43.459\n329.769 42.982\n323.558 43.299\n335.542 45.252\n327.048 45.835\n331.423 27.745\n324.605 27.533\nCentaurus 16\n144.780 -21.358\n151.103 -29.155\n136.031 -24.020\n134.304 -26.850\n128.655 -31.224\n114.889 -26.222\n130.425 -37.948\n109.349 -29.106\n117.349 -34.385\n122.386 -37.770\n137.790 -43.449\n109.153 -34.197\n107.859 -36.848\n112.627 -42.112\n135.878 -47.823\n110.171 -46.148\nCepheus 16\n355.930 31.338\n349.846 17.598\n347.662 17.057\n344.189 19.225\n347.193 26.771\n346.570 27.967\n340.498 19.415\n339.367 22.048\n345.204 30.053\n335.982 18.661\n334.049 20.245\n349.184 35.742\n344.517 32.277\n336.609 24.983\n337.594 27.709\n345.323 37.813\nCetus 29\n267.392 -21.962\n272.139 -12.783\n274.115 -7.347\n261.316 -14.311\n265.273 -8.669\n271.035 -2.352\n270.805 1.139\n261.818 -5.639\n260.665 -1.490\n256.455 -4.506\n250.542 -9.105\n252.749 -2.256\n255.205 2.027\n254.630 2.111\n245.181 -4.356\n264.415 18.831\n253.034 9.471\n247.128 6.587\n261.394 21.309\n243.942 5.376\n257.758 20.709\n249.146 12.323\n253.144 17.620\n243.530 9.279\n259.617 25.458\n255.832 27.254\n251.561 24.282\n245.843 22.473\n247.574 26.675\nChamaeleon 6\n174.828 -30.357\n173.717 -31.227\n167.691 -34.936\n169.124 -36.723\n161.658 -35.846\n165.432 -40.069\nCircinus 2\n141.590 -48.550\n132.085 -52.609\nColumba 6\n202.143 9.996\n197.412 10.578\n195.025 10.858\n193.570 10.680\n191.926 4.413\n189.632 11.237\nComaBerenices 7\n76.648 24.387\n79.683 19.987\n77.453 20.178\n80.843 17.387\n70.827 20.336\n73.668 13.661\n67.542 17.115\nCoronaAustralis 3\n76.831 -84.408\n72.159 -87.309\n349.050 -82.780\nCoronaBorealis 6\n44.830 -2.520\n42.619 -1.332\n44.991 -5.346\n37.053 0.095\n40.620 -8.046\n33.560 -1.062\nCorvus 4\n114.367 -5.461\n109.900 -2.973\n106.846 -4.729\n111.347 -10.379\nCrater 7\n124.123 8.440\n124.193 3.979\n117.555 8.787\n118.622 5.586\n110.936 9.608\n116.023 1.385\n113.531 0.100\nCrux 4\n142.482 -29.634\n147.192 -33.867\n140.733 -31.246\n140.848 -33.879\nCygnus 26\n357.838 6.615\n355.808 5.107\n353.475 -18.553\n353.876 -12.067\n354.603 3.708\n351.653 -8.897\n348.868 -10.771\n346.567 -8.538\n350.193 10.869\n347.949 1.298\n344.907 -4.637\n342.557 -7.945\n340.846 -13.795\n342.909 1.163\n338.483 -9.293\n338.854 -1.786\n340.656 4.326\n338.515 1.304\n336.234 -3.364\n331.752 -10.737\n334.609 -1.970\n332.686 -6.040\n335.619 5.437\n334.489 4.935\n331.664 0.559\n334.307 9.233\nDelphinus 5\n333.672 -31.713\n331.571 -32.362\n333.741 -26.848\n332.447 -27.320\n332.054 -26.066\nDorado 7\n205.464 -10.486\n200.871 -13.113\n196.063 -12.729\n191.203 -21.965\n190.853 -16.249\n188.787 -18.553\n185.561 -20.832\nDraco 28\n28.940 47.754\n32.728 46.686\n27.652 42.406\n32.423 39.207\n30.070 33.592\n29.528 32.232\n26.812 21.591\n22.960 18.431\n14.533 25.591\n12.136 21.124\n13.986 7.554\n8.952 22.630\n12.900 10.242\n12.891 10.228\n8.276 23.088\n6.773 26.220\n4.729 30.713\n9.530 11.119\n10.253 5.765\n5.511 18.022\n3.426 26.157\n1.169 28.661\n1.500 12.613\n0.731 24.504\n358.998 20.874\n358.972 26.573\n353.557 29.067\n356.093 36.356\nEquuleus 2\n323.384 -29.260\n319.354 -32.975\nEridanus 29\n219.089 -30.779\n223.136 -24.855\n220.757 -22.413\n222.767 -18.286\n226.742 -10.667\n236.404 3.705\n244.644 15.058\n223.094 -9.567\n233.490 4.341\n240.785 18.142\n239.287 22.218\n236.398 19.741\n228.885 10.392\n230.696 13.844\n234.428 21.532\n239.136 27.577\n224.969 10.176\n228.619 20.174\n235.564 30.495\n230.014 28.159\n229.050 32.214\n212.080 4.745\n211.967 9.906\n225.626 33.576\n218.908 24.204\n220.788 30.349\n223.184 34.664\n215.927 35.337\n214.381 33.359\nFornax 7\n238.898 -9.116\n237.171 -8.220\n240.540 -1.605\n231.177 -8.178\n229.829 -4.623\n224.613 6.412\n221.710 3.538\nGemini 22\n215.932 66.683\n204.877 67.736\n199.742 65.953\n193.146 62.679\n193.518 71.530\n188.373 59.467\n192.635 80.565\n180.202 71.018\n179.143 67.371\n174.375 62.866\n171.813 63.143\n168.932 68.478\n161.323 73.914\n153.261 77.453\n148.264 77.059\n154.841 72.360\n152.127 69.337\n146.998 72.565\n156.258 63.667\n134.440 76.874\n143.773 70.603\n136.491 70.307\nGrus 10\n266.639 -56.891\n261.892 -55.418\n250.399 -57.109\n258.350 -51.534\n252.761 -52.750\n247.501 -51.272\n238.441 -51.698\n236.933 -49.917\n245.584 -46.524\n235.380 -46.029\nHercules 31\n33.142 5.662\n43.844 -17.673\n29.344 6.259\n26.982 6.515\n39.748 -17.544\n45.996 -28.329\n41.678 -22.405\n36.788 -16.433\n26.483 1.894\n22.911 7.383\n26.485 -1.995\n30.710 -15.768\n27.551 -9.426\n26.391 -10.747\n25.126 -8.401\n32.749 -27.966\n25.531 -17.599\n21.385 -6.334\n21.711 -10.815\n15.742 3.862\n21.581 -17.539\n14.288 1.096\n17.591 -16.951\n15.964 -19.046\n13.290 -8.148\n14.702 -16.037\n17.081 -28.351\n12.616 -16.934\n9.946 -24.416\n4.443 -26.136\n4.239 -28.516\nHorologium 4\n212.195 -27.502\n215.685 -21.711\n209.563 -22.898\n210.127 -2.984\nHydra 24\n143.985 47.058\n145.069 44.803\n151.923 30.938\n145.140 38.337\n138.169 45.241\n135.092 39.726\n136.675 32.126\n137.556 29.724\n130.493 33.636\n138.050 22.682\n132.130 20.111\n130.180 20.428\n129.080 15.379\n131.778 8.535\n124.835 11.440\n128.852 0.658\n126.517 -5.926\n127.538 -9.245\n104.527 -18.245\n98.485 -25.440\n99.975 -26.915\n99.280 -28.259\n98.943 -34.064\n93.274 -36.105\nHydrus 11\n198.297 -43.876\n202.979 -41.907\n208.163 -34.122\n213.775 -30.545\n205.448 -32.460\n200.398 -35.209\n193.118 -38.207\n203.866 -31.341\n200.214 -31.329\n193.659 -34.973\n194.307 -31.540\nIndus 7\n249.907 -72.922\n239.450 -71.406\n220.919 -67.358\n206.717 -56.713\n235.616 -59.690\n231.364 -58.806\n207.454 -50.856\nLacerta 4\n330.868 14.794\n328.679 13.927\n320.762 5.716\n321.696 8.482\nLeo 27\n108.913 56.585\n123.339 44.644\n122.115 42.133\n99.000 55.511\n117.773 44.879\n106.792 51.358\n102.424 51.543\n118.908 37.713\n109.440 42.916\n113.660 39.315\n100.430 45.670\n106.478 36.782\n110.515 33.255\n99.191 37.449\n106.077 31.291\n109.303 24.383\n105.551 26.268\n109.300 22.087\n92.537 33.471\n97.094 30.159\n110.548 17.282\n103.478 22.505\n104.608 19.066\n104.441 16.037\n87.023 27.107\n91.610 23.269\n89.591 22.768\nLeoMinor 9\n90.267 60.380\n78.517 57.855\n92.724 53.388\n86.200 50.349\n81.581 50.769\n86.265 46.546\n95.468 40.706\n86.698 44.569\n81.288 45.027\nLepus 9\n208.923 19.793\n209.526 25.864\n209.073 29.219\n204.435 23.896\n204.385 27.140\n199.741 22.797\n201.635 31.020\n198.720 25.558\n198.849 30.984\nLibra 16\n81.767 -29.125\n83.418 -30.457\n77.768 -27.899\n74.449 -26.474\n89.322 -38.371\n81.462 -35.785\n72.163 -30.079\n75.587 -36.700\n69.669 -33.980\n72.203 -36.540\n86.964 -46.207\n75.625 -41.168\n74.720 -44.181\n67.649 -40.782\n68.788 -42.391\n61.765 -36.662\nLupus 11\n117.171 -41.790\n118.068 -45.036\n111.531 -46.416\n116.593 -50.101\n123.695 -51.230\n93.851 -43.568\n104.221 -48.998\n99.276 -47.504\n98.305 -47.468\n90.274 -51.170\n91.817 -55.374\nLynx 10\n340.957 72.851\n350.646 71.341\n13.353 77.484\n18.414 73.281\n59.902 79.893\n47.406 76.156\n83.141 75.429\n72.888 72.348\n78.567 66.265\n96.482 61.871\nLyra 7\n8.778 -10.140\n5.063 -7.812\n2.708 -13.386\n1.327 -2.841\n0.815 -14.109\n359.054 -10.696\n357.282 -8.610\nMensa 7\n188.214 -35.195\n193.058 -25.199\n190.066 -28.325\n185.361 -35.800\n186.324 -29.775\n184.202 -26.795\n181.257 -32.429\nMicroscopium 5\n264.385 -70.579\n286.221 -64.016\n274.073 -66.473\n281.802 -61.120\n266.935 -63.909\nMonoceros 11\n193.937 39.673\n195.344 50.445\n191.879 42.909\n192.497 53.543\n187.013 55.210\n185.664 49.081\n177.432 43.009\n176.624 47.247\n168.308 42.271\n167.934 37.614\n160.433 42.707\nMusca 5\n152.442 -31.405\n156.829 -38.365\n153.135 -37.536\n154.045 -40.135\n148.162 -39.941\nNorma 3\n108.500 -58.666\n125.170 -60.575\n117.887 -61.581\nOctans 13\n198.046 -45.252\n176.567 -38.166\n173.012 -42.811\n172.072 -43.886\n172.730 -47.145\n179.818 -46.801\n191.207 -53.945\n182.212 -45.697\n194.137 -52.731\n192.192 -49.399\n186.876 -46.654\n191.609 -47.909\n184.474 -44.508\nOphiuchus 20\n54.470 -34.618\n54.219 -36.013\n48.446 -37.238\n54.066 -43.720\n50.326 -45.370\n36.864 -29.115\n36.334 -30.222\n43.032 -42.256\n53.910 -61.019\n53.402 -62.293\n31.010 -37.921\n59.681 -65.616\n25.109 -30.741\n42.187 -61.743\n25.758 -38.990\n25.154 -41.103\n26.385 -52.352\n20.997 -41.799\n16.895 -35.752\n14.223 -42.479\nOrion 20\n228.557 43.501\n227.159 42.547\n233.926 49.831\n224.091 40.245\n231.313 52.497\n224.916 48.508\n212.650 33.396\n213.079 36.124\n214.760 41.605\n217.291 47.355\n211.550 42.550\n216.105 51.230\n208.390 38.774\n209.681 41.921\n203.047 35.727\n207.400 51.262\n202.907 45.028\n202.227 48.919\n206.751 59.217\n201.381 57.499\nPavo 10\n157.654 -67.059\n164.415 -71.696\n176.459 -62.514\n176.133 -71.320\n189.680 -61.203\n196.371 -65.611\n220.726 -71.988\n203.251 -63.374\n200.903 -58.638\n210.828 -60.620\nPegasus 31\n289.423 1.639\n292.789 5.389\n325.271 -19.328\n325.355 -15.082\n321.576 -18.057\n315.029 -25.454\n309.887 -31.091\n324.502 -7.231\n321.746 -10.569\n313.113 -20.498\n318.709 -9.439\n322.477 -2.549\n322.345 -2.460\n306.855 -24.931\n308.208 -18.427\n304.677 -19.779\n318.503 -0.637\n303.255 -16.572\n314.882 -0.922\n310.240 -4.458\n309.992 0.187\n301.577 -9.597\n297.306 -13.646\n295.935 -13.393\n304.294 -0.680\n309.331 6.413\n303.256 -0.214\n295.450 -7.529\n295.715 0.944\n290.000 -4.903\n299.060 6.102\nPerseus 24\n307.992 37.714\n307.408 38.982\n311.185 41.765\n294.837 44.540\n301.426 46.254\n310.678 48.794\n305.863 48.704\n281.711 43.164\n306.515 50.399\n285.480 45.931\n287.939 47.329\n300.332 50.249\n299.861 52.709\n296.472 53.324\n295.380 55.305\n286.455 54.355\n269.053 51.499\n280.841 55.738\n273.943 54.251\n299.144 59.485\n293.899 59.557\n295.040 60.674\n268.445 57.603\n282.731 62.992\nPhoenix 9\n240.413 -36.726\n241.278 -32.781\n234.988 -34.724\n235.320 -32.610\n223.631 -37.224\n233.002 -23.838\n227.369 -22.186\n247.359 -41.041\n233.157 -41.238\nPictor 5\n199.115 -5.204\n196.549 -5.314\n190.277 -10.223\n187.892 -6.886\n181.859 -13.299\nPisces 30\n276.084 -15.147\n276.760 -13.373\n283.165 -1.965\n277.824 -5.444\n287.819 5.104\n277.923 2.647\n284.761 9.075\n292.714 18.557\n275.728 5.436\n280.618 10.596\n284.273 15.764\n291.602 21.582\n273.667 7.181\n270.057 5.224\n288.083 21.157\n280.421 17.307\n276.573 15.617\n273.154 14.509\n267.381 10.808\n269.460 14.019\n263.563 11.435\n294.064 -18.352\n291.117 -16.513\n287.818 -16.306\n291.268 -12.413\n288.534 -10.905\n285.402 -13.291\n282.129 -14.379\n279.313 -13.299\n285.935 -6.652\nPiscesAustrinus 8\n278.189 -58.674\n274.140 -56.842\n272.659 -51.571\n277.649 -47.812\n267.833 -47.693\n271.890 -43.451\n267.416 -41.162\n260.978 -42.711\nPuppis 9\n184.580 3.817\n182.079 -2.625\n177.070 9.833\n175.119 3.899\n167.505 32.508\n168.381 22.802\n168.339 5.677\n164.057 21.464\n160.076 30.354\nPyxis 4\n158.634 10.564\n154.957 16.224\n152.121 11.537\n147.334 15.581\nReticulum 5\n204.908 -22.855\n201.994 -23.451\n202.121 -20.347\n199.887 -20.103\n198.493 -20.590\nSagitta 3\n349.566 -28.691\n348.056 -27.420\n345.286 -25.999\nSagittarius 25\n48.012 -67.119\n44.526 -72.258\n28.519 -65.511\n51.339 -78.206\n32.619 -72.785\n41.334 -77.820\n23.740 -70.063\n12.238 -71.480\n5.559 -72.441\n3.057 -67.672\n356.728 -73.111\n355.646 -67.730\n351.935 -63.658\n350.579 -60.563\n262.868 -86.361\n312.000 -84.491\n337.993 -68.724\n340.644 -61.337\n339.682 -61.389\n336.325 -63.392\n282.888 -79.729\n333.366 -58.963\n302.710 -76.078\n319.336 -69.154\n268.021 -75.299\nScorpius 14\n80.363 -49.004\n74.835 -46.432\n70.299 -45.175\n73.601 -52.052\n73.114 -54.227\n74.595 -56.737\n80.967 -62.586\n89.217 -64.779\n98.307 -69.868\n77.481 -71.296\n77.193 -71.890\n89.403 -74.055\n81.163 -74.348\n83.072 -75.589\nSculptor 11\n258.000 -26.547\n249.899 -31.550\n243.095 -27.647\n248.893 -19.849\n246.841 -20.340\n240.080 -14.665\n244.594 -9.531\n260.749 -39.021\n253.603 -38.949\n257.110 -35.369\n259.902 -31.592\nScutum 5\n16.148 -59.376\n11.653 -54.049\n8.921 -55.461\n8.156 -54.279\n6.023 -49.906\nSerpens 13\n62.443 -19.751\n53.456 -13.220\n55.387 -23.131\n49.361 -16.131\n47.238 -14.241\n60.461 -31.027\n55.246 -25.667\n47.088 -17.328\n50.255 -33.010\n39.013 -56.091\n15.238 -46.901\n11.969 -46.189\n2.194 -42.577\nSevenStars 7\n40.483 50.729\n48.968 50.637\n50.421 42.796\n44.855 40.960\n43.493 35.637\n42.111 31.430\n44.997 25.256\nSextans 5\n129.626 29.644\n126.345 22.444\n122.446 24.760\n119.299 25.894\n119.015 18.085\nSummerTriangle 3\n342.909 1.163\n345.110 -36.796\n5.063 -7.812\nTaurus 27\n250.893 31.722\n250.982 32.632\n252.943 35.539\n241.685 27.325\n261.126 45.412\n244.002 33.045\n260.593 45.877\n260.194 46.146\n245.956 40.306\n239.935 35.811\n254.646 47.658\n250.907 46.787\n258.577 51.508\n239.262 40.001\n244.242 45.761\n245.368 47.668\n245.642 49.782\n239.805 47.440\n240.886 49.021\n246.413 54.695\n238.949 53.205\n238.548 57.087\n240.905 65.777\n226.104 57.692\n225.532 61.707\n217.863 59.965\n227.613 69.046\nTelescopium 6\n99.632 -80.656\n100.423 -83.483\n175.148 -82.103\n227.583 -82.622\n206.443 -75.581\n228.471 -76.495\nTriangulum 5\n285.165 28.434\n288.118 34.349\n285.904 35.093\n280.102 34.723\n286.401 38.875\nTriangulumAustrale 6\n148.672 -52.090\n146.607 -54.162\n142.070 -56.831\n142.826 -59.157\n156.860 -56.997\n157.390 -58.985\nTucana 6\n216.837 -42.185\n208.705 -40.221\n217.821 -35.934\n223.308 -56.356\n226.434 -48.712\n215.737 -44.634\nUrsaMajor 29\n29.282 68.109\n66.378 69.195\n22.970 60.853\n68.864 68.465\n34.212 60.841\n58.080 63.568\n23.054 57.220\n43.463 59.925\n73.296 55.002\n33.894 55.376\n75.061 53.630\n50.113 54.941\n48.195 54.330\n72.518 46.730\n48.968 50.637\n40.483 50.729\n65.995 46.548\n79.010 39.942\n73.034 42.329\n65.674 42.568\n74.681 36.517\n58.506 41.892\n50.421 42.796\n44.855 40.960\n42.300 39.601\n36.409 39.726\n43.493 35.637\n42.111 31.430\n44.997 25.256\nUrsaMinor 10\n359.062 43.472\n15.334 38.584\n16.704 36.737\n17.194 34.620\n17.526 31.442\n11.304 34.699\n11.341 32.253\n11.030 31.917\n5.554 36.468\n1.714 40.033\nVela 5\n168.619 -1.071\n164.855 -6.629\n157.488 -0.252\n160.372 -12.557\n155.025 -13.588\nVirgo 33\n98.539 18.430\n101.244 14.256\n95.800 15.774\n93.423 16.427\n96.882 8.238\n94.860 9.978\n97.474 1.850\n98.384 0.141\n86.005 10.761\n87.288 8.349\n97.602 -4.270\n88.734 3.618\n92.116 -0.944\n82.053 7.572\n92.018 -4.372\n83.466 1.036\n100.540 -14.806\n94.167 -11.471\n94.253 -12.053\n75.583 4.802\n81.944 -3.198\n84.072 -5.412\n87.744 -9.129\n88.703 -12.071\n94.791 -18.290\n95.548 -20.598\n78.670 -9.609\n85.118 -19.408\n81.691 -17.430\n86.326 -22.486\n76.304 -16.663\n75.459 -21.104\n70.253 -17.188\nVolans 6\n181.087 -22.253\n179.426 -22.704\n178.481 -19.274\n176.577 -24.804\n171.114 -20.237\n167.223 -21.251\nVulpecula 7\n353.634 -21.875\n350.153 -20.389\n346.451 -17.791\n342.107 -20.025\n335.915 -21.936\n334.725 -14.255\n331.735 -19.292\nWinterTriangle 3\n165.368 51.176\n207.400 51.262\n184.960 31.381\n","output":"Cygnus\nLyra\nSevenStars\nSummerTriangle\nWinterTriangle\nBootes\nCamelopardis\nCancer\nCanesVenatici\nCassiopeia\nCepheus\nComaBerenices\nCoronaBorealis\nCorvus\nCrater\nCygnus\nDelphinus\nDraco\nHercules\nLacerta\nLeo\nLeoMinor\nLibra\nLynx\nLyra\nOphiuchus\nSagitta\nScutum\nSerpens\nSevenStars\nSextans\nSummerTriangle\nUrsaMajor\nUrsaMinor\nVirgo\nVulpecula\n"},{"problem_id":"p01328","input":"N M\nx\n","output":"2\n20\n"},{"problem_id":"p01329","input":"7 6\n......\n.####.\n.####.\n...S#.\n...##.\n...##.\n.....G\n3\nLD\nDD\nLLL\n7 8\nS#......\n.#.####.\n.#.#G.#.\n.#.##.#.\n.#....#.\n.######.\n........\n8\nDDDD\nDDDU\nUUUU\nUUUD\nRRRR\nRRRL\nLLLL\nLLLR\n3 8\n########\nS......G\n########\n2\nU\nD\n6 10\n..........\n.S........\n..........\n..........\n........G.\n..........\n0\n6 7\n.......\n...#...\n...#.S.\n...###.\n.G.....\n.......\n2\nLL\nDD\n0 0\n","output":"13\n60\n7\n10\n-1\n"},{"problem_id":"p01330","input":"2 3\n1 2 1\n2 3\n1 2 6\n0 0\n","output":"1\n1\n"},{"problem_id":"p01331","input":"4 4 1\n2 2 3 3\n1 4 1\n1 2 1 3\n5 5 2\n2 2 3 4\n3 3 5 3\n5 5 3\n4 4 5 5\n2 2 3 3\n3 3 4 4\n100000 100000 1\n2 2 99999 99999\n1 1 0\n0 0 0\n","output":"12\n1\n26\n18\n615667476\n1\n"},{"problem_id":"p01332","input":"4\n0 0\n100 0\n100 100\n0 100\n4\n0 0\n100 0\n100 100\n0 100\n4\n0 0\n100 0\n100 100\n0 100\n3\n0 0\n100 0\n0 100\n3\n0 0\n100 0\n0 100\n3\n0 0\n100 0\n0 100\n5\n0 0\n200 0\n200 200\n100 100\n0 200\n5\n0 0\n200 0\n100 100\n200 200\n0 200\n4\n0 0\n200 0\n200 200\n0 200\n0\n0\n0\n","output":"1000000.0000\n250000.0000\n5333333.3333\n"},{"problem_id":"p01333","input":"500 1000\n100 10000\n400 700\n600 5000\n10000 10000\n0 0\n","output":"0 1 0\n4 1 9\n3 0 0\n4 0 4\n0 0 0\n"},{"problem_id":"p01334","input":"1\n0 0\n2\n1 1 0 1\n1 0 0 0\n2\n1 1 0 1\n1 1 1 0\n3\n0 1 2 2 2 1\n0 2 1 2 2 1\n0 0 0 1 1 1\n4\n3 2 2 0 3 2 2 1\n1 1 0 3 1 1 3 1\n0 3 2 3 3 0 2 3\n1 1 1 1 3 2 1 3\n0\n","output":"1\n2\n1\n2\n3\n"},{"problem_id":"p01335","input":"3\n0 1 0 1 0 0 0 0 0 1 0 0 0\n1 0 0 0 0 0 1 0 0 1 0 0 2\n0 1 1 0 1 1 1 0 0 0 0 5 5\n3 1 1 1 0 1 0 0 1 0 3 0 2\n1 1 2 4 5 10 20 50 100\n7H 6H 2H 5H 3H\n9S 9C 9H 8H 8D\nKS KH QH JD TS\n10\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 2 3 4 5 6 7 8 9\nAS 3D 2C 5D 6H\n6S 6C 7D 8H 9C\nTS TD QC JD JC\nKD KH KC AD 2C\n3D 4H 6D 5H 7C\n2S KS QS AS JS\nTS TD JD JC TH\n8H 8D TC 8C 8S\n4S 5S 3S 7S 6S\nKD QD JD TD AD\n","output":"25\n0\n14\n\n0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n"},{"problem_id":"p01336","input":"3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 1 2 1\ndop\n5 3 11 14\n2 300\nBydo System Alpha\n7 11 4 7\nGreen Inferno\n300 300 300 300\n","output":"29\n462\n"},{"problem_id":"p01337","input":"2\n1 3 3 1\n-10 0 0 0\n","output":"0 3\n0 0\n"},{"problem_id":"p01338","input":"5\n\n1 1 0 3 3\n1 1 0 3 3\n0 0 0 0 0\n2 2 0 4 4\n2 2 0 4 4\n\n1 1 1 0 0\n1 1 1 1 0\n1 0 1 1 0\n0 0 1 1 1\n1 1 1 1 1\n\n0 0 0 0 0\n0 0 0 0 0\n0 0 0 0 0\n0 0 0 0 0\n0 0 0 0 0\n\n4 3 4 3 4\n3 4 3 4 3\n4 3 4 3 4\n3 4 3 4 3\n4 3 4 3 4\n\n2 2 2 2 2\n0 0 0 2 0\n2 2 0 2 0\n2 2 0 2 0\n0 0 0 2 0\n","output":"1280\n1420\n0\n1920\n1020\n"},{"problem_id":"p01339","input":"5 4\n2 3\n3 4\n4 3\n5 4\n","output":"10\n"},{"problem_id":"p01340","input":"2 3\nUo.\n.oo\n","output":"RDR\n"},{"problem_id":"p01341","input":"3 3\n0 0\n3 0\n0 4\n1 2\n2 3\n3 1\n","output":"3.000\n"},{"problem_id":"p01342","input":"3 4 4\n1 0 1 1\n1 3 1 4\n1 2 2 2\n2 1 2 3\n0 0\n1 0\n","output":"6\n"},{"problem_id":"p01343","input":"2 1\n0 0 1 0\n1 1 0 1\n","output":"5.2793638507\n"},{"problem_id":"p01344","input":"6\n4 3 3\n10 17\n15 14\n10 15\n11 12\n16 18\n15 22\n","output":"3\n"},{"problem_id":"p01345","input":"4\n0 0\n10 10\n10 -10\n-10 -10\n-10 10\n","output":"Yes\n"},{"problem_id":"p01346","input":"3 3 2 1\n1 1 4\n","output":"Yes\n"},{"problem_id":"p01347","input":"3 3\n0 1 5\n1 2 3\n0 2 2\n","output":"6\n"},{"problem_id":"p01348","input":"4 2\n0 2\n3 1\n","output":"6\n"},{"problem_id":"p01349","input":"4 6 3\n......\n...Y..\n...Y..\nRRYRYY\n","output":"YES\n"},{"problem_id":"p01350","input":"5\n100.1 90.1\n0 0\n0 10\n5 5\n10 0\n10 10\n","output":"10\n"},{"problem_id":"p01351","input":"6 6 2 2 2 4\n","output":"8\n"},{"problem_id":"p01352","input":"4 10\n1 0 1\n1 0 2\n3 1 2\n2 0 1\n1 2 3\n3 0 1\n1 0 1\n2 0 2\n1 1 3\n3 0 2\n","output":"YES\nNO\nYES\n"},{"problem_id":"p01353","input":"2\n10 3 1 2\n2 4 1 3\n2 2 1 1\n","output":"4\n"},{"problem_id":"p01354","input":"2 3\n0.900 0.500 0.100\n0.500 0.500 0.500\n","output":"0.372500000000\n"},{"problem_id":"p01355","input":"2 1\n10 0 10\n20 0 10\n","output":"2\n"},{"problem_id":"p01356","input":"6 200 2 3 4 5\n","output":"1\n"},{"problem_id":"p01357","input":"2\n1 -1 3 -1 3 1 1 3 -1 3 -1 1\n3 0 4 0 4 1 3 2 2 2 2 1\n3\n1 1\n-1 -1\n2 4\n","output":"YES\nNO\nYES\n"},{"problem_id":"p01358","input":"3 2 2 10\n1 2 3\n4 5 6\n7 8 9\n1 2 3\n6 5 4\n7 8 9\n11\n4\n7\n5\n10\n9\n2\n1\n3\n8\n","output":"USAGI\n"},{"problem_id":"p01359","input":"4 3\nmeiji 10 1877\ntaisho 6 1917\nshowa 62 1987\nheisei 22 2010\n1868\n1917\n1988\n1 1\nuniversalcentury 123 2168\n2010\n0 0\n","output":"meiji 1\ntaisho 6\nUnknown\nUnknown\n"},{"problem_id":"p01360","input":"1\n12\n123\n369\n6748\n4247219123\n1232123212321232\n#\n","output":"0\n0\n1\n0\n1\n2\n7\n"},{"problem_id":"p01361","input":"1 10\n3 3\nAAA\nABA\nCCC\n3\nA 0\nB 5\nC 9\n3\nD 2\nR 1\nU 2\n5\n10\n10\n10\n10\n10\n100 100\n10 10\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\n8\nT 0\nH 1\nI 2\nS 3\nA 4\nP 5\nE 6\nN 7\n9\nR 1\nD 3\nR 8\nD 2\nL 9\nD 2\nR 9\nD 2\nL 9\n2\n20\n10\n0 0\n","output":"YES\nNO\n"},{"problem_id":"p01362","input":"...\n...\n.*.\n...\n...\n.*.\n...\n...\n...\n...\n...\n.*.\n...\n...\n.*.\n...\n...\n...\n\n...\n.*.\n...\n*..\n...\n..*\n*.*\n*.*\n*.*\n*.*\n.*.\n*.*\n*..\n.*.\n..*\n*.*\n...\n*.*\n\n...\n.*.\n.*.\n...\n.**\n*..\n...\n...\n.*.\n.*.\n...\n*..\n..*\n...\n.**\n...\n*..\n...\n\n#\n","output":"3\n1\n0\n"},{"problem_id":"p01363","input":"1\n1 1\n4 -1 0 -2 -1 -1 -2 0 -1\n1\n0 3\n4 1 1 1 2 -1 2 -1 1\n1\n-6 -6\n6 1 -2 2 -2 2 3 -2 3 -2 1 1 1\n1\n-10 0\n4 0 -5 1 -5 1 5 0 5\n1\n10 1\n4 5 1 6 2 5 3 4 2\n2\n-47 -37\n4 14 3 20 13 9 12 15 9\n4 -38 -3 -34 -19 -34 -14 -24 -10\n0\n","output":"1.00000000\n0.00000000\n3.23606798\n5.00000000\n1.00000000\n11.78517297\n"},{"problem_id":"p01364","input":"1 1\n180 90 2\n1 1\n180 180 20\n2 10\n360 -360 5\n-90 360 8\n3 2\n100 60 9\n-72 -72 10\n-45 -225 5\n0 0\n","output":"3.00000\n3.00000\n0.00000\n62.83185\n12.00000\n0.00000\n-2.44505\n13.12132\n"},{"problem_id":"p01365","input":"2\n0 0\n2\n-5 5 0\n5 5 10\n1\n0 6\n2\n5 5 0\n-5 5 10\n1\n6 10\n1\n7 -65\n2\n-65 10 0\n65 1 3\n2\n0 1\n23 24\n2\n0 0\n2\n100 10 0\n-10 10 10\n5\n0 1\n2 3\n4 5\n6 7\n8 9\n2\n10 0 0\n0 10 10\n5\n1 2\n3 4\n5 6\n7 8\n9 10\n0\n","output":"9.00000000\n2.00000000\n5.98862017\n"},{"problem_id":"p01366","input":"3 3\n1 2 1 2\n2 3 2 1\n3 1 3 2\n5 5\n1 2 2 2\n2 3 1 1\n1 4 1 1\n4 5 1 1\n5 3 1 1\n5 10\n1 2 32 10\n1 3 43 43\n1 4 12 52\n1 5 84 23\n2 3 58 42\n2 4 86 99\n2 5 57 83\n3 4 11 32\n3 5 75 21\n4 5 23 43\n5 10\n1 2 1 53\n1 3 1 65\n1 4 1 24\n1 5 1 76\n2 3 1 19\n2 4 1 46\n2 5 1 25\n3 4 1 13\n3 5 1 65\n4 5 1 34\n0 0\n","output":"3\n5\n137\n218\n"},{"problem_id":"p01367","input":"3 300\n100 50 150\n100 50 150\n100 50 150\n3 300\n100 50 150\n100 50 150\n200 50 150\n9 18\n3 1 1\n3 1 1\n3 1 1\n4 100 1\n5 100 1\n5 100 1\n10 5 3\n10 5 3\n1 7 1000\n10 18\n1 2 3\n2 3 4\n3 4 5\n4 5 6\n5 6 7\n6 7 8\n7 8 9\n8 9 10\n9 10 11\n10 11 12\n0 0\n","output":"2\n3\n3\n4\n"},{"problem_id":"p01368","input":"3 2 3\n0 1 10\n1 2 10\n0 0\n1 10\n2 0\n3 2 4\n0 1 10\n1 2 10\n0 0\n1 10\n2 20\n0 40\n10 10 10\n0 1 39\n2 3 48\n3 5 20\n4 8 43\n3 9 10\n8 9 40\n3 4 5\n5 7 20\n1 7 93\n1 3 20\n0 0\n1 100000000\n2 100\n3 543\n4 500\n5 400\n6 300\n7 200\n8 100\n9 100\n0 0 0\n","output":"2\n1\n4\n"},{"problem_id":"p01388","input":"KUPCkupcKUPC\n","output":"2\n"},{"problem_id":"p01389","input":"3 3\n023\n321\n120\n","output":"5\n"},{"problem_id":"p01391","input":"8 2\n1 2 7 8\n4 5 7 8\n","output":"01010101\n"},{"problem_id":"p01392","input":"18 2\n","output":"4\n"},{"problem_id":"p01393","input":"2 1\n10 10 10\n-10 10 10\n","output":"0.50\n"},{"problem_id":"p01395","input":"1 100\n1 1 1\n","output":"100.0\n"},{"problem_id":"p01396","input":"3 3\n1 3 2\n7 9 8\n4 6 5\n","output":"YES\n"},{"problem_id":"p01397","input":"5 5\n0 2 0 2 0\n2 0 0 0 2\n0 0 0 0 0\n2 0 0 0 2\n0 2 0 2 0\n","output":"5\n"},{"problem_id":"p01398","input":"1\ntojxo\n1 4\n5\nuhcqmlmkv\n4 5\n6 9\n3 6\n1 7\n3 6\n5\nshzxadexonr\n8 9\n3 9\n5 8\n4 9\n10 11\n0\n","output":"aojwo\nshinryaku\nshitadegeso\n"},{"problem_id":"p01399","input":"3 100\n3 7 4\n5 24\n4 6 12 3 8\n5 1\n1 1 2 2 3\n0 0\n","output":"2\n4\n5\n"},{"problem_id":"p01400","input":"4 4\nA B G\nA B 40 3\nB C 80 0\nA G 40 0\nB G 80 0\n5 6\nKusatsu Tokyo Aizu\nTokyo Nagoya 120 3\nKusatsu Nagoya 40 0\nKusatsu Kanazawa 40 0\nKanazawa Aizu 40 0\nTokyo Kanazawa 40 0\nTokyo Aizu 80 4\n0 0\n","output":"5\n4\n"},{"problem_id":"p01401","input":"10 10\nS . . . . . . . . .\n. . . . . . . . . .\n. . . . 1 . . . . .\n. . . . . . . . . .\n. . . . . . . . . .\n. . . . . . . 3 . .\n. . . . . . . . . .\n. . . . . 4 . . . .\n. . . . . . . . . .\n2 . . . . . . . . G\n10 10\nS . . . . . 3 . . .\n. . 3 . . . . . . .\n. . . . 1 . . . . .\n. . . . . . 4 . . .\n. . 3 . . . 1 . . .\n. . . . . . . 3 . .\n. . . . . . . . . .\n. . . . . 4 . . . .\n. . . . . 5 . . . .\n2 . . . . . . . . G\n10 10\nS . . . . . . . . 1\n. . . . . 5 . . . .\n. 4 . . . . . . . .\n. . . . 8 . 9 . . .\n. . . . 10 . . . . .\n. . 7 . G . . . . .\n. . . 11 . . . . . .\n3 . . . . . . . . 6\n. . . . . . . 2 . .\n. . . . . . . . . .\n0 0\n","output":"38\n36\n71\n"},{"problem_id":"p01402","input":"100 2 2 2\nA 5 6\nB 7 8\nC 1 2\nD 3 4\n27 2 3 3\nA 8 10\nB 8 10\nC 6 7\nD 5 4\nE 8 9\n27 2 3 2\nA 8 10\nB 8 10\nC 6 7\nD 5 4\nE 8 9\n44 3 6 5\nYamatoNoHito 9 10\nZettoNoHito 9 10\nTMR 10 10\nSkillNoGroup 8 10\nNanaSama 6 9\nFRPSD 6 8\nMagi3rdDeshi 5 7\nMagi13thDeshi 2 2\nMagicalItoh 4 6\n0 0 0 0\n","output":"20\n30\n31\n55\n"},{"problem_id":"p01403","input":"2\n3\n5\n","output":"5\n11\n"},{"problem_id":"p01404","input":"3 3\n1 1 900\n0 10 0\n10 45 10\n10 0 0\n3\n5 1 1\n50 1 0\n100 0 1\n5 5\n2 0 9000\n0 0 4 0 0\n0 3 3 3 0\n2 2 2 2 2\n0 0 1 0 0\n0 0 1 0 0\n4\n5 2 0\n10 2 1\n100 2 2\n250 2 3\n0 0\n","output":"5\n5\n8\n30\n5\n13\n4\n"},{"problem_id":"p01405","input":"4\n2 1\n0 1 a\n2 2\n0 1 a\n0 1 b\n5 5\n0 1 a\n0 2 b\n1 3 a\n2 3 c\n3 4 e\n3 3\n0 1 aa\n0 2 bce\n1 2 a\n2 4\n0 1 abc\n0 1 def\n0 1 ghi\n0 1 jkl\n2 4\n0 1 ghi\n0 1 jkl\n0 1 mno\n0 1 pqr\n6 7\n0 1 haru\n0 1 natsu\n1 2 wa\n2 3 ake\n2 4 saron\n3 5 bono\n4 5 pusu\n5 4\n0 1 haruw\n1 2 aakeb\n2 3 o\n3 4 no\n","output":"1\n1\n2\n1\n"},{"problem_id":"p01406","input":"3\n3\n17 12 7 340 180\n26 22 10 150 270\n27 13 5 100 230\n3\n0 0 8 0 90\n10 10 8 180 0\n50 50 5 180 270\n2\n10 10 5 0 270\n0 0 30 0 90\n","output":"3\n2\n2\n"},{"problem_id":"p01407","input":"3 10 150 250\n100 20 123\n201 10 67\n202 10 45\n","output":"190\n"},{"problem_id":"p01408","input":"4 3\n1 2\n1 3\n1 4\n","output":"3\n1\n"},{"problem_id":"p01409","input":"ICPC\nCPCPC\n","output":"10\n"},{"problem_id":"p01410","input":"3\n10 40\n10 40\n20 30\n","output":"80\n"},{"problem_id":"p01411","input":"9 4 3 2 1\n2 1\n7 3\n","output":"0.571428571\n"},{"problem_id":"p01412","input":"4\n7\n5\n10\n6\n","output":"5\n6\n7\n10\n"},{"problem_id":"p01413","input":"2 2 100 20\nalfalfa 10 10\ncarrot 5 10\n1 1 6\ncarrot 4\n1 -3 0\nalfalfa 5\n","output":"170\n"},{"problem_id":"p01414","input":"2\n4 4\n1 1\nRRRR\nRRGR\nRBRR\nRRRR\n","output":"3\n"},{"problem_id":"p01415","input":"1 1 1 2 3 100\n50\n","output":"49.500000000\n"},{"problem_id":"p01416","input":"5 10\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....\n","output":"4\n"},{"problem_id":"p01417","input":"3 2\n0 0 0\n10 10 10\n100 100 100\n","output":"30000.00000000000000000000\n"},{"problem_id":"p01418","input":"3 0 2\n0.10000000000\n0.50000000000\n1.00000000000\n","output":"0.900000\n"},{"problem_id":"p01419","input":"1 3 2\n...\n1 1 1\n1 2 1\n1 1 1\n0 0\n0 2\n","output":"7\n"},{"problem_id":"p01420","input":"2 2 50\n30 50 1\n30 50 2\n","output":"0.28770000\n0.71230000\n"},{"problem_id":"p01421","input":"2 1\n2 1\n2 1\n","output":"1\n0\n"},{"problem_id":"p01422","input":"3\n6 11 12\n","output":"0.090909090909\n"},{"problem_id":"p01423","input":"3 3\n1 2 3\n2 3 1\n3 1 2\n","output":"6\n"},{"problem_id":"p01424","input":"2 2\nab\nba\n1 1\n1 2\n","output":"4\n"},{"problem_id":"p01425","input":"0 7 3 1\n","output":"Yes\n"},{"problem_id":"p01426","input":"2 3\n1.0 1.0\n-1.0 0.0\n0.5 0.5\n","output":"1.0\n"},{"problem_id":"p01427","input":"3 5\n##..#\n#..##\n####.\n","output":"4\n"},{"problem_id":"p01428","input":"ooox....\n.x......\nooo.....\n........\n........\n........\n........\n........\n","output":"ooooo...\n.o......\nooo.....\n...o....\n....o...\n........\n........\n........\n"},{"problem_id":"p01429","input":"4 5 99\n1 4 5 3\n100 200 300 400 500\n","output":"37\n"},{"problem_id":"p01430","input":"2 1 2\n1 2\n2 1 2\n1 2 1\n","output":"0\n1\n"},{"problem_id":"p01431","input":"3 4\n.##.\n#??#\n.#?#\n","output":"8\n"},{"problem_id":"p01432","input":"6 6 1\n","output":"6.00000000\n"},{"problem_id":"p01433","input":"4 5 25\n0 10\n10 0\n20 0\n30 10\n","output":"Red\n"},{"problem_id":"p01434","input":"2 3\n1 8\n20 5\n3\n7\n15\n","output":"10\n"},{"problem_id":"p01435","input":"3 1 3\n1 1 0\n3 2 1 2\n","output":"2\n"},{"problem_id":"p01436","input":"4 4\n.S..\nK...\n....\n..sk\n","output":"9\n"},{"problem_id":"p01437","input":"3 3 10\nE..\n.#.\n...\n5 5 19\n####.\n.....\n.#S#.\n...#.\n#.##.\n5 5 6\n#.#..\n#....\n##.#.\n#..S.\n#....\n5 4 35\n..##\n....\n.##.\n.#S.\n...#\n0 0 0\n","output":"1 3 E\n4 5 S\n4 4 E\n1 1 N\n"},{"problem_id":"p01438","input":"2\n2 100\n10 12\n14 16\n2 200\n12 13\n18 20\n4\n1 100\n6 22\n1 1000\n6 22\n1 10000\n6 22\n1 100000\n6 22\n16\n1 100000000\n6 7\n1 100000000\n7 8\n1 100000000\n8 9\n1 100000000\n9 10\n1 100000000\n10 11\n1 100000000\n11 12\n1 100000000\n12 13\n1 100000000\n13 14\n1 100000000\n14 15\n1 100000000\n15 16\n1 100000000\n16 17\n1 100000000\n17 18\n1 100000000\n18 19\n1 100000000\n19 20\n1 100000000\n20 21\n1 100000000\n21 22\n0\n","output":"300\n100000\n1600000000\n"},{"problem_id":"p01439","input":"6\nonetwo2\n-\nonetwo1\nonetwo2\n-\nonetwo1\n7\nv\ntopbottom2\nonetwo2\n-\nonetwo1\ntopbottom1\n-\n6\nbaz2\nfoo2\nbaz1v\nbar2\nfoo1\nbar1\n0\n","output":"2\n3\n1\n5\n6\n4\n4\n5\n3\n6\n2\n1\n7\n5\n2\n6\n4\n3\n1\n"},{"problem_id":"p01440","input":"45678\n67891011\n21\n314159265358979\n#\n","output":"4\n6\n15\n2012778692735799\n"},{"problem_id":"p01441","input":"a\nQMAClone\nacmicpc\nabcdefgha\nabcdefgdhbi\nabcbcd\n#\n","output":"No Results\n9\n7\n9\n12\n6\n"},{"problem_id":"p01442","input":"2 2 1\nL\nG.\n#S\n2 2 2\nRR\nG.\n.S\n3 3 6\nLLLLLL\nG#.\n...\n.#S\n0 0 0\n","output":"Yes\nNo\nYes\n"},{"problem_id":"p01443","input":"1 10 1000\n1 100000 1000000000\n999999999 1000099998 1000000000\n0 0 0\n","output":"513\n899507743\n941554688\n"},{"problem_id":"p01444","input":"1\n1 1\n10 -480\n2\n6 7\n5 5\n4 1\n3\n10 5\n4 4\n8 4\n2 0\n0\n","output":"Yes\nYes\nNo\n"},{"problem_id":"p01445","input":"3 3\n1 2 x+2\n2 3 2x+1\n3 1 x+1\n2 0\n3 2\n1 2 x\n2 3 2\n4 3\n1 2 x^3+2x^2+3x+4\n2 3 x^2+2x+3\n3 4 x+2\n0 0\n","output":"2x+3\n0\n2\nx+2\n"},{"problem_id":"p01446","input":"2\n5\n0 0\n10 0\n20 0\n30 0\n30 10\n4\n1 2\n2 3\n3 4\n4 5\n2\n1 2 4\n3 2 2\n5\n-10 0\n0 0\n0 -10\n0 -20\n0 -30\n4\n1 2\n2 3\n3 4\n4 5\n1\n4 1 3\n1 1\n2 1\n4\n3\n4 3\n0 0\n5 0\n2\n1 2\n2 3\n0\n3\n0 0\n3 4\n0 5\n2\n1 2\n1 3\n1\n2 3 4\n4\n0 13\n0 0\n13 0\n13 13\n4\n1 2\n1 4\n2 3\n2 4\n0\n4\n5 12\n0 0\n-7 17\n-12 5\n4\n1 2\n2 3\n2 4\n4 3\n0\n1 1\n4 1\n4\n3\n0 0\n2 0\n0 4\n2\n1 2\n1 3\n0\n3\n0 0\n-2 0\n0 4\n2\n1 2\n1 3\n1\n1 4 1\n3\n0 0\n1 0\n0 2\n2\n1 2\n1 3\n1\n1 4 1\n3\n0 0\n2 0\n0 4\n2\n1 2\n2 3\n0\n1 1\n4 1\n0\n","output":"10.0000000000\n41.3847763109\n-1.000000000\n"},{"problem_id":"p01447","input":"8\n","output":"2\n"},{"problem_id":"p01448","input":"4\n2 5\n4 7\n2 4\n3 6\n","output":"3\n"},{"problem_id":"p01449","input":"11\n0\n0\n-2\n0\n-4\n1\n-1\n2\n0\n0\n0\n","output":"3\n"},{"problem_id":"p01450","input":"4 8\n1\n2\n7\n9\n","output":"2\n"},{"problem_id":"p01451","input":"2 2\n0 0\n1 1\n2 0\n2 -1\n","output":"2.414213562373\n"},{"problem_id":"p01452","input":"6 4 0\n","output":"210\n"},{"problem_id":"p01453","input":"8 6\n########\n#..##g.#\n#*#.*#.#\n#......#\n#*s#*.*#\n########\n","output":"5.857142857143\n"},{"problem_id":"p01454","input":"4 3 12\n3 6\n2 4\n7 9\n10 1\n6 5\n8 4\n15 19\n","output":"2\n"},{"problem_id":"p01455","input":"4 3\nhuda\nleide\nloar\nsheza\nhuda leide\nleide loar\nloar sheza\n","output":"10\n"},{"problem_id":"p01456","input":"6 5\n7\n14\n5\n11\n2\n5\n1 2\n2 3\n3 4\n4 5\n5 6\n","output":"2\n"},{"problem_id":"p01457","input":"3\n0 ( 10\n10 ) 5\n10 ) 5\n","output":"No\nNo\nYes\n"},{"problem_id":"p01458","input":"2 10 2\nhello\nworld\n","output":"helloworld\n"},{"problem_id":"p01459","input":"3 3 2\nS#.\n...\n.#G\n","output":"2\n"},{"problem_id":"p01460","input":"2 1 3 6 12 1 2 1 2\nWR 1 1 1\n","output":"676573821\n"},{"problem_id":"p01461","input":"4\n2 3\n4 4\n4 4\n","output":"6\n"},{"problem_id":"p01462","input":"3 3 50\n1 2\n2 3\n3 1\n","output":"0.500000000000\n"},{"problem_id":"p01463","input":"2\n0 0\n15 0\n5 0 1\n10 10 2\n","output":"5.0\n"},{"problem_id":"p01464","input":"5 5\n1 2\n2 3\n3 4\n4 5\n1 3\n","output":"Yes\n"},{"problem_id":"p01465","input":"(x1&x2)\n","output":"1\n"},{"problem_id":"p01466","input":"4 6\n1 1 1 1\n1 1 1 1\n1 1 2 1 1\n1 1 3 1 2\n1 1 4 1 1\n2 1 3 1 1\n2 1 4 1 2\n3 1 4 1 1\n","output":"4\n"},{"problem_id":"p01467","input":"99 98 1\n","output":"1\n"},{"problem_id":"p01468","input":"4\n2 0 2 25\n0 30 15 20\n16 20 5 15\n23 0 23 30\n","output":"0.41380294\n"},{"problem_id":"p01469","input":"3\n25 125 5\n","output":"1\n"},{"problem_id":"p01470","input":"4\n1 1\n4 2\n2 4\n3 4\n","output":"-14\n"},{"problem_id":"p01471","input":"1 1\n3 1\n","output":"0.333333\n"},{"problem_id":"p01472","input":"2 0\n1 3\n1 1\n","output":"Second\n3\n"},{"problem_id":"p01473","input":"ab\n","output":"0\n"},{"problem_id":"p01474","input":"3 1 1 1\n1 3\n","output":"2\n"},{"problem_id":"p01475","input":"1\n1 0 1 0 0 -1\n1 -1 0\n","output":"4\n"},{"problem_id":"p01476","input":"5\n0 1 2 8\n0 2 3 9\n0 2 2 11\n1 2 2 7\n0 1 3 7\n","output":"YES\n"},{"problem_id":"p01477","input":"2 1\n1 -2\n","output":"3\n"},{"problem_id":"p01478","input":"3\n0 1 3\n1 0 8\n3 8 0\n","output":"5\n"},{"problem_id":"p01479","input":"eggchickenegg\n","output":"egg\n"},{"problem_id":"p01480","input":"2\n4 2\n4 0.4000000\n3 0.5000000\n4 1\n5 0.3333333\n5 3\n5 0.7777777\n4 0.1111111\n2 0.0001111\n","output":"YES\n"},{"problem_id":"p01481","input":"10 10\n.....#....\n.....#....\n.....#....\n######....\n..........\n####......\n....###...\nt..#..####\n...##.....\n....#...##\n3\n0 3\n0 5\n4 6\n","output":"2\n"},{"problem_id":"p01482","input":"100\nA=malloc(10)\nB=clone(A)\nfree(A)\n","output":"0\n"},{"problem_id":"p01483","input":"3 3 2\n1 1\n2 1 1\n3 1 1 1\n","output":"8\n"},{"problem_id":"p01484","input":"5 3 2\naaaaa\naaa\naab\n","output":"1 6\n"},{"problem_id":"p01485","input":"2\n0 0 5 0 10\n1 0 6 0 10\n1\n0.000000 0.000000\n6.000000 0.000000\n","output":"2\n"},{"problem_id":"p01486","input":"mmemewwemeww\n","output":"Cat\n"},{"problem_id":"p01487","input":"8 5\n1 2\n6 5\n6 4\n1 3\n4 7\n","output":"11\n"},{"problem_id":"p01488","input":"2 10\nWarsaw Petersburg\n3\nKiev Moscow Petersburg\n150 120\n3\nMoscow Minsk Warsaw\n100 150\n","output":"380 1\n"},{"problem_id":"p01489","input":"5\n","output":"5\n"},{"problem_id":"p01490","input":"4\n5\n8\n58\n85\n","output":"2970.000000000\n"},{"problem_id":"p01491","input":"2 3 1 3 1 0\n","output":"2\n"},{"problem_id":"p01492","input":"4\n","output":"4\n0 0\n1 0\n2 0\n1 1\n"},{"problem_id":"p01493","input":"3\nNNN\nNNN\nNNN\n","output":"Taro\n"},{"problem_id":"p01494","input":"3 3 1\n0 0\n","output":"4\n"},{"problem_id":"p01495","input":"3 1 0 1\n","output":"18\n"},{"problem_id":"p01496","input":"3 40\n.a....a....a....a....f....f....f....f...\n#bc#.#cd#.#de#.#eb#.#cb#.#dc#.#ed#.#be#.\n.#....#....#....#....#....#....#....#...\n","output":"Yes\n"},{"problem_id":"p01497","input":"4 4 4 4\n4 4 4 4\n4 4 4 4\n4 4 4 4\n","output":"1\n"},{"problem_id":"p01498","input":"4 3 3\n1 1\n1 3\n3 1\n3 3\n","output":"3\n"},{"problem_id":"p01499","input":"3 1\n1\n2\n3\n","output":"4\n"},{"problem_id":"p01500","input":"6 3 1.0\n1 2 3\n4 5 6\n0 0\n1 0\n2 0\n0 1\n1 1\n2 1\n","output":"3\n"},{"problem_id":"p01501","input":"4 1\n0 0\n3 0\n3 3\n0 3\n1 1\n","output":"2.0000000000\n"},{"problem_id":"p01502","input":"3\n0 2 7\n2 0 4\n5 8 0\n","output":"11\n"},{"problem_id":"p01503","input":"1 1 1 1 1\n","output":"0.000000000000\n"},{"problem_id":"p01504","input":"2 2 1\n1 2 1\n1\n2\n4 3 2\n1 2 1\n1 3 2\n1 4 3\n2\n3\n4\n0 0 0\n","output":"Case 1: 1\nCase 2: 3\n"},{"problem_id":"p01505","input":"2\n3\n2 1\n4\n9\n2 4\n8 5 3\n7 1 6 10\n0\n","output":"Case 1: 1\nCase 2: 13\n"},{"problem_id":"p01506","input":"0 1000 10\n1 1000 10\n0 0 0\n","output":"Case 1: 1\nCase 2: 10\n"},{"problem_id":"p01507","input":"2 2\n..\n..\n3 3\n...\n...\n..#\n0 0\n","output":"Case 1: 4\nCase 2: 56\n"},{"problem_id":"p01508","input":"4\n0 0\n10 0\n10 10\n0 10\n3\n0 0\n1 0\n0 1\n0\n","output":"Case 1: 14.142135624\nCase 2: 1.41421356\n"},{"problem_id":"p01509","input":"C4C4G4G4A4A4G2F4F4E4E4D4D4C2\nO4C4.C8F4.F8G8F8E8D8C2\nB-8>C8<B-8V40R2R..R8.V100EV50L1CG\n*\n","output":"Case 1: CCGGAAG2FFEEDDC2\nCase 2: C.C8F.L8FGFEDC2\nCase 3: L8B-B+B-RL1RE4V50CG\n"},{"problem_id":"p01510","input":"2 1\n1 3\n0 1\n1 0\n3 3\n1 2 4\n0 2 0\n2 0 1\n0 1 0\n0 0\n","output":"Case 1:\n0.75 0.25\nCase 2:\n1.5 1.5 0.0\n"},{"problem_id":"p01511","input":"2 4 1\n2 1\n2 2 1\n2 2\n0 0 0\n","output":"Case 1: 4\nCase 2: 0\n"},{"problem_id":"p01512","input":"3 1\n1\n2\n3 2\n1\n1\n10 4\n1\n1\n2\n3\n3\n4\n4\n4\n5\n0 0\n","output":"Case 1:\n3\n2\n3\nCase 2:\n2\n2\n2\nCase 3:\n2\n2\n2\n2\n2\n2\n2\n2\n2\n3\n"},{"problem_id":"p01520","input":"2 10 2\n3 4\n","output":"2\n"},{"problem_id":"p01521","input":"oxxoxoo\n","output":"o\n"},{"problem_id":"p01522","input":"6 2\n2 1 5\n4 2 3 4 6\n2\n1 2\n2 5\n","output":"0\n"},{"problem_id":"p01523","input":"8 4\n3 7\n1 5\n2 5\n4 8\n","output":"2\n"},{"problem_id":"p01525","input":"3 11\n1 0 2\n4 1 3\n7 2 4\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n","output":"1\n3\n4\n0\n1\n3\n5\n7\n11\n19\n29\n46\n47\n48\n"},{"problem_id":"p01526","input":"5 3.000\n1.000 0.000\n0.000 0.000\n-1.000 0.000\n10.000 0.000\n-10.000 0.000\n","output":"3\n"},{"problem_id":"p01527","input":"4 4\n0 0 0 1\n0 1 1 0\n0 1 1 0\n1 0 0 0\n","output":"1 0 0 0\n0 0 0 0\n0 0 0 0\n0 0 0 1\n"},{"problem_id":"p01529","input":"3\n1 2 3\n","output":"9\n"},{"problem_id":"p01530","input":"5 5 3\n0 1 7\n1 2 22\n2 3 128\n3 4 128\n4 2 128\n0 1\n0 0\n3 4\n","output":"135\n128\n128\n"},{"problem_id":"p01531","input":"5R2D\n","output":"neko\n"},{"problem_id":"p01532","input":"3 0 0 100\n4 0\n3 0\n3 0\n","output":"2\n"},{"problem_id":"p01533","input":"3 4\nS.M\n...\n...\nM.G\n","output":"9\n"},{"problem_id":"p01534","input":"1 5\n2 3 8\n","output":"10\n"},{"problem_id":"p01535","input":"1\nindex.dml\n<dml><title>Markup language has Declined<\/title><br>Programmers world<\/dml>\n1\n15 3 0 index\n","output":"Markup language\n has Declined..\nProgrammers wor\n"},{"problem_id":"p01536","input":"4\n1 1 1 3 3 3 5 5 5 7 7 7 9\n","output":"8\n9\n"},{"problem_id":"p01537","input":"3 3\n25 100 10\n8\n-10 0\n-2 2\n0 10\n2 2\n10 0\n2 -2\n0 -10\n-2 -2\n4\n30 0\n50 0\n50 40\n30 40\n3\n30 -10\n45 -70\n60 -10\n","output":"3\n1\n2\n"},{"problem_id":"p01538","input":"3\n9\n99\n123\n","output":"0\n2\n3\n"},{"problem_id":"p01539","input":"0 0 0 2\n0\n2 2\n","output":"0\n"},{"problem_id":"p01540","input":"3 1\n1 1\n2 4\n5 3\n0 0 5 5\n","output":"3\n"},{"problem_id":"p01541","input":"100\n2\n1\n2\n0\n","output":"201\n"},{"problem_id":"p01542","input":"000\n","output":"0\n"},{"problem_id":"p01543","input":"3\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\no.o\n...\n.o.\n","output":"2\n2\n1 3 erase\n2 3 write\n"},{"problem_id":"p01544","input":"3\n1\n2\n4\n","output":"3\n1 2\n"},{"problem_id":"p01545","input":"4\n1 4 2 3\n","output":"4\n"},{"problem_id":"p01546","input":"3 9 89\n2 0 2\n1 0 3\n2 0 1\n2 0 3\n0 1 1\n0 1 2\n1 2 3\n0 1 1\n1 0 2\n","output":"34\n1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 0\n"},{"problem_id":"p01547","input":"2\n4\n0 4\n1 1\n3 1\n4 4\n3\n6 0\n10 0\n8 7\n1\n2 3 9 1\n","output":"2\n"},{"problem_id":"p01548","input":"4 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n","output":"2.777777777778\n"},{"problem_id":"p01549","input":"1\na 1 10\n3\n10 a \/\n","output":"correct\n"},{"problem_id":"p01550","input":"2\n1\n2\n","output":"36\n"},{"problem_id":"p01551","input":"1 0 1 0\n3\ndna: a b\na: [AT]\nb: [GC]\n","output":"1\n"},{"problem_id":"p01552","input":".tweets.1\nname: shimeji\nid: shimejitan\ntweets:\n  1: shimejilove\n  2: azupero\n","output":"string \"shimejilove\"\n"},{"problem_id":"p01553","input":"3\n-\nU\nD\n","output":"1\n"},{"problem_id":"p01554","input":"4\nabcd\nefgh\nijkl\nmnop\n5\nabcd\nabcc\nefgh\nabcd\nmnop\n","output":"Opened by abcd\nUnknown abcc\nClosed by efgh\nOpened by abcd\nClosed by mnop\n"},{"problem_id":"p01555","input":"1\n","output":"12Fizz4BuzzFizz78Fiz\n"},{"problem_id":"p01556","input":"4\n100 100\n0 100\n0 0\n100 0\n","output":"50.00000 50.00000\n"},{"problem_id":"p01557","input":"5\n1 4 3 5 2\n","output":"2\n"},{"problem_id":"p01558","input":"5 4\nabcde\nR++\nR++\nL++\nL--\n","output":"3\n"},{"problem_id":"p01559","input":"3 0\n","output":"6\n"},{"problem_id":"p01560","input":"2 15\n3 5\n50 50\n","output":"3.75\n"},{"problem_id":"p01561","input":"6 6\n######\n#_|A%#\n#B#_|#\n#^BBa#\n#B&A##\n######\n2\n######\n#*|*.#\n#.#.|#\n#*.**#\n#...##\n######\n######\n#*|*.#\n#*#.|#\n#..**#\n#..*##\n######\n","output":"21\n"},{"problem_id":"p01562","input":"5\n0 0\n1 1\n1 0\n0 1\n0 0\n","output":"0.5\n"},{"problem_id":"p01563","input":"2 4\nACM\nICPC\n","output":"2\n"},{"problem_id":"p01564","input":"3 4\n1 2 3\n1 2\n2 3\n2 1 3 0\n1 2 2 -4\n2 1 3 0\n2 2 2 0\n","output":"6\n3\n-4\n"},{"problem_id":"p01565","input":"1 3\n+++\n6\n5\n4\n3\n2\n1\n1 3\n1 1\n","output":"621\n"},{"problem_id":"p01566","input":"3 3\n4 2 2 0 0 0 0 0 0 0 0 1\n","output":"2\n"},{"problem_id":"p01567","input":"((()())(((()())(()()))()))\n","output":"3\n"},{"problem_id":"p01568","input":"1 2\n0 0 10 0\n1 0\n9 0\n0 0\n5 0\n","output":"9.0\n"},{"problem_id":"p01569","input":"9\n2 1\n1 -1\n1 -1\n1 -1\n1 -1\n0 1\n0 1\n0 1\n0 1\n","output":"Yes 2\n"},{"problem_id":"p01570","input":"3\n3 -1\n4 0\n5 0\n","output":"4\n"},{"problem_id":"p01571","input":"1 5\nqwerty asdf zxcv\nqwert\nasf\ntyui\nzxcvb\nghjk\n","output":"3\n"},{"problem_id":"p01572","input":"2\n8 -1 2 1 2 1 -3 2 -3 2 3 -2 3 -2 -3 -1 -3\n","output":"22.6303\n"},{"problem_id":"p01573","input":"4\n-2 0 0 0 2\n","output":"4\n-1 -i i 1\n"},{"problem_id":"p01574","input":"6 2\n2\n5\n","output":"Yes\n"},{"problem_id":"p01575","input":"2 2 2\n","output":"0\n"},{"problem_id":"p01576","input":"5 10\n0 0\n10 10\n20 0\n30 10\n40 0\n","output":"22.22335598\n"},{"problem_id":"p01577","input":"5\n2 0\n0 1\n1 3\n4 2\n3 4\n","output":"7.5\n"},{"problem_id":"p01578","input":"3\n1 2 3\n","output":"0\n"},{"problem_id":"p01579","input":"((()())())\n","output":"10\n"},{"problem_id":"p01580","input":"2\n1 0 0\n0 1 0\n40\n","output":"1\n"},{"problem_id":"p01591","input":"4\n0 0\n100 0\n100 100\n0 100\n","output":"-100.000 -100.000 0.000\n"},{"problem_id":"p01592","input":"1 1\n1 1\n","output":"Bob\n"},{"problem_id":"p01593","input":"2 1\n","output":"0.50000000\n"},{"problem_id":"p01594","input":"4\n0 0 0\n0 0 1\n0 1 0\n1 0 0\n","output":"2.366\n"},{"problem_id":"p01595","input":"7 8\n##S####\n#.....#\nS.O...#\n#.*|..#\nL..*..#\n#.O*..D\n#.@...#\n#######\n","output":"Yes\n"},{"problem_id":"p01596","input":"5\n0 1 0 2\n1 3 2 3\n2 2 1 2\n1 1 2 1\n2 0 1 0\n","output":"9.712\n"},{"problem_id":"p01597","input":"4\n0 0 2 1\n3 0 4 2\n0 2 1 4\n2 3 4 4\n","output":"4\n"},{"problem_id":"p01598","input":"4 4\n1 3 4 2\n1 4 2 3\n1 3 2 4\n","output":"Yes\n"},{"problem_id":"p01599","input":"1 1\n10 100 0\n10 100 0\n","output":"10\n"},{"problem_id":"p01600","input":"5\n1 5\n2 4\n3 3\n4 2\n5 1\n","output":"12\n"},{"problem_id":"p01601","input":"13\n","output":"11\n"},{"problem_id":"p01602","input":"3\n( 5\n) 4\n) 1\n","output":"YES\n"},{"problem_id":"p01603","input":"4 5\n1 2 1 4 7\n2 3 1 2 77\n2 4 1 2 777\n","output":"1568\n"},{"problem_id":"p01604","input":"2\nLOOP:\ngoto LOOP;\n","output":"1\n"},{"problem_id":"p01605","input":"abaz\n3 1 5\na cab\nb .\nc x\n","output":"xaxaz\n"},{"problem_id":"p01606","input":"10 2\n","output":"2 3 3 3 3 3 3 3 3\n"},{"problem_id":"p01607","input":"3 1\n0 0\n1 0\n0 1\n","output":"0.500000000\n"},{"problem_id":"p01608","input":"4 1\n3 1 2 7\n13 8 25 9\n","output":"1001\n"},{"problem_id":"p01609","input":"20 20 1\n-1 10 10\n","output":"21.520346288593280\n"},{"problem_id":"p01610","input":"R\n","output":"..ry....\n..ry....\nggyobbrw\nggyobbrw\n..ow....\n..ow....\n"},{"problem_id":"p01611","input":"3 4 2\n2\n1\n3\n","output":"bad\n"},{"problem_id":"p01612","input":"5 4\n1 2\n2 3\n3 4\n3 5\n","output":"1\n2\n"},{"problem_id":"p01620","input":"2\n1 2\nbdd\n3\n3 2 1\nDDDA\n5\n3 1 4 5 3\ndcdkIlkP\n0\n","output":"abc\nABCx\nabZfFijL\n"},{"problem_id":"p01621","input":"1 1 3 All All 1 1\n2 37 5 All Night 150 1\n16 2 20 All Day 5 10\n1 14 15 Mon All 20000 100\n0 0 0 None None 0 0\n","output":"1.0000000000\n0.2192439716\n0.9884707850\n0.0649933899\n"},{"problem_id":"p01622","input":"4\n1 1\n3 1\n4 1\n2 1\n3\n5 3\n1 2\n1 2\n1\n1000 1000\n10\n5 62\n10 68\n15 72\n20 73\n25 75\n30 77\n35 79\n40 82\n45 100\n815 283\n6\n74 78\n53 55\n77 77\n12 13\n39 42\n1 1\n0\n","output":"14\n15\n3000\n2013\n522\n"},{"problem_id":"p01624","input":"1 1\n2 2\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #\n","output":"91\n2\n273\n93\n279\n88\n"},{"problem_id":"p01625","input":"3\n2 3 2 2 2 1\n2 0 1 -1 2 -1\n-2 -1 -1 -1 -2 0\n6\n-1 0 1 0 0 -1\n-2 -1 -3 -2 -4 -2\n2 -1 2 0 1 -1\n4 -2 3 -2 3 -1\n1 1 0 1 -1 1\n-3 -1 -1 -1 -2 0\n5\n-1 2 0 2 1 2\n-3 1 -2 1 -2 2\n-2 0 -2 -1 -3 0\n1 -1 0 -1 -1 -1\n1 0 2 0 2 -1\n4\n-2 0 -2 -1 -3 -1\n-1 -1 0 -1 1 -1\n2 -1 2 0 3 -1\n-1 0 0 0 1 0\n5\n-2 1 3 -1 2 1\n-5 2 -5 3 -4 2\n-2 -1 0 -1 -3 -1\n4 2 5 2 5 3\n1 -1 2 -1 -1 -1\n0\n","output":"Remove\n1\nRemove\n2\n6\nValid\nRemove\n1\n2\n3\n4\nInvalid\n"},{"problem_id":"p01626","input":"2\n3\n1 1\n2 2\n1 2\n3\n-1 1\n-1 2\n-2 2\n1 1 2 2\n0 0 0 1\n2\n10\n1 1\n7 1\n7 5\n5 5\n5 3\n6 3\n6 2\n3 2\n3 5\n1 5\n10\n-1 1\n-1 5\n-3 5\n-3 3\n-2 3\n-2 2\n-5 2\n-5 5\n-7 5\n-7 1\n2 4 6 4\n0 0 0 1\n2\n7\n-7 0\n-5 0\n-4 3\n-3 0\n-1 0\n-1 4\n-7 4\n3\n1 0\n7 0\n7 4\n3 1 5 2\n0 0 0 1\n0\n","output":"1.4142135623730951\n8.0\nimpossible\n"},{"problem_id":"p01627","input":"N T\nst_time1 st_name1 ar_time1 ar_name1\nst_time2 st_name2 ar_time2 ar_name2\n...\nst_timeN st_nameN ar_timeN ar_nameN\n","output":"2\nKanazawa 55\nNiitsu 24\n"},{"problem_id":"p01628","input":"5 4\n4\n3\n1\n2\n","output":"3\n"},{"problem_id":"p01629","input":"2 3\n3000 6000 3000\n4000 5500 4500\n","output":"11500 2\n1\n2\n1\n"},{"problem_id":"p01630","input":"N\nbit_line\n","output":"3\n"},{"problem_id":"p01631","input":"6\nAIZU 10\nLINER 6\nLINE 4\nALL 2\nAS 1\nCIEL 10\nASLA\nCILI\nIRZN\nELEU\n21\n","output":"40\n"},{"problem_id":"p01632","input":"3 3\n1 2\n2 3\n3 1\n","output":"No\nNo\nYes\n"},{"problem_id":"p01633","input":"8\n5 0 5 10\n5 10 0 5\n0 5 5 0\n10 0 10 10\n10 10 5 5\n5 5 10 0\n10 2 15 5\n15 5 10 8\n","output":"2\n"},{"problem_id":"p01634","input":"password\n","output":"INVALID\n"},{"problem_id":"p01635","input":"n T\nf(n)\n","output":"101010000\n"},{"problem_id":"p01636","input":"19\n","output":"1\n"},{"problem_id":"p01637","input":"M r\n","output":"9333\n"},{"problem_id":"p01638","input":"r x y n\np\n","output":"71 156\n"},{"problem_id":"p01639","input":"n k x0\n","output":"-768720241707614171\n"},{"problem_id":"p01640","input":"w h g\n","output":"9\n"},{"problem_id":"p01641","input":"ABC\n","output":"++++++++[>++++++++<-]>+.+.+.\n"},{"problem_id":"p01642","input":"1 3\n1 1 1\n","output":"4\n"},{"problem_id":"p01643","input":"n k\na\n","output":"2\n"},{"problem_id":"p01644","input":"N (S\u30ec\u30a2\u30ab\u30fc\u30c9\u306e\u7a2e\u985e)\nP_1 (\u30ab\u30fc\u30c91\u304c\u597d\u304d\u306a\u4eba\u306e\u5272\u5408)\nP_2 (\u30ab\u30fc\u30c92\u304c\u597d\u304d\u306a\u4eba\u306e\u5272\u5408)\n...\nP_N (\u30ab\u30fc\u30c9N\u304c\u597d\u304d\u306a\u4eba\u306e\u5272\u5408)\n","output":"10000\n"},{"problem_id":"p01645","input":"n\ns\n","output":"16\n304\n18\n-1\n7703703700\n7795884765\n"},{"problem_id":"p01646","input":"4\ncba\ncab\nb\na\n3\nbca\nab\na\n5\nabc\nacb\nb\nc\nc\n5\nabc\nacb\nc\nb\nb\n0\n","output":"yes\nno\nyes\nno\n"},{"problem_id":"p01647","input":"SA SK\nDA CA\nSQ SJ ST\nSA HA\nD2 C3\nH4 S5 DA\nHA D9\nH6 C9\nH3 H4 H5\n#\n","output":"1.00000000000000000000\n0.34444444444444444198\n0.63030303030303025391\n"},{"problem_id":"p01648","input":"2 1\n1 2 5\n4 6\n1 2 1\n1 3 2\n1 4 3\n2 3 4\n2 4 5\n3 4 6\n8 17\n1 4 767\n3 1 609\n8 3 426\n6 5 972\n8 1 607\n6 4 51\n5 1 683\n3 6 451\n3 4 630\n8 7 912\n3 7 43\n4 7 421\n3 5 582\n8 4 538\n5 7 832\n1 6 345\n8 2 608\n0 0\n","output":"5\n2\n421\n"},{"problem_id":"p01649","input":"3\n26 16 1 8 4\n10 6\n9 2\n9 10\n3\n71 363 4 8 0\n52 238\n25 33\n59 288\n0\n","output":"3\n-1\n"},{"problem_id":"p01650","input":"3 3\nac#\nb#C\n.BA\n3 3\naaZ\na#Z\naZZ\n3 3\n..#\n.#.\n#..\n1 50\nabcdefghijklmnopqrstuvwxyYXWVUTSRQPONMLKJIHGFEDCBA\n1 50\naAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyY\n1 50\nabcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXY\n1 50\naaaaaaaaaabbbbbbbbbbcccccCCCCCBBBBBBBBBBAAAAAAAAAA\n10 10\n...#......\na###.#####\n.bc...A...\n##.#C#d#.#\n.#B#.#.###\n.#...#e.D.\n.#A..###.#\n..e.c#..E.\n####d###.#\n##E...D.C.\n0 0\n","output":"2\n0\n-1\n25\n25\n1\n25\n4\n"},{"problem_id":"p01651","input":"3\n2\n2\n1\n49\n95351238128934\n95351238128934\n95351238128932\n95351238128936\n95351238128936\n95351238128936\n95351238128960\n95351238128900\n95351238128896\n95351238129096\n95351238128772\n95351238129096\n95351238129096\n95351238126156\n95351238131712\n95351238131712\n95351238149576\n95351238093388\n95351238084040\n95351237962316\n95351238295552\n95351237911684\n95351237911684\n95351235149824\n95351233717380\n95351249496652\n95351249496652\n95351226761216\n95351226761216\n95351082722436\n95351082722436\n95352054803020\n95352156464260\n95348273971200\n95348273971200\n95354202286668\n95356451431556\n95356451431556\n95346024826312\n95356451431556\n95356451431556\n94557999988736\n94256939803780\n94256939803780\n102741546035788\n87649443431880\n87649443431880\n140737488355328\n32684288648324\n64\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n11\n0\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n63\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1\n4\n1\n1\n1\n1\n0\n","output":"1 4\n123456789101112 314159265358979\nNone\n2012 2012\nNone\nMany\n"},{"problem_id":"p01652","input":"2 1\na 11 9\n****.....\n.*.*.....\n.*.*.....\n.*..*....\n.**..*...\n..**..*..\n..*.*....\n..**.*.*.\n..*..*.*.\n..*****.*\n******.**\nb 10 6\n....*.\n....*.\n....*.\n....*.\n....*.\n....*.\n....*.\n....*.\n.**..*\n*****.\n19 55\n*******************************************************\n*.....................................................*\n*.********************.********************...........*\n*.*..................*.*..................*...........*\n*.*.****.............*.*.............****.*.****......*\n*.*..*.*..........*..*.*..*..........*.*..*..*.*......*\n*.*..*.*..........*..*.*..*..........*.*..*..*.*......*\n*.*..*..*.........*..*.*..*.........*..*..*..*..*.....*\n*.*..**..*........*..*.*..*........*..**..*..**..*....*\n*.*...**..*.......*..*.*..*.......*..**...*...**..*...*\n*.*...*.*.........*..*.*..*.........*.*...*...*.*.....*\n*.*...**.*.*......*..*.*..*......*.*.**...*...**.*.*..*\n*.*...*..*.*......*..*.*..*......*.*..*...*...*..*.*..*\n*.*...*****.*..**..*.*.*.*..**..*.*****...*...*****.*.*\n*.*.******.**.*****..*.*..*****.**.******.*.******.**.*\n*.*..................*.*..................*...........*\n*.********************.********************...........*\n*.....................................................*\n*******************************************************\n2 3\na 2 3\n.*.\n***\nb 3 3\n.*.\n***\n.*.\n2 3\n.*.\n***\n4 3\n***\n*.*\n*.*\n***\n9 13\n************.\n*..........*.\n*.......*..*.\n*...*..***.*.\n*..***.....*.\n*...*......*.\n*..........*.\n************.\n.............\n3 1\na 2 2\n.*\n**\nb 2 1\n*\n*\nc 3 3\n***\n*.*\n***\n11 16\n****************\n*..............*\n*....*********.*\n*....*.......*.*\n*.*..*.***...*.*\n*.**.*.*.*.*.*.*\n*....*.***.*.*.*\n*....*.......*.*\n*....*********.*\n*..............*\n****************\n0 0\n","output":"[[ab][ab]a]\n#\na\n[]\n[ba]\n#\n[[cb]a]\n#\n"},{"problem_id":"p01653","input":"3 2 2 3 1\n1 2 1\n1 3 2\n4 3 1 4 2\n2 1 3\n2 3 x\n4 3 x\n0 0 0 0 0\n","output":"1\n1\n"},{"problem_id":"p01654","input":"1 5\n2\n3 7\n2 3 1\n0 1 1 0\n1 2 2 0\n2 8\n5 6\n0 2 1 2\n2 8\n1 1\n0 0 1 0\n2 2\n2 2\n0 1 1 0\n2 3\n3 3\n0 2 1 1\n2 4\n3 1\n1 0 0 1\n0 0\n","output":"708\n1900484\n438404500\n3878\n496\n14246\n9768\n"},{"problem_id":"p01655","input":"3 1\nACM\nIBM\nICM\n5 2\niwzwz\niziwi\nzwizi\n1 0\nA\nB\nC\n10 5\njLRNlNyGWx\nyyLnlyyGDA\nyLRnvyyGDA\n0 0\n","output":"ICM\niwiwi\n-1\nAARAlNyGDA\n"},{"problem_id":"p01656","input":"3 12\n5 sogo5gokan\n10 sogo10gokan\n15 sogo15gokan\n","output":"sogo10gokan\n"},{"problem_id":"p01657","input":"3 5 1\n1 2 5\n","output":"2 3 5\n"},{"problem_id":"p01658","input":"2 3\n1 1 1\n1 1 1\n","output":"5\n"},{"problem_id":"p01659","input":"3\n1 2 1\n","output":"2\n"},{"problem_id":"p01661","input":"2 1\n0 100\n150 250\n0 100\n100 0\n","output":"150\n"},{"problem_id":"p01663","input":"5\n3 2\n5 2\n8 3\n10 1\n18 12\n","output":"3\n3\n5\n4\n-1\n"},{"problem_id":"p01665","input":"2 2 1\n","output":"4\n"},{"problem_id":"p01667","input":"2 2\n2\n1 >= 3\n2\n","output":"Yes\n"},{"problem_id":"p01668","input":"1 3 2\n","output":"1\n"},{"problem_id":"p01669","input":"3 2 1 3 2 1 3 2 1 3 2 1\n1 1\n1 1\n1 1\n","output":"4 8 12\n"},{"problem_id":"p01670","input":"3 3 2\n1 2\n2 3\n3 1\n","output":"2\n"},{"problem_id":"p01671","input":"4 6\n1 2 2\n1 3 6\n1 4 3\n2 3 1\n2 4 4\n3 4 5\n","output":"8\n6\n7\n10\n6\n6\n"},{"problem_id":"p01672","input":"2\n1 0\n0 1\n","output":"1.4142135624\n2 1\n"},{"problem_id":"p01673","input":"2 2 0 1 5\n0 1 3 0 3\n0 1 2 1 6\n","output":"9\n"},{"problem_id":"p01674","input":"0.0 0.0 0.0\n1.0 0.0 0.0 0.0 1.0 0.0\n1.0 0.0 0.5\n1.0 0.0 0.0 0.0 0.0 1.0\n","output":"YES\n"},{"problem_id":"p01675","input":"5 4 1\n1 5 1\n1 1 3\n4 5 1\n3 4 2\n1 3 4\n","output":"2\n"},{"problem_id":"p01676","input":"9 13\n1 2\n1 3\n2 9\n3 4\n3 5\n3 6\n4 9\n5 7\n6 7\n6 8\n7 9\n8 9\n9 1\n","output":"5\n"},{"problem_id":"p01677","input":"5\n1 x 2 4 x\n2\nx x\n2\n1 2\n2\n2 1\n2\n1000000000 x\n4\nx 2 1 x\n0\n","output":"3\nnone\nambiguous\nnone\nambiguous\nnone\n"},{"problem_id":"p01678","input":"3?4\n12?\n5?6\n?2?4\n5?7?\n?9?2\n?????\n?????\n?????\n0\n","output":"2\n40\n200039979\n"},{"problem_id":"p01679","input":"2 1 1 1 10\n1 2 3\n2 4\n2 1 1 1 9\n1 2 3\n2 4\n4 2 2 4 50\n1 2 5\n3 4 5\n2 15\n3 15\n4 6 3 1 29\n1 2 20\n3 2 10\n4 1 5\n3 1 5\n2 4 3\n3 4 4\n2 1\n4 5\n3 3\n0 0 0 0 0\n","output":"1\n0\n1\n3\n"},{"problem_id":"p01680","input":"3 2\n1 2\n2 3\n5 0\n100000 0\n0 0\n","output":"3\n32\n607723520\n"},{"problem_id":"p01681","input":"4\n0 0\n-10 -10\n10 -10\n10 10\n-10 10\n0\n","output":"8\n"},{"problem_id":"p01682","input":"S< S< 12 >> 2 > >\n123 >> 1 >> 1\n1000000000   >>129\nS<S<S<S<S<2>>>>>\nS  <S< S<2013    >>> 11 >>> 10 >\n#\n","output":"81\n30\n0\n294967268\n14592400\n"},{"problem_id":"p01683","input":"4\n1 1\n8 2\n9 1\n14 2\n4\n181 4\n815 4\n634 4\n370 4\n4\n52 1\n40 1\n81 2\n73 1\n10\n330 1\n665 3\n260 1\n287 2\n196 3\n243 1\n815 1\n287 3\n330 1\n473 4\n0\n","output":"18\n634\n-1\n916\n"},{"problem_id":"p01684","input":"10 5 1 1 0\n10 5 2 2 1\n10 10 70 70 20\n0 0 0 0 0\n","output":"1 1 0.564189584 3 1 0.564189584\n1 1 0.797884561 1.644647246 1 0.797884561\nimpossible\n"},{"problem_id":"p01685","input":"1 2\nBB\n\nWW\n\n2 1\nB\nW\n\nB\nW\n\n2 2\nBW\nBW\n\nWW\nWW\n\n3 4\nBBBB\nBBBB\nBBBB\n\nWWWW\nWWWW\nWWWW\n\n5 5\nBBBBB\nBBBBB\nBBBBB\nBBBBB\nBBBBB\n\nBBBBB\nBBBWB\nBBBBB\nBWBBB\nBBBBB\n\n0 0\n","output":"6.0000000000\n0.0000000000\n12.8571428571\n120.0000000000\n23795493.8449918639\n"},{"problem_id":"p01686","input":"3\n.aa.cA.Cc.\n.bb.Bb.AC.\n.cc.ac.Ab.\n1\n.Xx.\n.Yy.\n.Zz.\n6\n.Aj.fA.aW.zA.Jf.Gz.\n.gW.GW.Fw.ZJ.AG.JW.\n.bZ.jZ.Ga.Fj.gF.Za.\n9\n.ab.gh.mn.st.yz.EF.KL.QR.WA.\n.cd.ij.op.uv.AB.GH.MN.ST.XB.\n.ef.kl.qr.wx.CD.IJ.OP.UV.yz.\n2\n.AC.Mo.\n.IC.PC.\n.oA.CM.\n20\n.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.qb.\n.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.qb.\n.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.QB.qb.\n0\n","output":"3 B C E\n-1\n3 J A G\n10 A B G H M N S T Y Z\n0\n2 Q B\n"},{"problem_id":"p01687","input":"AIDUNYAN\n","output":"AIZUNYAN\n"},{"problem_id":"p01688","input":"2\n3\nD 30\nD 50\nD 20\n0\n","output":"80\n"},{"problem_id":"p01689","input":"6 10 3 4\n##########\n#........#\n#...D....#\n#........#\n#........#\n##########\n2 4 6\n3 2 0\n7 4 2\n8 4 3\n1 4 1\n","output":"Yes\n"},{"problem_id":"p01690","input":"10 1 1 1 4 3\n6 10\n5 8\n","output":"15\n"},{"problem_id":"p01691","input":"1 0\n25 47 10\n","output":"96.2027355887\n"},{"problem_id":"p01692","input":"3 2 2 1\n0 3 6\n1 1\n3 -2\n","output":"6\n"},{"problem_id":"p01693","input":"5\n1 2 3 5 4\n","output":"7\n"},{"problem_id":"p01694","input":"4\nlu ru ld rd\n4\nlu ld lu ru\n1\nlu\n10\nru lu ld rd ru rd ru lu rd ld\n0\n","output":"2\n1\n0\n4\n"},{"problem_id":"p01695","input":"6\nhoge\n.fuga\n..foobar\n..jagjag\n...zigzag\n.piyo\n8\njagjag\n.hogehoge\n..fugafuga\n...ponyoponyo\n....evaeva\n....pokemon\n...nowawa\n.buhihi\n8\nhello\n.goodmorning\n..howareyou\n.goodafternoon\n..letshavealunch\n.goodevening\n.goodnight\n..gotobed\n3\ncaution\n.themessagelengthislessthanorequaltofifty\n..sothelengthoftheentirelinecanexceedfiftycharacters\n0\n","output":"hoge\n+fuga\n|+foobar\n|+jagjag\n| +zigzag\n+piyo\njagjag\n+hogehoge\n|+fugafuga\n| +ponyoponyo\n| |+evaeva\n| |+pokemon\n| +nowawa\n+buhihi\nhello\n+goodmorning\n|+howareyou\n+goodafternoon\n|+letshavealunch\n+goodevening\n+goodnight\n +gotobed\ncaution\n+themessagelengthislessthanorequaltofifty\n +sothelengthoftheentirelinecanexceedfiftycharacters\n"},{"problem_id":"p01696","input":"A+A++A\nZ-Z--Z+-Z\n[ESREVER]\nJ---?---J\n++++++++A+++Z-----------A+++Z\n[[++-+--?[--++-?++-+++L]][-+-----+-O]]++++---+L\n.\n","output":"ABC\nZYXZ\nREVERSE\nJAG\nICPC\nJAPAN\n"},{"problem_id":"p01697","input":"3 3 3 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 2 2\n1 3\n0\n3 3 2 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 2 2\n1 3\n0\n6 4 3 2\n1 2 3 1 1\n1 3 8 1 1\n4 6 3 2 2\n5 6 7 2 2\n1 6\n0\n3 3 3 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 2 2\n1 3\n2\n2 6 1 2\n1 2 2\n3 3 2 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 2 2\n1 3\n2\n2 6 1 2\n1 2 2\n3 2 2 2\n1 2 3 1 1\n2 3 3 2 2\n1 3\n2\n2 6 1 2\n1 2 2\n5 4 20 4\n2 4 100 5 1\n1 4 100 5 3\n1 5 100 5 4\n3 5 100 5 2\n3 2\n3\n2 80 1 2\n2 60 1 3\n2 40 2 3\n0 0 0 0\n","output":"6\n8\n-1\n5\n6\n-1\n200\n"},{"problem_id":"p01698","input":"1\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\n2\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\n10.0000 0.0000 0.0000 -2.0000 0.0000 0.0000 4.0000 1.0000\n5\n-10.0000 0.0000 0.0000 10.0000 0.0000 0.0000 2.0000 1.0000\n-5.0000 0.0000 0.0000 10.0000 0.0000 0.0000 2.0000 1.0000\n0.0000 0.0000 0.0000 10.0000 0.0000 0.0000 2.0000 1.0000\n11.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000 100.0000\n15.0000 0.0000 0.0000 -10.0000 0.0000 0.0000 2.0000 1.0000\n27\n-45.6243 -40.4815 42.0513 -0.8380 -6.3628 4.5484 12.0279 2.2721\n8.7056 -9.8256 34.1560 6.0068 6.2527 -6.8506 28.9807 1.5037\n30.1481 29.9591 -46.2881 6.7611 8.6669 1.5629 14.5578 1.3181\n24.2927 8.3779 -21.8931 0.7074 0.1879 -8.9742 5.5877 2.6893\n25.3009 -42.9168 10.7480 -7.2477 -8.5507 7.7846 13.7923 2.8726\n17.6938 42.3577 -5.0334 6.4949 -2.1472 -5.3101 23.3066 1.4769\n-7.9296 -29.6442 -24.2157 -1.1064 -9.5802 6.5858 12.4250 2.3816\n9.5851 -20.0455 -35.1885 5.7477 -1.0622 2.5211 3.5233 1.2466\n-35.5762 44.5412 -46.7816 3.6053 0.4991 4.3470 20.6922 2.8529\n-44.9386 -48.0381 -43.6877 7.4101 3.9491 7.1619 10.4301 2.4920\n-49.9870 -28.6276 -2.6522 5.8008 -1.0054 -4.9061 25.1188 1.4916\n45.0228 31.3811 29.2546 -8.7777 -3.7836 -7.7180 17.4361 1.8706\n35.5553 45.8774 -29.8025 -7.3596 -9.2114 -3.5987 6.8841 2.6143\n19.9857 34.3874 42.5551 5.2133 -5.5350 -7.6617 2.9294 1.4026\n23.5109 18.1633 -34.8265 7.3260 -4.1912 5.3518 3.0036 1.5027\n43.5134 -27.5238 49.4679 -4.5986 1.8410 6.8741 2.2009 1.4525\n-28.8994 23.2934 -6.1914 5.7985 -6.2129 -8.2882 16.1683 1.7463\n3.6721 38.2528 -38.7741 4.5115 6.6442 6.4406 10.7555 1.0971\n17.4488 -12.6965 -23.1293 2.8257 6.3319 -1.5368 7.3785 2.9350\n33.2708 -17.9437 -0.5347 8.7428 7.3193 5.9738 6.2292 2.6210\n-14.4660 -25.1449 -4.4191 -9.4843 -6.6439 -4.7330 7.7910 2.1659\n32.4428 -24.2605 48.1228 -5.2396 1.5916 -5.9552 1.1760 1.3618\n-21.9088 43.6286 -8.8286 6.4641 0.5554 -4.6827 1.2504 1.4718\n-0.1784 -42.1729 -2.7193 5.3741 0.9098 9.7622 1.4764 1.2611\n29.3245 -33.2298 -26.3824 -8.4192 -2.9427 -7.3759 9.6346 1.7490\n-35.1767 35.9652 33.4779 4.0088 2.4579 2.0981 19.2565 1.7121\n-17.5530 1.4161 -14.0271 6.4564 -4.8261 -8.7461 3.0566 1.5906\n0\n","output":"4.0000000000\n1.0000000000\n1.0000000000\n2.0000000000\n2.0000000000\n0.6111111111\n0.0100000000\n0.6111111111\n5.2937370714\n0.3931996496\n11.0445337986\n2.0777525750\n4.8013298058\n0.0925901184\n5.2170809540\n2.8263276111\n7.2530407655\n4.1854333868\n0.2348376111\n1.0517364512\n0.0925901184\n1.0517364512\n1.9988021561\n1.5152495697\n9.2586039054\n9.8035730562\n2.5139693356\n2.3766501335\n0.2348376111\n0.3931996496\n0.8495719527\n1.1707239711\n5.5086335049\n11.2472986391\n1.9216647806\n"},{"problem_id":"p01699","input":"2\n1 11\n1 11\n3\n10 10\n2 2\n11 11\n4\n89 91\n1 12\n1 12\n89 91\n5\n1 8\n2 76\n10 19\n6 16\n33 42\n6\n10 59\n20 69\n30 79\n40 89\n50 99\n50 99\n0\n","output":"120\n1\n1278\n659520\n15625000000\n"},{"problem_id":"p01700","input":"117649\n1\n125000\n1610612736\n68719476636\n-1\n","output":"3\n1\n4\n6\n11\n"},{"problem_id":"p01701","input":"north\nwest\nnorthwest\nnorthnorthwest\nwestwestwestnorth\n#\n","output":"0\n90\n45\n45\/2\n315\/4\n"},{"problem_id":"p01702","input":"3 10 3\n000 0000000000\n110 0000001111\n101 1111111100\n2 2 0\n1 1 0\n2 1 1\n01 1\n11 11 10\n10000000000 10000000000\n11000000000 01000000000\n01100000000 00100000000\n00110000000 00010000000\n00011000000 00001000000\n00001100000 00000100000\n00000110000 00000010000\n00000011000 00000001000\n00000001100 00000000100\n00000000110 00000000010\n0 0 0\n","output":"2222221100\n??\n0\n1\n0123456789A\n"},{"problem_id":"p01703","input":"2\n0.50 0.40\n2\n0.70 0.60\n4\n0.99 1.00 1.00 0.01\n0\n","output":"5.5000000000\n4.0476190476\n104.0101010101\n"},{"problem_id":"p01704","input":"3\n10\n4 3 4 10\n5 4 5 20\n6 5 6 30\n3\n7\n-4 3 4 -10\n5 4 5 20\n6 5 6 30\n3\n1\n-4 3 4 -10\n-5 4 5 -20\n6 5 6 30\n3\n10\n-4 3 4 -10\n-5 4 5 -20\n-6 5 6 -30\n0\n","output":"43.5\n36\n13.5\n0\n"},{"problem_id":"p01705","input":"2\n0 8\n10 8\n2\n0 7\n10 7\n0\n","output":"12.489995996796796\n9.899494936611665\n"},{"problem_id":"p01706","input":"4 4 1 4\n1 2\n3 1\n4 2\n3 4\n7 8 1 7\n1 2\n1 3\n2 4\n3 4\n4 5\n4 6\n5 7\n7 6\n6 4 5 2\n1 2\n1 3\n4 5\n5 6\n10 21 9 10\n9 1\n9 2\n9 3\n9 4\n10 1\n10 2\n10 3\n10 4\n1 5\n2 5\n2 6\n3 6\n3 7\n4 7\n4 8\n1 8\n5 10\n6 10\n7 10\n10 8\n10 9\n2 15 1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n0 0 0 0\n","output":"1 2\n2 1\n0 0\n4 6\n15 0\n"},{"problem_id":"p01707","input":"5 2 5\n3 3 3\n5 4 5\n4 1 2\n1 5 1\n1250 50 50\n0 0 0\n","output":"4\n7\n52\n0\n0\n563144298\n"},{"problem_id":"p01708","input":"((0,0)@(1,1))@((4,1)@(2,5))\n((0,0)@(3,1))@((1,-3)@(2,-1))\n(0,0)@(1,1)@(4,1)\n(0,0)@((1,1)@(4,1))\n(((0,0)@((10,20)@(((30,40))))))\n((0,0)@(3,1))@((1,-3)@(2,-1))@(100,-100)@(100,100)\n#\n","output":"3.00000000 3.00000000\n3.00000000 1.00000000\n1.00000000 4.00000000\n0.00000000 2.00000000\n-10.00000000 10.00000000\n-99.83681795 -91.92248853\n"},{"problem_id":"p01709","input":"1\n3\n0 0\n1 0\n0 1\n4\n4\n0 0\n10 0\n10 10\n0 10\n4\n10 0\n20 0\n20 10\n10 10\n4\n0 10\n10 10\n10 20\n0 20\n4\n10 10\n20 10\n20 20\n10 20\n3\n4\n-10 -10\n2 2\n10 10\n-11 7\n3\n-1 -1\n1 -1\n0 0\n3\n0 0\n3 -3\n20 20\n7\n4\n46 12\n52 12\n53 15\n45 15\n32\n67 1\n70 0\n73 1\n77 3\n79 5\n80 8\n77 8\n76 5\n74 4\n71 3\n70 3\n67 4\n65 6\n63 8\n62 14\n64 19\n66 21\n70 22\n75 21\n78 16\n80 16\n80 17\n79 20\n78 22\n74 24\n67 24\n63 22\n61 19\n60 15\n60 10\n62 5\n64 3\n5\n74 14\n80 14\n80 16\n78 16\n74 16\n19\n34 0\n37 0\n37 19\n36 22\n35 23\n32 24\n30 24\n27 24\n25 23\n23 20\n23 18\n23 15\n26 15\n26 18\n27 20\n29 21\n32 21\n34 20\n34 18\n4\n47 0\n50 0\n42 24\n39 24\n4\n79 20\n80 17\n80 22\n78 22\n4\n50 0\n58 24\n56 24\n49 3\n4\n10\n34 21\n34 14\n35 14\n35 19\n40 19\n40 20\n35 20\n35 22\n30 22\n30 21\n16\n20 24\n21 24\n21 33\n42 33\n42 20\n40 20\n40 19\n45 19\n45 5\n40 5\n40 4\n46 4\n46 20\n43 20\n43 34\n20 34\n10\n26 21\n26 14\n27 14\n27 21\n30 21\n30 22\n21 22\n21 24\n20 24\n20 21\n12\n34 8\n34 4\n40 4\n40 5\n35 5\n35 14\n34 14\n34 9\n27 9\n27 14\n26 14\n26 8\n0\n","output":"1\n2\n3\n3\n4\n"},{"problem_id":"p01710","input":"5 4 10\n4 3 1\n6 4 3\n3 2 4\n2 2 1\n8 5 3\n1 2\n2 3\n3 4\n4 5\n3 3 1000\n1000 1 100\n1 7 100\n10 9 100\n1 2\n2 3\n3 2\n1 0 5\n25 25 2\n1 0 25\n25 25 2\n5 5 100\n1 1 20\n1 1 20\n10 1 1\n10 1 1\n10 1 1\n1 2\n2 1\n3 4\n4 5\n5 3\n3 3 100\n70 20 10\n50 15 20\n90 10 10\n1 2\n2 2\n2 3\n0 0 0\n","output":"15\n2014\n0\n25\n40\n390\n"},{"problem_id":"p01711","input":"00000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000111111111\n10000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111\n01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101\n#\n","output":"yes\nyes\nno\n"},{"problem_id":"p01712","input":"3 9 9\n2 2 2\n5 5 2\n8 8 2\n","output":"Yes\n"},{"problem_id":"p01713","input":"7\n2 0 -2 3 2 -2 0\n","output":"4\n"},{"problem_id":"p01714","input":"5\n0 0 0 0\n1 0 -1 1\n-1 0 1 -1\n1 1 -1 1\n-1 -1 1 -1\n","output":"5\n"},{"problem_id":"p01715","input":"2 2 1\n1 5\n0 1\n0 2\n","output":"4\n"},{"problem_id":"p01716","input":"3 1\na1a\na 99\n","output":"19\n"},{"problem_id":"p01717","input":"6 5 4\n2 1 1\n2 5 2\n5 1 1\n4 3 2\n3 6 -1\n","output":"4\n"},{"problem_id":"p01718","input":"5 2\n5 1 2 3 4\n1 1\n2 4\n","output":"15\n45\n"},{"problem_id":"p01719","input":"2 2 5\n3 2\n5 4\n","output":"9\n"},{"problem_id":"p01720","input":"3 2 1 3\n1 2\n2 3\n","output":"1\n"},{"problem_id":"p01721","input":"10 10 1 10 3 3 7 7\n","output":"1\n"},{"problem_id":"p01722","input":"0\n","output":"1\n"},{"problem_id":"p01723","input":"3\n0 1\n1 2\n","output":"1\n"},{"problem_id":"p01724","input":"...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n......O........\n......X........\n","output":"1\n"},{"problem_id":"p01725","input":"3-2*3\n","output":"3\n"},{"problem_id":"p01726","input":"abcbcdbc\nabc\n","output":"2\n"},{"problem_id":"p01727","input":"4 10000 00101\nQ\nA 0\nB 1\nQ\n","output":"3\n4\n"},{"problem_id":"p01728","input":"1 2\n3 3\n2 -1\n4\n1 0 1 5\n0 1 4 1\n0 4 6 4\n5 0 5 5\n","output":"1\n"},{"problem_id":"p01729","input":"3\n3 -1 4\n2 1 3\n","output":"1\n"},{"problem_id":"p01730","input":"3\n5 10\n-10 0\n3 -10\n","output":"14\n"},{"problem_id":"p01731","input":"1\n0\nicpc\n","output":"icpc\n"},{"problem_id":"p01732","input":"3 3 1\n1 1 3 3\n0 0\n1 RRDDLLUU\n","output":"1\n"},{"problem_id":"p01733","input":"2\n1 1 2\n2 2 3\n","output":"5 \/ 1\n"},{"problem_id":"p01734","input":"3\n26 29 9 12\n6 10 15 16\n8 17 18 19\n","output":"1\n"},{"problem_id":"p01735","input":"3\n0 1 1\n2 2 3\n0\n0\n","output":"2 2\n"},{"problem_id":"p01736","input":"2\n1 1\n0 1\n1\n1\n1\n","output":"0 1\n"},{"problem_id":"p01737","input":"2 1 1 9 -1\n2 2 1 1 -9 1\n1 2 -1 -1 9 -1\n","output":"Yes\n"},{"problem_id":"p01738","input":"3 3\n2 4 1 2 1\nXAX\nB.B\nXAX\n","output":"0.0000000000000\n"},{"problem_id":"p01739","input":"2\n1 2 2\n0\n","output":"2\n"},{"problem_id":"p01740","input":"3\n.oo\no..\n\no.o\no..\n","output":"1\n"},{"problem_id":"p01741","input":"1.000\n","output":"2.000000000000\n"},{"problem_id":"p01742","input":"2\n?sum??mer\nc??a??mp\n","output":"703286064\n"},{"problem_id":"p01743","input":"2\n3\n3\n","output":"5\n"},{"problem_id":"p01744","input":"4 4 1\n3 3\n","output":"2\n3\n4\n1\n"},{"problem_id":"p01745","input":"1\n00011000\n","output":"00011101\n"},{"problem_id":"p01746","input":"7\n0 3 1\n0 3 2\n1 -1 2\n0 0 1\n-2 4 1\n-4 0 1\n2 1 2\n","output":"4\n"},{"problem_id":"p01747","input":"4\n0 1\n1 1\n1 2\n2 2\n","output":"Possible\n"},{"problem_id":"p01748","input":"10\n4 1\n1 1\n3 1\n3 1\n5 1\n6 1\n6 1\n8 1\n4 1\n","output":"0\n3\n3\n4\n5\n7\n10\n13\n16\n19\n"},{"problem_id":"p01749","input":"3 2 2\n","output":"14\n"},{"problem_id":"p01750","input":"2\n6\n3\n4\n","output":"15\n"},{"problem_id":"p01751","input":"10 10 5\n","output":"5\n"},{"problem_id":"p01752","input":"3 3\nG##\n.#.\n.\n","output":"4\n"},{"problem_id":"p01753","input":"5 1\n0 10 0 5 2\n0 20 0 5 12\n0 30 0 5 22\n0 40 0 5 32\n0 50 0 5 42\n0 0 0 0 60 0\n","output":"110\n"},{"problem_id":"p01754","input":"1 1 1\n2\n","output":"2\n"},{"problem_id":"p01755","input":"5 3\n###\n#g#\n#.#\n#s#\n###\n^<^<vv\n","output":"5\n"},{"problem_id":"p01756","input":"abracadabra\n5\nab a\na a\nb c\nac ca\nz z\n","output":"11\n11\n4\n3\n0\n"},{"problem_id":"p01757","input":"1 1\n0 2\n1\n","output":"1\n"},{"problem_id":"p01758","input":"3 2\n0 1\n2 1\n","output":"2 1\n0 2\n"},{"problem_id":"p01759","input":"4 5\n1 1\n-1 1\n-1 -1\n1 -1\n1\n1\n1\n1\n1\n","output":"0.0000000000 0.0000000000\n0.6324555320 0.6324555320\n-0.6324555320 0.6324555320\n-0.6324555320 -0.6324555320\n0.6324555320 -0.6324555320\n"},{"problem_id":"p01760","input":"40 1000\n80 20\n100 100\n","output":"0.0000000000\n"},{"problem_id":"p01761","input":"6\nantbook iwiWataKitamasa 2012\/01\/28\nhogebook foo 2000\/01\/01\nhugabook bar 2000\/01\/01\ncheeterbook chokudai 2012\/09\/29\naojbook YutakaWatanabe 2014\/06\/28\npiyobook buz 2000\/01\/01\n4\na * * *\n* chokudai * *\n* Chokudai * *\n* * 2014\/01\/01 2014\/12\/31\n","output":"antbook\nhugabook\naojbook\n\ncheeterbook\n\n\naojbook\n"},{"problem_id":"p01762","input":"5\n2 2 2 2\n0 1 4\n1 2 1\n1 3 1\n1 4 1\n","output":"4\n"},{"problem_id":"p01763","input":"3 3 2\n2 3 4\n1 0 3\n0 2 2\n","output":"2\n"},{"problem_id":"p01764","input":"3\n1 2 3\n","output":"11\n"},{"problem_id":"p01766","input":"5\n0 1 0 3 4\n30 1 0 3 4\n90 2 0 6 8\n120 1 1 1 1\n132 2 1 2 2\n","output":"5.00000000 1.00000000\n1.41421356 0.20000000\n"},{"problem_id":"p01767","input":"6\n1 2 1 3 4 5\n7\n1 3 4 5 3 1 0\n2 4 5 3 4 5 3\n","output":"Yes\nYes\nYes\nYes\nYes\nNo\nNo\n"},{"problem_id":"p01768","input":"2\ntako 2\nyaki 1\n1\ntako yaki\n","output":"2\n"},{"problem_id":"p01769","input":"1 3\n0\n1\n","output":"3\n"},{"problem_id":"p01770","input":"8 5 2 0 5 5\n0 1\n0 3\n0 6\n1 2\n6 7\n3 4 7\n4 5 2\n","output":"9\n"},{"problem_id":"p01771","input":"9 6\n0 1\n0 2\n0 3\n1 4\n1 5\n4 6\n5 7\n5 8\n1 0 1\n1 1 2\n0 6 3\n1 5 5\n1 8 4\n0 4 3\n","output":"8\n5\n"},{"problem_id":"p01772","input":"AIZUNYANPEROPERO\n","output":"AZ\n"},{"problem_id":"p01773","input":"2 10:00-11:30 12:00-13:00\n2\n1 10:00-15:00\n2 09:00-12:00 18:10-18:55\n2\n2 10:00-13:00 15:30-16:40\n3 06:00-08:00 12:00-13:10 15:00-17:00\n","output":"2\n"},{"problem_id":"p01774","input":"28\n0\n","output":"1\n"},{"problem_id":"p01775","input":"5 6 1 1\n1 3 5\n1 2 2\n2 3 1\n3 5 4\n3 4 2\n4 5 3\n3 5\n","output":"7\n"},{"problem_id":"p01776","input":"6\n0 0\n-1 -2\n3 -2\n2 0\n3 2\n-1 2\n","output":"6.000000000\n"},{"problem_id":"p01777","input":"7\n4 1 10 5 7 7 3\n5\n2 5 0\n3 6 1\n3 6 2\n1 7 2\n1 7 5\n","output":"1\n1\n0\n3\n1\n"},{"problem_id":"p01778","input":"4\nD 1\nD 2\nA 3\nD 4\n4\nA 1 7\nD 4 5\nD 3 6\nB 3 3\n","output":"6\n"},{"problem_id":"p01780","input":"4\n1 1 2\n","output":"6\n"},{"problem_id":"p01781","input":"2 2 2 0 0 0 5\n","output":"1 3 3 1 0\n"},{"problem_id":"p01782","input":"3\naab\nczc\nbaa\n","output":"aac\n"},{"problem_id":"p01783","input":"R?????,2?)\n","output":"29\n"},{"problem_id":"p01784","input":"3\n()(()((\n))()()(()\n)())(())\n","output":"Yes\n"},{"problem_id":"p01785","input":"8\n0 2\n0 0\n2 0\n2 1\n3 1\n3 3\n1 3\n1 2\n","output":"1\n"},{"problem_id":"p01786","input":"10 2\n2\n1\n","output":"5 7\n3 5\n"},{"problem_id":"p01787","input":"R 100 L 20 E 10 \\$\nR 5 L 10 \\$\nX 20 \\$\n","output":"R 95 X 20 L 10 E 10 \\$\n"},{"problem_id":"p01788","input":"3 3 1\n1 1 10 10\nAAA\nA..\nA..\n","output":"100\n"},{"problem_id":"p01789","input":"3 5 4\n3\n6\n12\n","output":"Hanako\n"},{"problem_id":"p01790","input":"2\n()\n1 2\n","output":"1\n"},{"problem_id":"p01791","input":"4 2 58 100\n10 10 50 80\n","output":"75\n2 3\n"},{"problem_id":"p01792","input":"60 2 3\n","output":"0.789473\n1\n1\n"},{"problem_id":"p01793","input":"3 2\n1 2 1\n2 3 2\n1 10 100\n","output":"320\n"},{"problem_id":"p01794","input":"2 1\n1 2\n1 2 1 1\n","output":"1\/2\n"},{"problem_id":"p01795","input":"2 2\n1 2 0\n3 4 1\n","output":"2\n"},{"problem_id":"p01796","input":"7 4\nDEFG\nFEDA\nEFGB\nBGEA\nAGFD\nDABC\nCADE\n","output":"ABCDEFG\n"},{"problem_id":"p01797","input":"2 -3 4\nL 2 5\n? 3 5\n","output":"2\nL 4\nL 3\n"},{"problem_id":"p01798","input":"2 2 3\n0 0\n2 0\n0 0\n0 2\n0 0\n1 1\n1 1\n","output":"3\n"},{"problem_id":"p01799","input":"5 3\n1 5\n3 4\n5 3\n7 2\n9 1\n","output":"5\n"},{"problem_id":"p01800","input":"100 100 0 1\n","output":"1.16699564\n"},{"problem_id":"p01801","input":"2 2\n..\n..\n","output":"Second\n"},{"problem_id":"p01802","input":"2 1\n7 5\n7 6\n7 7\n76 5\n8 41\n0 0\n","output":"0.4142135624\n0\n0.0827625303\n0\n48.7401153702\n33\n"},{"problem_id":"p01803","input":"3\nhaneda\noookayama\ntsu\n2\nazusa\nazishirabe\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaii\n0\n","output":"1\n4\n-1\n3\n"},{"problem_id":"p01804","input":"1 1\n##\n#.\n..\n..\n#.\n..\n1 1\n.#\n#.\n#.\n..\n..\n.#\n2 2\n##\n#.\n##\n#.\n..\n.#\n##\n#.\n#.\n..\n#.\n..\n1 3\n#.\n..\n##\n##\n##\n##\n##\n##\n##\n##\n##\n##\n##\n##\n10 3\n##\n#.\n##\n#.\n##\n.#\n##\n.#\n#.\n##\n#.\n##\n.#\n##\n.#\n##\n.#\n#.\n.#\n#.\n#.\n.#\n#.\n.#\n#.\n..\n#.\n..\n#.\n..\n#.\n..\n10 3\n##\n.#\n##\n..\n##\n#.\n.#\n..\n##\n.#\n.#\n##\n.#\n##\n#.\n##\n##\n.#\n..\n.#\n#.\n#.\n.#\n#.\n#.\n#.\n#.\n..\n..\n..\n..\n.#\n0 0\n","output":"1\n0\n3\n6\n6\n0\n"},{"problem_id":"p01805","input":"3 3 2 2\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\n 1 1 1\n3 3 2 2\n 1 0 1\n1 0 1 1\n 1 0 0\n0 0 0 0\n 0 0 1\n1 1 0 1\n 1 0 1\n1 3 1 1\n 1 1 1\n1 0 0 1\n 1 0 1\n2 2 1 1\n 1 0\n1 0 0\n 0 0\n0 0 0\n 0 0\n0 0 0 0\n","output":"Yes\nNo\nYes\nNo\n"},{"problem_id":"p01806","input":"1\n0 0\n1 2 3 4 5 6\nRRRRBBBBLLLLFFFF\n2\n0 0\n1 1 1 1 1 1\nRRR\n2 2\n100 100 100 100 100 100\nFFF\n1\n1000 -1000\n1 2 3 4 5 6\nLFRB\n4\n-3 -4\n1 2 3 4 5 6\nBBBBBBBB\n4 -3\n11 12 13 14 15 16\nLLLLLLLL\n3 4\n21 22 23 24 25 26\nFFFFFFFF\n-4 3\n31 32 33 34 35 36\nRRRRRRRR\n3\n-2 -2\n9 3 1 1 1 1\nRRRRBLLLBRRBLB\n0 -3\n2 5 2 5 2 1\nBBLBBRBB\n3 0\n10 7 2 10 1 5\nLLFLLBLL\n0\n","output":"64\n403\n10\n647\n96\n"},{"problem_id":"p01807","input":"4 5 1 4\n1 2 (\n1 3 a\n2 4 a\n3 4 )\n3 2 +\n4 4 1 2\n1 3 (\n3 4 a\n4 1 +\n3 2 a\n3 4 1 1\n1 2 a\n2 2 +\n2 3 a\n3 1 a\n5 8 1 5\n1 1 [\n1 2 (\n2 1 *\n2 2 a\n2 3 a\n3 3 )\n3 4 ]\n4 5 )\n2 14 1 1\n1 2 a\n1 2 (\n1 2 )\n1 2 [\n1 2 ]\n1 2 +\n1 2 *\n2 1 a\n2 1 (\n2 1 )\n2 1 [\n2 1 ]\n2 1 +\n2 1 *\n0 0 0 0\n","output":"Yes\nNo\nNo\nYes\nNo\n"},{"problem_id":"p01808","input":"3\n1 4\n-5 5\n5 -5\n10\n1 10\n-10 5\n5 -10\n5\n3 5\n-20 0\n20 0\n8\n1 9\n-14 58\n6 24\n2\n2 8\n-57 -113\n42 -31\n4\n1 4\n-4 -5\n4 5\n0\n","output":"17.5032106371\n41.3850388846\n-1\n102.0656847372\n178.1399151364\n19.5548716821\n"},{"problem_id":"p01809","input":"1 2\n","output":"2\n"},{"problem_id":"p01810","input":"4 2\n","output":"7\n"},{"problem_id":"p01811","input":"ABC\n","output":"Yes\n"},{"problem_id":"p01812","input":"4 2 2\n1 2\n2 4\n3 1\n4 2\n1 3\n","output":"2\n"},{"problem_id":"p01813","input":"1-(2+3-4+5)\n","output":"5\n"},{"problem_id":"p01814","input":"abcabcaxcabc\n4\n1 9 3\n8 12 3\n1 4 2\n2 3 2\n","output":"Yes\nYes\nNo\nYes\n"},{"problem_id":"p01815","input":"6 6\n1 2 3 4 5 6\n1 2\n2 3\n3 4\n1 4\n4 5\n5 6\n","output":"21\n"},{"problem_id":"p01816","input":"6 3\nT=T|X\nT=T|Y\nT=T|Y\nT=T^Y\nT=T&X\n0 1\n0 2\n1 3\n1 4\n2 5\n5 6\n3 5\n0 0\n","output":"4\n6\n0\n"},{"problem_id":"p01817","input":"5\n5 1 4 2 3\n","output":"2\n3\n1\n"},{"problem_id":"p01818","input":"7 2\n1 2\n5 6\n","output":"3\n"},{"problem_id":"p01819","input":"2 1\nWE\n","output":"1 2\n"},{"problem_id":"p01820","input":"9\n0 0 v\n1 0 >\n2 0\n","output":"9\n"},{"problem_id":"p01821","input":"3\n","output":"1\n"},{"problem_id":"p01822","input":"4 5 3\n-10 -10\n10 -10\n10 10\n-10 10\n1 2\n1 3\n1 4\n2 3\n3 4\n-20 0\n1 0\n20 0\n","output":"No\nYes\nNo\n"},{"problem_id":"p01823","input":"3 3 4\n1 2 1 1\n2 3 2 4\n3 1 1 1\n","output":"6\n"},{"problem_id":"p01824","input":"2 2 2 1\n0 0 0\n","output":"24\n"},{"problem_id":"p01825","input":"3\n0 1\n0 0 0 1\n0 1 0 2\n0 2 0 3\n","output":"6.0000000000000000\n"},{"problem_id":"p01826","input":"2 10\n10 200 1\n10 100 100\n","output":"200\n"},{"problem_id":"p01827","input":"3\n1 3 3\n2\n1 2\n1 3\n","output":"5\n"},{"problem_id":"p01828","input":"acmicpc\ntsukuba\n","output":"No\n"},{"problem_id":"p01829","input":"201\n","output":"701\n"},{"problem_id":"p01830","input":"3\ny 7\ny 6\nn 5\n","output":"1\n"},{"problem_id":"p01831","input":"7\n>>\n","output":"7\n"},{"problem_id":"p01832","input":"3 2\nR1\n","output":"3 1 2\n4 5 6\n7 8 9\n"},{"problem_id":"p01833","input":"4 2 1 1\n1 2\n3\n4\n3\n1 2\n2 4\n3 4\n","output":"2 1\n"},{"problem_id":"p01834","input":"2 2 2 4\n0 0 0\n1 1 0\n1 0 1\n0 1 1\n","output":"4\n"},{"problem_id":"p01835","input":"3 2\n3\n1 2 1\n2 3 2\n3 3 1\n","output":"1\n"},{"problem_id":"p01836","input":"200 500 800 500\n3\n400 0\n450 500\n400 1000\n3\n600 0\n550 500\n600 1000\n","output":"100 600\n"},{"problem_id":"p01837","input":"3 2 3 1 3\n1 2 2 1\n2 3 1 2\n","output":"6.0000000\n"},{"problem_id":"p01838","input":"4 3\n1 3 4 7\n","output":"6\n"},{"problem_id":"p01839","input":"4\nA\nUn\nA\nUn\n","output":"YES\n"},{"problem_id":"p01840","input":"1 1 5\n3\n","output":"3\n"},{"problem_id":"p01841","input":"((()[8]())[2]())[5](((()[2]())[6](()[3]()))[1]())\n(()[4]())[3](((()[2]())[1]())[8](()[3]()))\n","output":"(()[6]())[8](((()[4]())[7]())[9]())\n"},{"problem_id":"p01842","input":"2 2\n100 -1\n200 300\n","output":"-100\n"},{"problem_id":"p01843","input":"1 2\n4\n5 5\n15 5\n15 15\n5 15\n0 10\n20 10\n","output":"2\n"},{"problem_id":"p01844","input":"3 3 2\n1 2 2\n3 1 0\n0 4 3\n","output":"7\n"},{"problem_id":"p01845","input":"10 5 3 4\n2 5 2 3\n91 13 7 62\n10 1 3 5\n20 100 2 20\n2 14 7 1\n0 0 0 0\n","output":"2\n3\n0\n0\n9\n96\n"},{"problem_id":"p01846","input":"b1\/1b\n1 1 1 2\nb5\/bbbbbb\n2 4 1 4\nb2b2b\/7\n1 4 2 4\n#\n","output":"1b\/1b\nb2b2\/bbb1bb\nb5b\/3b3\n"},{"problem_id":"p01847","input":"4\n0 0\n10 0\n10 10\n0 10\n0 0\n5 0\n5 10\n0 10\n6\n0 0\n10 0\n10 5\n5 5\n5 10\n0 10\n2 0\n8 0\n8 10\n2 10\n12\n1 1\n1 3\n-1 3\n-1 1\n-3 1\n-3 -1\n-1 -1\n-1 -3\n1 -3\n1 -1\n3 -1\n3 1\n2 2\n-2 2\n-2 -2\n2 -2\n4\n20000 20000\n-20000 20000\n-20000 -20000\n20000 -20000\n1000 1000\n-1000 1000\n-1000 -1000\n1000 -1000\n4\n1000 1000\n-1000 1000\n-1000 -1000\n1000 -1000\n20000 20000\n-20000 20000\n-20000 -20000\n20000 -20000\n4\n0 0\n10 0\n10 10\n0 10\n20 0\n30 0\n30 10\n20 10\n0\n","output":"50\n30\n8\n1596000000\n0\n100\n"},{"problem_id":"p01848","input":"2\n0.60 1 2\n0.60 0\n2\n0.60 1 2\n0.60 1 1\n5\n0.10 1 2\n0.20 1 3\n0.30 1 4\n0.40 1 5\n0.50 1 1\n5\n0.10 0\n0.20 1 1\n0.30 1 1\n0.40 1 1\n0.50 1 1\n5\n0.10 4 2 3 4 5\n0.20 0\n0.30 0\n0.40 0\n0.50 0\n4\n0.10 1 2\n0.20 0\n0.30 1 4\n0.40 1 3\n5\n0.10 0\n0.20 0\n0.30 0\n0.40 0\n0.50 0\n0\n","output":"0.400000000\n0.640000000\n0.998800000\n0.168000000\n0.900000000\n0.792000000\n0.151200000\n"},{"problem_id":"p01849","input":"1 1\n5\n6\n1 1\n5\n2\n1 1\n20\n5\n4 1\n2 4 5 9\n8\n4 3\n3 5 2 1\n10 4 7\n5 5\n2 2 2 2 2\n1 3 5 7 9\n2 5\n2 5\n2 5 2 5 2\n0 0\n","output":"1\n2\n5\n1\n1\n5\n4\n"},{"problem_id":"p01850","input":"3\nicpc\nicfp\ntopcoder\n4\napple\napplication\nappointment\nacmicpc\n3\na\naa\naaa\n4\na\naza\nazb\nb\n0\n","output":"icfp\ntopcoder\nicpc\napple\nacmicpc\napplication\nappointment\naa\na\naaa\na\naza\nb\nazb\n"},{"problem_id":"p01851","input":"1 1 0 1 1\n0 0 2 3 2\n4 0 0 33 4\n5 4 2 20 25\n4726 87361 2742 23497 162843\n328324 420923 12782 834286 538297\n0 0 0 0 0\n","output":"2\n0\n114660\n512095631\n673703234\n166259450\n"},{"problem_id":"p01852","input":"0\n","output":"0\n"},{"problem_id":"p01853","input":"3 100\n","output":"0 0 100\n"},{"problem_id":"p01854","input":"2 15\n2 3 3 7 2\n2 7 1 1 4\n","output":"6.33333333\n"},{"problem_id":"p01855","input":"3\n2 3\n3 3\n4 3\n","output":"1 1\n1 0\n1 1\n"},{"problem_id":"p01856","input":"7 5\n0 0 0 0 0\n0 1 1 1 0\n0 2 2 2 0\n0 3 3 3 0\n0 2 2 2 0\n0 1 1 1 0\n0 0 0 0 0\n","output":"4 2 2 2\n"},{"problem_id":"p01857","input":"3\n5 1\n5 2\n1 2\n","output":"5\n3\n1\n"},{"problem_id":"p01858","input":"3\ntameru\ntameru\ntameru\ntameru\nkougekida\ntameru\n","output":"Nakajima-kun\n"},{"problem_id":"p01859","input":"3 2\n2 2\n","output":"NAKAJIMA\n"},{"problem_id":"p01860","input":"3 9 3 2 3\n1 2 3\n1 1 2\n2 3 1\n3 4 2\n4 1 3\n4 1 1\n5 1 1\n6 2 3\n7 2 2\n","output":"6\n"},{"problem_id":"p01861","input":"3\n3 5 3\n3\n5 2 3\n3 3 1\n7 1 2\n","output":"Yes\n"},{"problem_id":"p01862","input":"2\n10 5\n","output":"1\n-10.00 -6.48\n-10.79 -8.91\n-13.34 -8.91\n-11.28 -10.41\n-12.07 -12.84\n-10.00 -11.34\n-7.93 -12.84\n-8.72 -10.41\n-6.66 -8.91\n-9.21 -8.91\n2\n10.00 12.34\n9.47 10.72\n7.77 10.72\n9.15 9.72\n8.62 8.10\n10.00 9.10\n11.38 8.10\n10.85 9.72\n12.23 10.72\n10.53 10.72\n"},{"problem_id":"p01863","input":"NicoNicoNi\n","output":"Love Nico!\n"},{"problem_id":"p01864","input":"5 6\n100 80 70 60 50\n1 2 500\n2 5 100\n1 3 400\n1 4 200\n3 5 700\n4 5 800\n1\n5 3 600\n","output":"0\n"},{"problem_id":"p01865","input":"3\n3\n1 1\n2 1\n3 1\n","output":"1\n-3 2\n"},{"problem_id":"p01866","input":"5\n00001\n3\n","output":"11101\n"},{"problem_id":"p01867","input":"5\na+a+a\n","output":"3\n"},{"problem_id":"p01868","input":"4\n1\n1\n1\n1\n","output":"2\n"},{"problem_id":"p01869","input":"1\n","output":"-1\n"},{"problem_id":"p01870","input":"5\n0 1\n0 2\n0 3\n0 4\n","output":"9\n"},{"problem_id":"p01871","input":"4\n0 0\n0 1\n1 1\n1 0\n","output":"1\n"},{"problem_id":"p01872","input":"?12345678901\n","output":"4\n"},{"problem_id":"p01873","input":"6\n1 2 3 1 2 3\n","output":"2\n"},{"problem_id":"p01874","input":"2 2 0 0\n3 3\n4 0\n","output":"7.16227766017\n"},{"problem_id":"p01876","input":"3 3 4\n111\n111\n111\n111\n111\n111\n","output":"2\n"},{"problem_id":"p01877","input":"10\n0 1 2 3 4 4 3 2 1 0\n7\n2 6 0\n2 4 5\n7 9 10\n2 4 5\n3 8 100\n4 6 1000\n7 7 1000\n","output":"1\n0\n0\n1\n1\n0\n1\n"},{"problem_id":"p01878","input":"4 1 1 6\n3 2 3\n","output":"1\n"},{"problem_id":"p01879","input":"4\n4 1 3 2\n2\n1 3\n2 4\n","output":"2\n1\n"},{"problem_id":"p01880","input":"2\n1 2\n","output":"2\n"},{"problem_id":"p01881","input":"2 4\n%.@\\$\n..\\$\\$\n","output":"Yes\n"},{"problem_id":"p01882","input":"4\nDurett 7\nGayles 3\nFacenda 6\nDaughtery 0\n1\n+ Mccourtney 2\n","output":"Mccourtney is not working now.\nDurett is working hard now.\n"},{"problem_id":"p01883","input":"1\n","output":")(\n"},{"problem_id":"p01884","input":"5\n1 2\n1 3\n1 4\n1 5\n","output":"6\n"},{"problem_id":"p01885","input":"3 9\n6 3\n5 2\n3 1\n2\n2\n2\n","output":"2\n"},{"problem_id":"p01886","input":"8\n-10 0\n-10 5\n-5 5\n-5 0\n10 0\n10 -5\n5 -5\n5 0\n","output":"50\n"},{"problem_id":"p01887","input":"5 5 4\n6\n3 2\n4 2\n5 2\n1 4\n3 4\n5 4\n","output":"6\n"},{"problem_id":"p01888","input":"1 10 2\n1 1 1\n","output":"2.0\n"},{"problem_id":"p01889","input":"1\n5 1\n","output":"11111\n"},{"problem_id":"p01890","input":"5\n5 8 1 3 5\n1 2 4\n2 3 3\n2 4 3\n1 5 7\n","output":"4\n"},{"problem_id":"p01891","input":"5 3 6 9\n9 7 5 3 1\n","output":"2\n"},{"problem_id":"p01892","input":"19 30 3\n","output":"1\n"},{"problem_id":"p01893","input":"3\n1 2 0 0\n1 2 0 0\n","output":"YES\n0 1 0\n0 0 1\n0 0 0\n"},{"problem_id":"p01894","input":"3 3\n1 2\n2 3\n3 1\n","output":"YES\n"},{"problem_id":"p01896","input":"1 4\n0 1 2 3\n","output":"YES\n"},{"problem_id":"p01897","input":"3 3\n1 2\n2 3\n3 1\n","output":"YES\n"},{"problem_id":"p01898","input":"5 5\n--o--\n--xo-\n--x--\no---x\n--xoo\n","output":"3\n"},{"problem_id":"p01899","input":"5 130\n130 170 100 120 140\n","output":"50\n"},{"problem_id":"p01900","input":"6\n2 5 2 5 2 1\n","output":"5\n"},{"problem_id":"p01901","input":"20\n1\n0 10\n","output":"10\n"},{"problem_id":"p01902","input":"1\n1 1\n3 0 1 1\n1 1\n","output":"0.0\n"},{"problem_id":"p01903","input":"2 2 4\n1 3 4\n2 4 2\n0 3 3\n4 0 5\n","output":"8\n"},{"problem_id":"p01904","input":"1\n","output":"1\n"},{"problem_id":"p01905","input":"2 0\n","output":"1\n"},{"problem_id":"p01906","input":"8 2\n23 61 57 13 91 41 79 41\n","output":"170\n"},{"problem_id":"p01907","input":"0.75\n4\n1 2 1\n2 3 3\n3 4 10\n","output":"24.8569335938\n"},{"problem_id":"p01908","input":"5\npassword\nlogin\nadmin\nroot\nmaster\n","output":"b\n"},{"problem_id":"p01909","input":"RRLUDDD\n2\n","output":"7\n"},{"problem_id":"p01910","input":"4 4 2 2\n1 2 1\n2 3 1\n3 4 5\n4 1 7\n1 4 5\n2 4 3\n","output":"7\n"},{"problem_id":"p01911","input":"2 2 1 2\n1 2 10 100\n1 2 5 500\n","output":"5\n"},{"problem_id":"p01912","input":"2 2 2\n1 0 0 1\n0 0 1 0\n0 0\n0 1\n","output":"-1\n"},{"problem_id":"p01913","input":"5 4 2\n1 2 2\n2 3 1\n1 4 2\n4 5 1\n","output":"8\n"},{"problem_id":"p01914","input":"5\n3 5\n7 4\n11 9\n3 7\n7 8\n","output":"4\n"},{"problem_id":"p01915","input":"3 2 2\n50 65 70\n80 100 80\n90 65 45\n1 1\n","output":"225\n"},{"problem_id":"p01916","input":"hcpc\n","output":"1\n"},{"problem_id":"p01917","input":"9\n9 8 7 6 5 4 3 2 1\n1 1 1\n2 2 2\n3 3 3\n4 4 4\n5 5 5\n6 6 6\n7 7 7\n8 8 8\n9 9 9\n","output":"2\n"},{"problem_id":"p01919","input":"4 4\n1 2 3\n2 3 1\n2 4 5\n3 4 2\n5\n4 5 6\n","output":"34\n"},{"problem_id":"p01920","input":"10\n0101100110\n3\n3 3 1\n1 6 0\n2 5 1\n","output":"2\n1\n2\n"},{"problem_id":"p01921","input":"6 4\n1 2\n2 3\n2 4\n5 6\n4\n2 3\n3 1\n3 4\n","output":"1\n"},{"problem_id":"p01922","input":"5\n3 4 2 1 5\n3\n1 2 3\n","output":"Yes\n"},{"problem_id":"p01923","input":"5 3\n1 1\n2 3\n3 2\n3 5\n2 1\n4 2\n1 7\n2 1\n1 3\n1 5\n6 1\n1 3\n1 2\n1 8\n1 2\n1 7\n1 6\n20 9\n4 10\n2 4\n5 3\n6 6\n6 3\n7 4\n8 10\n4 6\n7 5\n1 8\n5 7\n1 5\n6 6\n9 9\n5 8\n6 7\n1 4\n6 4\n7 10\n3 5\n19 6\n4 1\n6 5\n5 10\n1 10\n3 10\n4 6\n2 3\n5 4\n2 10\n1 8\n3 4\n3 1\n5 4\n1 10\n1 3\n5 6\n5 2\n1 10\n2 3\n0 0\n","output":"9\n8\n8\n71\n51\n"},{"problem_id":"p01924","input":"5 2 3\n3\n5\n1\n2\n3\n3 100 100\n3\n3\n4\n20 3 8\n3\n2\n6\n1\n9\n1\n8\n4\n2\n2\n8\n1\n8\n8\n2\n5\n3\n4\n3\n8\n7 2 2\n0\n2\n5\n2\n5\n2\n1\n0 0 0\n","output":"3\n0\n11\n5\n"},{"problem_id":"p01925","input":"3 2\n5 2 1 3\n8 2 2 3\n2 3\n8 2 1 2\n3 1 1\n5 1 2\n2 5\n100 1 1\n100 1 1\n100 1 1\n100 1 1\n100 1 1\n3 4\n5 1 1\n5 1 2\n100 2 1 3\n100 2 2 3\n0 0\n","output":"14\n11\n501\n196\n"},{"problem_id":"p01926","input":"3 4\n1 5 9\n1 2\n1\n2 10\n1 1000000\n2 4\n1 10\n0 0\n","output":"3\n-1\n499996\n4\n"},{"problem_id":"p01927","input":"2\n4 1 0 0 1 0 1 1 0 1\n4 2 2 2 3 2 3 3 2 3\n60 45\n-1 -1 4 4\n4\n4 1 0 0 3 1 1 2 0 1\n3 2 10 7 8 2 12 4\n6 8 7 12 8 13 9 15 10 19 11 24 10 25\n5 4 16 2 16 4 12 8 14 2 15 0\n167 38\n3 3 15 21\n12\n4 3 -8 -3 -9 -3 -9 -5 -8 -6\n4 5 -4 -5 -7 -5 -7 -6 -5 -6\n4 2 -4 1 -5 1 -5 -4 -4 -4\n4 1 -1 1 -2 1 -2 -4 -1 -3\n4 2 2 3 -1 3 -2 2 3 2\n4 1 3 1 2 1 2 -3 3 -4\n4 7 1 0 0 0 0 -1 1 -1\n4 4 9 5 7 5 7 4 10 4\n4 3 6 5 5 4 5 0 6 0\n4 5 8 -1 5 -1 6 -2 8 -2\n4 1 10 0 9 0 9 -2 10 -1\n4 6 10 2 8 2 8 1 10 1\n131 78\n-10 10 10 -10\n0\n","output":"1.93185\n7.87174\n20.86840\n"},{"problem_id":"p01928","input":"2\n1 2 3\n4 2 3\n3\n2 5 2\n3 3 4\n5 5 5\n5\n1 1 1\n2 2 2\n3 3 3\n4 4 4\n5 5 5\n5\n1 1 1\n2 1 1\n3 1 1\n4 1 1\n5 1 1\n10\n3 1 4\n1 5 9\n2 6 5\n3 5 8\n9 7 9\n3 2 3\n8 4 6\n2 6 4\n3 3 8\n3 2 7\n0\n","output":"24\n145\n125\n15\n864\n"},{"problem_id":"p01929","input":"2\n2 1\n3\n3 1 2\n10\n2 1 1 1 1 1 1 1 1 1\n8\n2 1 4 3 3 7 6 6\n25\n2 3 2 5 4 5 8 7 8 11 10 13 12 15 14 17 16 19 18 21 20 23 22 25 24\n10\n2 1 4 3 6 5 8 7 10 9\n0\n","output":"2\n0\n0\n144\n633544712\n11520\n"},{"problem_id":"p01930","input":"3 2\n#.#\n...\n#.#\n###\n...\n###\n3 2\n#.#\n...\n#.#\n###\n#.#\n###\n3 3\n#..\n..#\n###\n..#\n#.#\n#..\n#..\n..#\n###\n5 3\n.....\n#####\n##...\n##.##\n##...\n.....\n#####\n.....\n#####\n.....\n...##\n##.##\n...##\n#####\n.....\n3 2\n#.#\n...\n#.#\n#.#\n#.#\n#.#\n0 0\n","output":"Yes\nNo\nYes\nYes\nYes\n"},{"problem_id":"p01931","input":"3\noxx\n","output":"2\n"},{"problem_id":"p01932","input":"2 2\n2 2\n3 3\n","output":"5\n"},{"problem_id":"p01933","input":"6 3\n0\n0\n2\n3\n4\n5\n","output":"5\n"},{"problem_id":"p01934","input":"3 1 2 3\n1 2 3\n1 3\n","output":"3\n"},{"problem_id":"p01935","input":"4 4\n0 1 3\n0 2 4\n1 3 1\n2 3 5\n","output":"4\n"},{"problem_id":"p01936","input":"3 5\n","output":"3\n"},{"problem_id":"p01937","input":"2 3\n0 1\n","output":"-1\n"},{"problem_id":"p01938","input":"AIZU\n","output":"2\n"},{"problem_id":"p01939","input":"3 9\n","output":"50\n"},{"problem_id":"p01940","input":"aizucamp\nazu\n","output":"yes\n"},{"problem_id":"p01941","input":"3 4\n3 2 2\n2 1 1\n2 1 1\n","output":"5\n"},{"problem_id":"p01942","input":"3 3 3 6\n1 0 1 1\n2 2 1 1 2 2\n3 1 1 1\n4 0 2 1\n5 2 1 1 2 2\n6 2 2 1 3 3\n","output":"0 1\n1 1\n0 1\n"},{"problem_id":"p01943","input":"6 2.01\n1.10\n1.44\n0.91\n2.00\n1.12\n1.55\n","output":"3\n"},{"problem_id":"p01944","input":"10 3 2\n3\n6\n6\n","output":"1\n0\n4\n2\n0\n0\n5\n0\n0\n4\n"},{"problem_id":"p01945","input":"((*)())\n","output":"2\n"},{"problem_id":"p01946","input":"65 60 3\n-2 3 -4\n","output":"4\n"},{"problem_id":"p01947","input":"3\n1 2\n4 7\n8 6\n2 3\n8 9\n5 3\n4 6\n5 6\n7 8\n1 4\n2 6\n5 9\n","output":"7 4 1\n8 6 2\n9 5 3\n"},{"problem_id":"p01948","input":"2\n2\n1 40 40 20\n","output":"0.8\n"},{"problem_id":"p01949","input":"3 3\n1+2\n+9*\n1*5\n","output":"46\n"},{"problem_id":"p01950","input":"3 3\n1 2\n1 3\n2 3\n","output":"2\n"},{"problem_id":"p01951","input":"3 3 2 10\n5 3 7\n2 6 1\n3 4 1\n","output":"Yes\n"},{"problem_id":"p01952","input":"4 20 20 1\n10 0\n20 10\n10 20\n0 10\n","output":"Yes\n"},{"problem_id":"p01953","input":"3 2\n2 3\n3 4\n1 2\n","output":"15\n"},{"problem_id":"p01954","input":"2 2 23 2\n7 10\n9 10\n","output":"1\n-1\n"},{"problem_id":"p01955","input":"5 4\n2 5\n2 4\n1 3\n1 2\n","output":"2\n3\n6\n5\n"},{"problem_id":"p01956","input":"4 3 3\n1 1 2 3\n","output":"9\n"},{"problem_id":"p01957","input":"[[m-y]-[a-o]]\no 0\na 1\ny 2\nm 0\n","output":"Yes\n"},{"problem_id":"p01958","input":"1 9\n","output":"4\n"},{"problem_id":"p01959","input":"3 3 1 3\n1 2 1\n2 3 5\n1 3 3\n","output":"6\n"},{"problem_id":"p01960","input":"2 1\n1 2\n","output":"0\n"},{"problem_id":"p01961","input":"11 7\n.......\n.......\n*.....*\n.......\n..@....\n.......\n*......\n.......\n....*..\n.......\n.......\n","output":".......\n.......\n*#####*\n......#\n..@...#\n..#.###\n*##.#..\n#...#..\n####*..\n.......\n.......\n"},{"problem_id":"p01962","input":"3\n2 0 0 1 0\n2 0 5 1 5\n4 1 -10 -5 10\n","output":"2\n"},{"problem_id":"p01963","input":"3\na\nb\nab\nabab\n","output":"4\n"},{"problem_id":"p01964","input":"4 4\n1 2\n2 3\n3 4\n4 1\n","output":"-1\n"},{"problem_id":"p01965","input":"2\n3\n1 5\n","output":"5\n"},{"problem_id":"p01966","input":"5 2\n1 4 1\n2 3 1\n","output":"4\n4\n"},{"problem_id":"p01967","input":"2\n3 3\n4\n1 1 2\n1 2 3\n2 1 3\n2 2 3\n","output":"1\n"},{"problem_id":"p01968","input":"4\n2 0 -2 1\n","output":"1\n1\n"},{"problem_id":"p01970","input":"3\n2 3 3\n","output":"2\n"},{"problem_id":"p01973","input":"brainfuck\n1\nfuck\n","output":"1\n"},{"problem_id":"p01974","input":"5\n1 2 4 7 10\n","output":"2 10\n"},{"problem_id":"p01975","input":"5\n1 2 3 4 5\n3 4 2 5 1\n","output":"Yes\n"},{"problem_id":"p01976","input":"8\n5 2 4 9 4 9 2 5\n","output":"1 2 4 6 7 8\n"},{"problem_id":"p01977","input":"5 3\n9 1 2 3 9\n","output":"20.000000\n"},{"problem_id":"p01978","input":"5 3 1 4\n3 1 2 5\n3 4 2 3\n5 4 2 2\n","output":"7\n"},{"problem_id":"p01979","input":"5124\n","output":"3\n"},{"problem_id":"p01980","input":"5 1 2\n3 1 5\n3 1 5\n4 1 5\n","output":"No\nYes\n"},{"problem_id":"p01981","input":"HEISEI 1 1 8\nHEISEI 31 4 30\nHEISEI 31 5 1\nHEISEI 99 12 31\nHEISEI 38 8 30\nHEISEI 98 2 22\nHEISEI 2 3 26\nHEISEI 28 4 23\n#\n","output":"HEISEI 1 1 8\nHEISEI 31 4 30\n? 1 5 1\n? 69 12 31\n? 8 8 30\n? 68 2 22\nHEISEI 2 3 26\nHEISEI 28 4 23\n"},{"problem_id":"p01982","input":"3 1988 2014\n400\n100\n4\n1 1000 1999\n1\n2 1111 3333\n2\n2\n6 2000 3000\n5\n7\n11\n9\n3\n13\n0 0 0\n","output":"7\n1000\n2223\n785\n"},{"problem_id":"p01983","input":"[+c[+a[^bd]]]\n0404\n[*b[*[*cd]a]]\n7777\n[^[^ab][^cd]]\n1295\na\n9876\n[^dd]\n9090\n.\n","output":"0 10\n7 1\n15 544\n9 1000\n0 10000\n"},{"problem_id":"p01984","input":"1\n2\n3\n390\n1124\n1546\n314159265358979323\n0\n","output":"10\n12\n13\n2020\n25252\n57577\n7744444777744474777777774774744777747477444774744744\n"},{"problem_id":"p01985","input":"6 7\n1 2\n1 4\n2 3\n2 5\n3 4\n4 5\n4 6\n2 1\n1 2\n3 3\n1 2\n1 3\n2 3\n4 3\n1 2\n2 3\n3 4\n5 4\n1 2\n2 3\n3 4\n4 5\n0 0\n","output":"2\n1\n2\n0\n0\n1\n1\n1\n1\n"},{"problem_id":"p01986","input":"3 3\n2 1\n2 2\n10\n10 4\n1 1\n1 5\n1 9\n1\n5 7\n1000000000 1\n1000000000 1\n1000000000 3\n1000000000 3\n1000000000 5\n1000000000 5\n1\n10000 11\n10934235 560\n3155907 1508\n10901182 2457\n3471816 3590\n10087848 4417\n16876957 5583\n23145027 6540\n15162205 7454\n1749653 8481\n6216466 9554\n7198514\n701 14\n8181 636\n4942 273\n1706 282\n6758 20\n7139 148\n6055 629\n8765 369\n5487 95\n6111 77\n2302 419\n9974 699\n108 444\n1136 495\n2443\n0 0\n","output":"10\n0\n5999999960\n23574372\n985\n"},{"problem_id":"p01987","input":"1 2\n2 1\n2 2\n0 0\n","output":"4.25\n7\n7.9722222222\n"},{"problem_id":"p01988","input":"8\n1 1 2 2\n0 2\n0 0\n2 0\n2 1\n3 1\n3 3\n1 3\n1 2\n12\n-9 5 9 -9\n0 0\n0 -13\n3 -13\n3 -10\n10 -10\n10 10\n-1 10\n-1 13\n-4 13\n-4 10\n-10 10\n-10 0\n12\n3 57 53 2\n0 0\n64 0\n64 18\n47 18\n47 39\n64 39\n64 60\n0 60\n0 44\n33 44\n33 30\n0 30\n0\n","output":"1\n1\n2\n"},{"problem_id":"p01989","input":"123456789\n","output":"1\n"},{"problem_id":"p01990","input":"5 2\n1 5 3 2 4\n5 2\n","output":"4 5 1 2 3\n"},{"problem_id":"p01991","input":"3\n1 2\n1 3\n2 3\n1\n1 3\n","output":"2\n"},{"problem_id":"p01992","input":"7\nbanana\nat\ntomb\nbus\nsound\ndoes\nsome\n","output":"2\n"},{"problem_id":"p01993","input":"5 4\n1 2 1\n2 3 10\n3 4 5\n4 5 1\n","output":"2 3\n"},{"problem_id":"p01994","input":"4\n101 110\n101 101\n1010 1101\n11011001 10010101\n","output":"1\n0\n3\n12\n"},{"problem_id":"p01995","input":"acpc\n","output":"5\n"},{"problem_id":"p01996","input":"6 4\n1 4 5 6\n","output":"2\n"},{"problem_id":"p01997","input":"1 2\n","output":"33.510322\n"},{"problem_id":"p01998","input":"3\n","output":"2\n"},{"problem_id":"p02000","input":"5\n1 2 3 4 5\n","output":"2\n"},{"problem_id":"p02001","input":"8\n.oo.ooo.\no.o.oo.o\n","output":"Yes\n"},{"problem_id":"p02002","input":"7\n9^2&1|2\n4\n0 6\n0 2\n2 6\n4 4\n","output":"3\n11\n2\n1\n"},{"problem_id":"p02003","input":"5 5\n.....\n.#.#.\n.###.\n.#.#.\n.....\n","output":"3\n"},{"problem_id":"p02004","input":"RRRRLLLLRRRR\n","output":"2\n"},{"problem_id":"p02005","input":"2\nwhite 20\nblack 10\n2\nblack\nwhite\n","output":"Yes\n"},{"problem_id":"p02006","input":"6 3 2\n1 2\n2 10\n3 5\n","output":"17\n24\n"},{"problem_id":"p02007","input":"6 7\nappreciate\nappropriate\nacceptance\nace\nacm\nacetylene\nappr iate\na e\na a\nac ce\nace e\nacceptance acceptance\nno match\n","output":"2\n5\n0\n2\n2\n1\n0\n"},{"problem_id":"p02008","input":"2\n0 0 2 0 0 2\n0 1 2 1 0 3\n","output":"0.5\n"},{"problem_id":"p02009","input":"2\n1\n1\n","output":"Alice\n"},{"problem_id":"p02010","input":"100\n+123\n","output":"2\n"},{"problem_id":"p02011","input":"3\n0 0\n3 0\n5 0\n","output":"31.415926535\n"},{"problem_id":"p02012","input":"25\n","output":"10\n"},{"problem_id":"p02013","input":"5 5 1 5\n1 2\n1 4\n2 3\n3 4\n3 5\n","output":"3\n"},{"problem_id":"p02014","input":"3 1\n3\n2\n1\n","output":"1\n3\n2\n"},{"problem_id":"p02015","input":"(No input)\n","output":"Paken\n"},{"problem_id":"p02016","input":"ani\n","output":"square1001\n"},{"problem_id":"p02017","input":"3 5 1 4\n","output":"No\n"},{"problem_id":"p02018","input":"5\n4 3 5 2 6\n","output":"3\n"},{"problem_id":"p02019","input":"6 3 2 1\n","output":"2\n"},{"problem_id":"p02020","input":"5\n2 3 5 6 7\n","output":"10\n"},{"problem_id":"p02021","input":"5\n4 2 5 3 1\n","output":"3\n"},{"problem_id":"p02022","input":"3 2\n3 1 5\n2 4\n","output":"54\n"},{"problem_id":"p02023","input":"4\n1 4\n3 6\n2 7\n5 8\n","output":"3\n"},{"problem_id":"p02024","input":"4 5 2 3\n","output":"Yes\n"},{"problem_id":"p02025","input":"2 2\n1 2\n4 8\n","output":"60\n"},{"problem_id":"p02026","input":"3\n1 2 5\n6 3 4\n","output":"0\n1\n2\n"},{"problem_id":"p02027","input":"6 3\n","output":"3\n"},{"problem_id":"p02028","input":"2 2\n1 5\n1 5\n","output":"8\n"},{"problem_id":"p02029","input":"3 1\n10 1\n20 2\n30 3\n20 2\n","output":"4\n"},{"problem_id":"p02030","input":"4 4\n1 2 4 9\n1 3 4 7\n","output":"2 6\n1\n4\n1\n2\n3\n4\n7\n9\n"},{"problem_id":"p02031","input":"2\n2 1\n","output":"(())\n"},{"problem_id":"p02032","input":"18\n","output":"2 5\n"},{"problem_id":"p02033","input":"5 1\n2\n1\n3\n","output":"2\n"},{"problem_id":"p02034","input":"6\ntabata\n","output":"3\n"},{"problem_id":"p02035","input":"3 310779401\n","output":"12\n"},{"problem_id":"p02036","input":"3 1000000007\n","output":"204\n"},{"problem_id":"p02037","input":"5 8\n2 2\n","output":"8\n"},{"problem_id":"p02038","input":"3\nF T T\n","output":"T\n"},{"problem_id":"p02039","input":"3\n1 1 8 8\n2 4 3 8\n8 8 8 8\n","output":"48\n7\n1\n"},{"problem_id":"p02041","input":"4\n6 4 7 8\n","output":"21\n"},{"problem_id":"p02042","input":"5 2\n0 3 2 1 4\n","output":"12\n"},{"problem_id":"p02043","input":"4 4 10\n100 100 100 100\n100 100 100 100\n1 100 100 1\n1 1 1 1\n","output":"970\n"},{"problem_id":"p02044","input":"3 300\n120 100 80\n3 30\n10 20 5\n4 1000\n100 200 300 400\n5 5\n2523 8430 3 4199 632\n0 0\n","output":"280\n25\n800\n5\n"},{"problem_id":"p02045","input":"2\n3 3 5 7\n3 3\n7 3\n7 7\n5\n1 10 100 10\n1 1\n100 1\n50 20\n50 80\n51 21\n51 1\n0\n","output":"5\n174\n"},{"problem_id":"p02046","input":"2 0\n2 2\n1 -1\n0 0\n0 -5\n173 207\n","output":"2\n4\n1\n0\n6\n379\n"},{"problem_id":"p02047","input":"typewriter\nperiodicity\n100010\n100100\n101000\n110000\nperiodicity\ntypewriter\n100010\n100100\n101000\n110000\nperiodicity\ntypewriter\n100010\n100100\n101000\n1\ndomestic\ncontest\n100010\n100100\n101000\n110000\n#\n","output":"823120\n1001540\n603217\n502210\n"},{"problem_id":"p02048","input":"3 3\n1 2 3\n2 1 3\n3 3 3\n8 5\n3 3 4 3 4\n2 1 2 3 2\n7 9 7 8 7\n3 4 3 3 4\n1 2 2 3 2\n4 5 6 5 6\n7 9 7 7 8\n4 5 5 6 6\n5 5\n1 2 3 4 5\n2 3 4 5 1\n3 4 5 1 2\n4 5 1 2 3\n5 1 2 3 4\n5 9\n1 1 1 1 1 1 1 1 1\n2 2 2 2 2 2 2 2 2\n3 3 3 3 3 3 3 3 3\n4 4 4 4 4 4 4 4 4\n5 5 5 5 5 5 5 5 5\n0 0\n","output":"2\n3\n1\n9\n"},{"problem_id":"p02049","input":"MI2(2SI)2PI\nISSI\n100(100(JAG))\nJAG\n1000000000000000000A\nAAAAA\n#\n","output":"2\n10000\n999999999999999996\n"},{"problem_id":"p02050","input":"5 2\n1 1\n1 4\n2 2\n3 1\n3 5\n3 1\n0 2\n1 0\n-1 0\n3 2\n0 2\n1 0\n-1 0\n9 10\n8 1\n9 19\n2 10\n1 1\n4 17\n7 13\n3 4\n6 13\n9 21\n0 0\n","output":"11.812559200041266\n6.472135954999580\n-1\n52.202878812480016\n"},{"problem_id":"p02051","input":"4 9\n1 2 1\n1 2 2\n1 3 1\n1 3 2\n1 3 3\n2 3 1\n2 3 2\n1 4 1\n3 4 2\n8\n1 5\n2 5\n3 5\n4 5\n1 1234567\n2 1234567\n3 1234567\n4 1234567\n4 8\n1 2 1\n1 2 1\n1 2 3\n3 4 3\n1 4 2\n2 4 1\n2 4 3\n2 4 3\n8\n1 3\n2 6\n3 8\n4 12\n1 31415926\n2 53589793\n3 23846\n4 26433832\n0 0\n","output":"1\n9\n37\n21\n1\n2469133\n307629943\n60012504\n1\n16\n0\n424\n1\n160769377\n0\n43581113\n"},{"problem_id":"p02052","input":"3 3\nB.B\n..B\n.BB\n","output":"4\n"},{"problem_id":"p02053","input":"3 3\nB.B\n..B\n.BB\n","output":"4\n"},{"problem_id":"p02054","input":"1 1 10\n","output":"Hom\n"},{"problem_id":"p02055","input":"3 2\n1 3 2\n","output":"Yes\n"},{"problem_id":"p02056","input":"4 4 3\n3 6 1 6\n1 1 2 3\n6 1 5 5\n1 2 1\n2 3 1\n1 3 1\n1 4 1\n","output":"10\n8\n9\n"},{"problem_id":"p02057","input":"3 3\n5 1 6\n2 3 4\n","output":"9\n"},{"problem_id":"p02058","input":"3 2\n1 2\n1 3\n","output":"5\n"},{"problem_id":"p02059","input":"?MG?\n","output":"3\n"},{"problem_id":"p02060","input":"10\n1 2 3 4\n1 2 4 8\n","output":"6\n"},{"problem_id":"p02061","input":"3\n43\n9\n24\n","output":"11\n0\n5\n"},{"problem_id":"p02062","input":"?&?|?&?|?&?\n","output":"3 2\n"},{"problem_id":"p02063","input":"4 6\n","output":"8\n"},{"problem_id":"p02065","input":"3 2 7\n","output":"1\n"},{"problem_id":"p02066","input":"3 10\n6 8 2\n1 2 3\n2 3 8\n","output":"14\n"},{"problem_id":"p02078","input":"3\n2 1\n3 2\n1 3\n","output":"2\n"},{"problem_id":"p02079","input":"5 6 1 4 2 3\n1 2\n2 3\n3 4\n4 5\n3 5\n1 5\n","output":"2\n"},{"problem_id":"p02080","input":"3\ndea\nxxx\nabcd\n","output":"6\n"},{"problem_id":"p02081","input":"2\n0\n1\n0\n1\n","output":"1\n"},{"problem_id":"p02082","input":"0 15656\n3 7 13333\n0\n","output":"15656\n"},{"problem_id":"p02083","input":"2 1\n2 1 2\n","output":"1\n"},{"problem_id":"p02084","input":"1\n0 500000\n","output":"1\n"},{"problem_id":"p02085","input":"1\n","output":"0\n"},{"problem_id":"p02086","input":"zaki\no\n4\n","output":"0\n"},{"problem_id":"p02087","input":"2 1\n","output":"2\n"},{"problem_id":"p02088","input":"3\n4 5 6\n","output":"2\n"},{"problem_id":"p02089","input":"3 3 3 10\n1 -2 3\n1 2 2 3\n2 20 1 3\n2 1 20 5\n","output":"1\n"},{"problem_id":"p02090","input":"1 3\n1 2\n","output":"2\n"},{"problem_id":"p02091","input":"2 6 1 5\n","output":"Yes\n0 3 4 7\n"},{"problem_id":"p02092","input":"3 2\n6 5 4\n8 1\n7 1\n","output":"3\n"},{"problem_id":"p02093","input":"4\n2 1 4 3\n","output":"4\n"},{"problem_id":"p02094","input":"3\n1 2\n2 3\n1 2\n3 1\n","output":"1\n"},{"problem_id":"p02095","input":"2 10\n1 2\n1 9\n8 7\n","output":"2\n1\n"},{"problem_id":"p02096","input":"2\n3 0\n1 2 3\n3 1\n1 2 3\n","output":"3 2 1\n3 65536 0\n"},{"problem_id":"p02097","input":"4\n","output":"Yes\n2 6 3 7\n4 5 2 1\n1 7 5 6\n5 3 4 2\n"},{"problem_id":"p02098","input":"10\n20\n","output":"15.0\n"},{"problem_id":"p02099","input":"3\n1.000\n3.000\n3.000\n","output":"0\n4\n4\n"},{"problem_id":"p02100","input":"x^2+3x+2\n","output":"(x+1)(x+2)\n"},{"problem_id":"p02101","input":"3 10\n1 6\n5 10\n0 5\n","output":"2\n"},{"problem_id":"p02102","input":"4 5\n0 2 22 13\n0 3 15 25\n1 2 3 3\n1 3 28 5\n2 3 5 22\n","output":"0.36000\n"},{"problem_id":"p02103","input":"3 5 2\n0 2\n2 2\n","output":"1\n"},{"problem_id":"p02104","input":"5\n1 2 3 4 5\n","output":"1\n2\n3\n4\n5\n"},{"problem_id":"p02105","input":"7 10 11\n1 1 0\n1 0 1\n2 2 2\n3 3 5\n4 1 3\n5 1 3\n5 5 -1\n","output":"Yes\n"},{"problem_id":"p02106","input":"7 5\n0 1\n1 2\n1 3\n0 4\n4 5\n4 6\n1 0 0 9\n2 0 0 5\n2 1 5 8\n1 0 5 8\n1 0 8 8\n","output":"7\n7\n3\n"},{"problem_id":"p02107","input":"3 3\n1 2 3\n2 1 2\n3 2 1\n","output":"0\n1\n"},{"problem_id":"p02108","input":"2 1\n1 2\n0 1\n","output":"1\n"},{"problem_id":"p02109","input":"4\n1 5\n2 3 5\n3 3 5 7\n4 3 5 7 9\n","output":"8\n"},{"problem_id":"p02110","input":"3 2\n2 1\n1 2\n1 3\n","output":"1\n3\n"},{"problem_id":"p02111","input":"0\n","output":"0 0\n"},{"problem_id":"p02112","input":"1\n1 1 359 1\n","output":"0\n"},{"problem_id":"p02113","input":"4 2\noi\nio\nrr\nrr\n","output":"iorrrroi\n"},{"problem_id":"p02114","input":"5\noxooo\noxooo\noxooo\nxxxxx\noxooo\n","output":"1\n"},{"problem_id":"p02115","input":"3\n2\n5\n1\n","output":"2\n"},{"problem_id":"p02116","input":"2\n","output":"1\n"},{"problem_id":"p02117","input":"1 10 10\n3\n1 10 1\n2 20 2\n3 30 3\n0\n","output":"100\n"},{"problem_id":"p02118","input":"3 3 5\n0 3\n2 2\n4 1\n","output":"25\n"},{"problem_id":"p02119","input":"3\n0\n0\n2\n","output":"1\n1\n2\n"},{"problem_id":"p02120","input":"9 10\n1 2 3 4 5 6 7 8 9\n1 2\n2 3\n2 4\n3 4\n4 5\n4 6\n2 7\n7 8\n7 9\n9 1\n","output":"44\n25\n42\n30\n40\n39\n30\n37\n36\n"},{"problem_id":"p02121","input":"2 1\n0 0 5 5\n3 3 6 6\n2 2\n","output":"4.2426406871\n"},{"problem_id":"p02122","input":"5\n1 3 5 7 9\n6 2 3 2 6\n10\n1 3 4\n3 4 5\n4 2 3\n5 -1 -1\n2 3 8\n3 2 5\n4 3 3\n1 1 1\n6 -1 -1\n3 1 5\n","output":"7\n2\n2\n8\n1\n"},{"problem_id":"p02123","input":"5\noxooo\noxooo\noxooo\nxxxxx\noxooo\n","output":"1\n4\n2\n"},{"problem_id":"p02124","input":"0\n","output":"ai1333\n"},{"problem_id":"p02125","input":"2\n","output":"1\n"},{"problem_id":"p02126","input":"3 3 2\n1 1\n1 1\n1 100\n2 10\n","output":"110\n"},{"problem_id":"p02127","input":"AABABCAC\nA\n","output":"2\n"},{"problem_id":"p02128","input":"10 10 1\n6 6\n","output":"10\n"},{"problem_id":"p02129","input":"3\n2 0 0\n1 1\n5 1 0 0 1 0\n","output":"yes\n"},{"problem_id":"p02130","input":"5 3 5\n7 2\n13 1\n1 1\n2 9\n2 4\n","output":"4\n"},{"problem_id":"p02131","input":"2 3\n00\n","output":"0\n"},{"problem_id":"p02132","input":"5 2\n0 0\n5 5\n10 10\n100 100\n200 200\n","output":"70.710678118755\n"},{"problem_id":"p02133","input":"4 4 7\n1 2 3 4\n1 2 3 4\n3 2 3 2 3\n4 2 3 2 3\n3 1 1 1 1\n4 1 1 1 1\n1 1 1 1\n3 1 4 1 2\n4 2 3 2 4\n","output":"4 1\n9 1\n1 1\n1 1\n2 2\n12 1\n"},{"problem_id":"p02134","input":"0 0\n13 33\n2\n0 34\n14 0\n","output":"0\n"},{"problem_id":"p02135","input":"10\n1 2 3 4 5 6 7 8 9 10\n1 2\n2 3\n3 4\n3 5\n2 6\n6 7\n2 8\n8 9\n8 10\n3\n3 8\n7 1\n7 10\n","output":"13\n27\n12\n"},{"problem_id":"p02136","input":"2\n-1 -1 10\n1 1 1\n","output":"0\n1\n"},{"problem_id":"p02137","input":"5700\n","output":"5500\n"},{"problem_id":"p02138","input":"20 10\n","output":"0\n"},{"problem_id":"p02139","input":"5 4\n1 2\n0 2\n1 1\n0 3\n","output":"4\n1\n"},{"problem_id":"p02140","input":"2 2 0 0 1 1\n","output":"2 8\n"},{"problem_id":"p02141","input":"6000 5000 20 10 400 300\n","output":"0.75\n"},{"problem_id":"p02142","input":"2 1 1 2\n1 2 1 100\n","output":"19\n"},{"problem_id":"p02143","input":"5 3\n1 4\n3 7\n0 1000\n","output":"7\n10\n9\n5\n8\n"},{"problem_id":"p02144","input":"2\n1 1\n0\n","output":"1\n"},{"problem_id":"p02145","input":"5\nyou\nate\nmy\nhum\ntoast\n","output":"e\nt\nu\n"},{"problem_id":"p02146","input":"5\n4 0 4 0 0\n1 2\n1 3\n1 4\n2 5\n","output":"7\n"},{"problem_id":"p02147","input":"4\n2 3\n1 2\n2 1\n3 2\n4\n1 3\n1 1\n3 3\n3 1\n","output":"1.414213562373\n"},{"problem_id":"p02148","input":"3 3\n0 2\n1 2\n1 1 0 0 1\n0 0 2\n0 0 1\n","output":"3\n3\n"},{"problem_id":"p02149","input":"1000 900 850\n","output":"A\n"},{"problem_id":"p02150","input":"3 1 5\n","output":"7\n"},{"problem_id":"p02151","input":"10\n1236547896\n","output":"123\n456\n789\n"},{"problem_id":"p02152","input":"2\n5 3\n","output":"2.83333333\n"},{"problem_id":"p02153","input":"4 4 1 1\ng#..\n#...\n.*..\n...s\n","output":"7\n"},{"problem_id":"p02154","input":"4\n2 3\n1 2\n2 1\n3 2\n","output":"3.04720672\n"},{"problem_id":"p02155","input":"1 1\n2\n","output":"First\n"},{"problem_id":"p02156","input":"3 1\nRRL\n5 5 1\n3 1 10\n","output":"1\n"},{"problem_id":"p02157","input":"4 2 1 1\n","output":"0\n0\n"},{"problem_id":"p02158","input":"100 5\n50 1 5\n50 5 10\n50 20 30\n50 40 60\n50 61 1000000\n","output":"48.6090201099\n"},{"problem_id":"p02159","input":"2\n1 2\n","output":"0\n"},{"problem_id":"p02160","input":"7 3\n1 1 2\n1 2 1\n3 1 2 4 5\n","output":"0\n1\n0\n"},{"problem_id":"p02161","input":"12 3\nitisansansan\n1 12\n5 12\n6 7\n","output":"2\n1\n0\n"},{"problem_id":"p02162","input":"9 8 1000 999\n","output":"Alice\n"},{"problem_id":"p02163","input":"3\n1 2\n2 10\n3 8\n","output":"-2 2\n"},{"problem_id":"p02164","input":"2\n0 1\n0 -1\n","output":"450.00000000\n"},{"problem_id":"p02165","input":"8 5\n_###_\n_#_B#\n_####\n____#\n###_#\n#####\n###_#\n####_\n","output":"1\n"},{"problem_id":"p02166","input":"3 3\n2 3 1\n","output":"Yes\n"},{"problem_id":"p02167","input":"3 1 6\n1 2 3\nR 1 1\n1 2\n1 3\n2 1\n2 3\n3 1\n3 2\n","output":"1\n3\n6\n3\n6\n7\n"},{"problem_id":"p02168","input":"1\n2 4\n","output":"mo3tthi\n"},{"problem_id":"p02169","input":"2 10 1\n","output":"1024\n"},{"problem_id":"p02170","input":"1 1 50\n","output":"1\n"},{"problem_id":"p02171","input":"abab\n5 5\n2 2 4\n1 1 5 abab\n2 3 5\n1 3 3 a\n2 1 5\n","output":"0\n3\n4\n"},{"problem_id":"p02172","input":"0 0 10\n1\n2\n","output":"440\n"},{"problem_id":"p02173","input":"2 1\n1 1 1\n2 2 2\n1 2\n","output":"3\n0\n"},{"problem_id":"p02174","input":"3\n1 2 3\n","output":"64\n"},{"problem_id":"p02175","input":"10 30 10\n3\nnobiro\nnobiro\ntidime\n","output":"80\n"},{"problem_id":"p02176","input":"5\nANazA\n","output":"1\nA\n"},{"problem_id":"p02177","input":"5 2\n1 2\n2 1\n","output":"1 2\n1 2\n3\n4\n5\n"},{"problem_id":"p02178","input":"4 10 1 4\n1 2 52\n1 3 68\n3 4 45\n","output":"Yes\n"},{"problem_id":"p02179","input":"2\n5 10 5 5\n4 4 2 2\n","output":"14\n"},{"problem_id":"p02180","input":"3 6 10\n1 1 1\n2 2 1\n4 3 1\n5 1 0\n6 2 0\n6 3 0\n","output":"2\n1\n2\n"},{"problem_id":"p02181","input":"2\nAORA\nOR\n","output":"2\n"},{"problem_id":"p02182","input":"2 3\n..#\n##.\n.##\n#..\n","output":"2\n"},{"problem_id":"p02183","input":"2 3\n##.\n.##\n2 3\n#..\n###\n1 4\n####\n2 3\n###\n.#.\n2\n####....##\n####...###\n####..####\n####...###\n###..#####\n###...####\n###...####\n###....###\n","output":"Yes\nYes\n"},{"problem_id":"p02184","input":"2\n1000000007\n","output":"1000000009\n"},{"problem_id":"p02185","input":"73\n6?\n","output":"645\n"},{"problem_id":"p02186","input":"5 2\n1 2 -3 4 -5\n3 3\n2 -6\n","output":"4\n10\n7\n"},{"problem_id":"p02187","input":"abracadabra\ncadabra\n4\n","output":"Yes\n"},{"problem_id":"p02188","input":"3\n1 2 3\n1 2\n1 3\n","output":"2\n3\n3\n"},{"problem_id":"p02189","input":"6\n8 6 9 1 2 1\n","output":"4\n"},{"problem_id":"p02190","input":"6\n8 6 9 1 2 1\n","output":"5\n"},{"problem_id":"p02191","input":"6 3\n8 6 9 1 2 1\n2 8\n1 7\n3 5\n","output":"3\n4\n0\n"},{"problem_id":"p02192","input":"6 6\n8 6 9 1 2 1\n","output":"7\n"},{"problem_id":"p02193","input":"6 6\n8 1\n6 1\n9 4\n1 5\n2 1\n1 4\n2 1 3\n1 1 3 3\n2 1 3\n2 4 6\n1 4 6 3\n2 4 6\n","output":"6\n9\n2\n4\n"},{"problem_id":"p02194","input":"6\n8 6 9 1 2 1\n","output":"51\n"},{"problem_id":"p02195","input":"10 3\n1 2\n2 5\n2 6\n1 4\n1 3\n3 7\n3 8\n3 9\n9 10\n1 3\n2 1\n2 8\n","output":"5\n1\n"},{"problem_id":"p02196","input":"2 2\n14 86 9 121\n3 34 3 34\n1 14 5 14\n1 9 1 9\n","output":"No\nYes\n"},{"problem_id":"p02198","input":"3 4\n","output":"12\n"},{"problem_id":"p02199","input":"14 86\n9 1 20\n","output":"119.428571428571\n"},{"problem_id":"p02200","input":"5\n8 6 9 1 20\n","output":"2\n"},{"problem_id":"p02201","input":"5\nE869120\nTMJN\nE869120\nTAISA\nYNYMXIAOLONGBAO\n","output":"2\n"},{"problem_id":"p02202","input":"1\n59549\n","output":"59548\n"},{"problem_id":"p02203","input":"5\n8 6 9 1 20\n","output":"3\n5\n"},{"problem_id":"p02204","input":"2 3\n2 2 1\n","output":"1\n"},{"problem_id":"p02205","input":"3\n3 4\n","output":"-4 3\n"},{"problem_id":"p02206","input":"1 1\n","output":"1\n"},{"problem_id":"p02207","input":"3\n3 3\n5 4\n8 1\n2\n1 4\n4 9\n","output":"700000000.000000000000\n539999999.999999880791\n"},{"problem_id":"p02208","input":"1 1 1 1 1 1 1\n1 1\n1 1\n","output":"1\n"},{"problem_id":"p02209","input":"5 9\n8 6 9 1 2\n","output":"2\n"},{"problem_id":"p02210","input":"5 0\n1 1 1 1 1\n","output":"1\n"},{"problem_id":"p02211","input":"5 5 2\ns..#a\n.#...\na#e.#\n...#a\n.#...\n","output":"14\n"},{"problem_id":"p02212","input":"2 1 3 4\n","output":"0\n"},{"problem_id":"p02213","input":"3 3\n631\n4#2\n516\n","output":"YES\n"},{"problem_id":"p02214","input":"4 4\n1 2 1\n1 3 8\n3 2 0\n1 4 7\n4\n1 2 1\n2 1 2\n1 4 1\n3 4 1073741824\n","output":"1\n8\n7\n-1\n"},{"problem_id":"p02215","input":"2 3\n","output":"2\n"},{"problem_id":"p02216","input":"2\n1 2\n","output":"First\n"},{"problem_id":"p02217","input":"4\n1 2\n1 3\n3 4\n0 3 2 0\n-3 4 5 -1\n","output":"4\n"},{"problem_id":"p02218","input":"6\n2 4 1\n1 2 1\n4 6 1\n2 3 1\n4 5 1\n5\n2 5\n2 3\n1 2\n3 5\n1 4\n","output":"1 6\n2 3 4\n3 1 3 4\n1 5\n2 1 3\n"},{"problem_id":"p02219","input":"2 4 0\n2 4\n","output":"3\n"},{"problem_id":"p02220","input":"7\n0 4 2 3 6 5 1\n","output":"1\n1 0100101\n"},{"problem_id":"p02221","input":"2\n100\n1 4 2 3\n","output":"1\n2\n1\n2\n"},{"problem_id":"p02222","input":"7\n1 3\n2 3\n3 4\n4 5\n4 6\n6 7\n","output":"1100111\n"},{"problem_id":"p02223","input":"2\n","output":"2\n0\n11\n"},{"problem_id":"p02233","input":"3\n","output":"3\n"},{"problem_id":"p02234","input":"6\n30 35\n35 15\n15 5\n5 10\n10 20\n20 25\n","output":"15125\n"},{"problem_id":"p02235","input":"3\nabcbdab\nbdcaba\nabc\nabc\nabc\nbc\n","output":"4\n3\n2\n"},{"problem_id":"p02236","input":"5\n0.1500 0.1000 0.0500 0.1000 0.2000\n0.0500 0.1000 0.0500 0.0500 0.0500 0.1000\n","output":"2.75000000\n"},{"problem_id":"p02237","input":"4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n","output":"0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0\n"},{"problem_id":"p02238","input":"4\n1 1 2\n2 1 4\n3 0\n4 1 3\n","output":"1 1 8\n2 2 7\n3 4 5\n4 3 6\n"},{"problem_id":"p02239","input":"4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n","output":"1 0\n2 1\n3 2\n4 1\n"},{"problem_id":"p02240","input":"10 9\n0 1\n0 2\n3 4\n5 7\n5 6\n6 7\n6 8\n7 8\n8 9\n3\n0 1\n5 9\n1 3\n","output":"yes\nyes\nno\n"},{"problem_id":"p02241","input":"5\n -1 2 3 1 -1\n 2 -1 -1 4 -1\n 3 -1 -1 1 1\n 1 4 1 -1 3\n -1 -1 1 3 -1\n","output":"5\n"},{"problem_id":"p02242","input":"5\n0 3 2 3 3 1 1 2\n1 2 0 2 3 4\n2 3 0 3 3 1 4 1\n3 4 2 1 0 1 1 4 4 3\n4 2 2 1 3 3\n","output":"0 0\n1 2\n2 2\n3 1\n4 3\n"},{"problem_id":"p02243","input":"5\n0 3 2 3 3 1 1 2\n1 2 0 2 3 4\n2 3 0 3 3 1 4 1\n3 4 2 1 0 1 1 4 4 3\n4 2 2 1 3 3\n","output":"0 0\n1 2\n2 2\n3 1\n4 3\n"},{"problem_id":"p02244","input":"2\n2 2\n5 3\n","output":"......Q.\nQ.......\n..Q.....\n.......Q\n.....Q..\n...Q....\n.Q......\n....Q...\n"},{"problem_id":"p02245","input":"1 3 0\n4 2 5\n7 8 6\n","output":"4\n"},{"problem_id":"p02246","input":"1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n","output":"8\n"},{"problem_id":"p02247","input":"aabaaa\naa\n","output":"0\n3\n4\n"},{"problem_id":"p02248","input":"aabaaa\naa\n","output":"0\n3\n4\n"},{"problem_id":"p02249","input":"4 5\n00010\n00101\n00010\n00100\n3 2\n10\n01\n10\n","output":"0 3\n1 2\n"},{"problem_id":"p02250","input":"aabaaa\n4\naa\nba\nbb\nxyz\n","output":"1\n1\n0\n0\n"},{"problem_id":"p02251","input":"100\n","output":"4\n"},{"problem_id":"p02252","input":"3 50\n60 10\n100 20\n120 30\n","output":"240\n"},{"problem_id":"p02253","input":"5\n1 2\n3 9\n3 5\n5 9\n6 8\n","output":"3\n"},{"problem_id":"p02254","input":"abca\n","output":"6\n"},{"problem_id":"p02255","input":"6\n5 2 4 6 1 3\n","output":"5 2 4 6 1 3\n2 5 4 6 1 3\n2 4 5 6 1 3\n2 4 5 6 1 3\n1 2 4 5 6 3\n1 2 3 4 5 6\n"},{"problem_id":"p02256","input":"54 20\n","output":"2\n"},{"problem_id":"p02257","input":"5\n2\n3\n4\n5\n6\n","output":"3\n"},{"problem_id":"p02258","input":"6\n5\n3\n1\n3\n4\n3\n","output":"3\n"},{"problem_id":"p02259","input":"5\n5 3 2 4 1\n","output":"1 2 3 4 5\n8\n"},{"problem_id":"p02260","input":"6\n5 6 4 2 1 3\n","output":"1 2 3 4 5 6\n4\n"},{"problem_id":"p02261","input":"5\nH4 C9 S4 D2 C3\n","output":"D2 C3 H4 S4 C9\nStable\nD2 C3 S4 H4 C9\nNot stable\n"},{"problem_id":"p02262","input":"5\n5\n1\n4\n3\n2\n","output":"2\n4 1\n3\n1\n2\n3\n4\n5\n"},{"problem_id":"p02263","input":"1 2 +\n","output":"3\n"},{"problem_id":"p02264","input":"5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n","output":"p2 180\np5 400\np1 450\np3 550\np4 800\n"},{"problem_id":"p02265","input":"7\ninsert 5\ninsert 2\ninsert 3\ninsert 1\ndelete 3\ninsert 6\ndelete 5\n","output":"6 1 2\n"},{"problem_id":"p02266","input":"\\\\\/\/\n","output":"4\n1 4\n"},{"problem_id":"p02267","input":"5\n1 2 3 4 5\n3\n3 4 1\n","output":"3\n"},{"problem_id":"p02268","input":"5\n1 2 3 4 5\n3\n3 4 1\n","output":"3\n"},{"problem_id":"p02269","input":"5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n","output":"no\nyes\n"},{"problem_id":"p02270","input":"5 3\n8\n1\n7\n3\n9\n","output":"10\n"},{"problem_id":"p02271","input":"5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n","output":"no\nno\nyes\nyes\nyes\nyes\nno\nno\n"},{"problem_id":"p02272","input":"10\n8 5 9 2 6 3 7 1 10 4\n","output":"1 2 3 4 5 6 7 8 9 10\n34\n"},{"problem_id":"p02273","input":"1\n","output":"0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n"},{"problem_id":"p02274","input":"5\n3 5 2 1 4\n","output":"6\n"},{"problem_id":"p02275","input":"7\n2 5 1 3 2 3 0\n","output":"0 1 2 2 3 3 5\n"},{"problem_id":"p02276","input":"12\n13 19 9 5 12 8 7 4 21 2 6 11\n","output":"9 5 8 7 4 2 6 [11] 21 13 19 12\n"},{"problem_id":"p02277","input":"6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n","output":"Not stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n"},{"problem_id":"p02278","input":"5\n1 5 3 4 2\n","output":"7\n"},{"problem_id":"p02279","input":"13\n0 3 1 4 10\n1 2 2 3\n2 0\n3 0\n4 3 5 6 7\n5 0\n6 0\n7 2 8 9\n8 0\n9 0\n10 2 11 12\n11 0\n12 0\n","output":"node 0: parent = -1, depth = 0, root, [1, 4, 10]\nnode 1: parent = 0, depth = 1, internal node, [2, 3]\nnode 2: parent = 1, depth = 2, leaf, []\nnode 3: parent = 1, depth = 2, leaf, []\nnode 4: parent = 0, depth = 1, internal node, [5, 6, 7]\nnode 5: parent = 4, depth = 2, leaf, []\nnode 6: parent = 4, depth = 2, leaf, []\nnode 7: parent = 4, depth = 2, internal node, [8, 9]\nnode 8: parent = 7, depth = 3, leaf, []\nnode 9: parent = 7, depth = 3, leaf, []\nnode 10: parent = 0, depth = 1, internal node, [11, 12]\nnode 11: parent = 10, depth = 2, leaf, []\nnode 12: parent = 10, depth = 2, leaf, []\n"},{"problem_id":"p02280","input":"9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n","output":"node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n"},{"problem_id":"p02281","input":"9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n","output":"Preorder\n 0 1 2 3 4 5 6 7 8\nInorder\n 2 1 3 0 6 5 7 4 8\nPostorder\n 2 3 1 6 7 5 8 4 0\n"},{"problem_id":"p02282","input":"5\n1 2 3 4 5\n3 2 4 1 5\n","output":"3 4 2 5 1\n"},{"problem_id":"p02283","input":"8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n","output":" 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n"},{"problem_id":"p02284","input":"10\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\nfind 12\ninsert 17\ninsert 25\nfind 16\nprint\n","output":"yes\nno\n 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n"},{"problem_id":"p02285","input":"18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n","output":"yes\nyes\nyes\nno\nno\nno\nyes\nyes\n 1 2 3 7 8 22\n 8 2 1 3 7 22\n 1 2 8 22\n 8 2 1 22\n"},{"problem_id":"p02286","input":"16\ninsert 35 99\ninsert 3 80\ninsert 1 53\ninsert 14 25\ninsert 80 76\ninsert 42 3\ninsert 86 47\ninsert 21 12\ninsert 7 10\ninsert 6 90\nprint\nfind 21\nfind 22\ndelete 35\ndelete 99\nprint\n","output":" 1 3 6 7 14 21 35 42 80 86\n 35 6 3 1 14 7 21 80 42 86\nyes\nno\n 1 3 6 7 14 21 42 80 86\n 6 3 1 80 14 7 21 42 86\n"},{"problem_id":"p02287","input":"5\n7 8 1 2 3\n","output":"node 1: key = 7, left key = 8, right key = 1,\nnode 2: key = 8, parent key = 7, left key = 2, right key = 3,\nnode 3: key = 1, parent key = 7,\nnode 4: key = 2, parent key = 8,\nnode 5: key = 3, parent key = 8,\n"},{"problem_id":"p02288","input":"10\n4 1 3 2 16 9 10 14 8 7\n","output":" 16 14 10 8 7 9 3 2 4 1\n"},{"problem_id":"p02289","input":"insert 8\ninsert 2\nextract\ninsert 10\nextract\ninsert 11\nextract\nextract\nend\n","output":"8\n10\n11\n2\n"},{"problem_id":"p02290","input":"0 0 2 0\n3\n-1 1\n0 1\n1 1\n","output":"-1.0000000000 0.0000000000\n0.0000000000 0.0000000000\n1.0000000000 0.0000000000\n"},{"problem_id":"p02291","input":"0 0 2 0\n3\n-1 1\n0 1\n1 1\n","output":"-1.0000000000 -1.0000000000\n0.0000000000 -1.0000000000\n1.0000000000 -1.0000000000\n"},{"problem_id":"p02292","input":"0 0 2 0\n2\n-1 1\n-1 -1\n","output":"COUNTER_CLOCKWISE\nCLOCKWISE\n"},{"problem_id":"p02293","input":"3\n0 0 3 0 0 2 3 2\n0 0 3 0 1 1 1 4\n0 0 3 0 1 1 2 2\n","output":"2\n1\n0\n"},{"problem_id":"p02294","input":"3\n0 0 3 0 1 1 2 -1\n0 0 3 0 3 1 3 -1\n0 0 3 0 3 -2 5 0\n","output":"1\n1\n0\n"},{"problem_id":"p02295","input":"3\n0 0 2 0 1 1 1 -1\n0 0 1 1 0 1 1 0\n0 0 1 1 1 0 0 1\n","output":"1.0000000000 0.0000000000\n0.5000000000 0.5000000000\n0.5000000000 0.5000000000\n"},{"problem_id":"p02296","input":"3\n0 0 1 0 0 1 1 1\n0 0 1 0 2 1 1 2\n-1 0 1 0 0 1 0 -1\n","output":"1.0000000000\n1.4142135624\n0.0000000000\n"},{"problem_id":"p02297","input":"3\n0 0\n2 2\n-1 1\n","output":"2.0\n"},{"problem_id":"p02298","input":"4\n0 0\n3 1\n2 3\n0 3\n","output":"1\n"},{"problem_id":"p02299","input":"4\n0 0\n3 1\n2 3\n0 3\n3\n2 1\n0 2\n3 2\n","output":"2\n1\n0\n"},{"problem_id":"p02300","input":"7\n2 1\n0 0\n1 2\n2 2\n4 2\n1 3\n3 3\n","output":"5\n0 0\n2 1\n4 2\n3 3\n1 3\n"},{"problem_id":"p02301","input":"3\n0.0 0.0\n4.0 0.0\n2.0 2.0\n","output":"4.00\n"},{"problem_id":"p02302","input":"4\n1 1\n4 1\n4 3\n1 3\n2\n2 0 2 4\n2 4 2 0\n","output":"2.00000000\n4.00000000\n"},{"problem_id":"p02303","input":"2\n0.0 0.0\n1.0 0.0\n","output":"1.000000\n"},{"problem_id":"p02304","input":"6\n2 2 2 5\n1 3 5 3\n4 1 4 4\n5 2 7 2\n6 1 6 3\n6 5 6 7\n","output":"3\n"},{"problem_id":"p02305","input":"1 1 1\n6 2 2\n","output":"4\n"},{"problem_id":"p02306","input":"1 -2\n3 2\n-2 0\n","output":"0.53907943898209422325 -0.26437392711448356856 1.18845545916395465278\n"},{"problem_id":"p02307","input":"1 -2\n3 2\n-2 0\n","output":"0.62500000000000000000 0.68750000000000000000 2.71353666826155124291\n"},{"problem_id":"p02308","input":"2 1 1\n2\n0 1 4 1\n3 0 3 3\n","output":"1.00000000 1.00000000 3.00000000 1.00000000\n3.00000000 1.00000000 3.00000000 1.00000000\n"},{"problem_id":"p02309","input":"0 0 2\n2 0 2\n","output":"1.00000000 -1.73205080 1.00000000 1.73205080\n"},{"problem_id":"p02310","input":"0 0\n2 2 2\n","output":"0.0000000000 2.0000000000\n2.0000000000 0.0000000000\n"},{"problem_id":"p02311","input":"1 1 1\n6 2 2\n","output":"0.6153846154 1.9230769231\n1.0000000000 0.0000000000\n1.4183420913 1.9082895434\n1.7355040625 0.3224796874\n"},{"problem_id":"p02312","input":"3 5\n1 1\n4 1\n5 5\n","output":"4.639858417607\n"},{"problem_id":"p02313","input":"0 0 1\n2 0 2\n","output":"1.40306643968573875104\n"},{"problem_id":"p02314","input":"55 4\n1 5 10 50\n","output":"2\n"},{"problem_id":"p02315","input":"4 5\n4 2\n5 2\n2 1\n8 3\n","output":"13\n"},{"problem_id":"p02316","input":"4 8\n4 2\n5 2\n2 1\n8 3\n","output":"21\n"},{"problem_id":"p02317","input":"5\n5\n1\n3\n2\n4\n","output":"3\n"},{"problem_id":"p02318","input":"acac\nacm\n","output":"2\n"},{"problem_id":"p02319","input":"4 5\n4 2\n5 2\n2 1\n8 3\n","output":"13\n"},{"problem_id":"p02320","input":"4 8\n4 3 2\n2 1 1\n1 2 4\n3 2 2\n","output":"12\n"},{"problem_id":"p02321","input":"4 5\n4 2\n5 2\n2 1\n8 3\n","output":"13\n"},{"problem_id":"p02322","input":"4 8\n4 3 2\n2 1 1\n1 2 4\n3 2 2\n","output":"12\n"},{"problem_id":"p02323","input":"4 6\n0 1 2\n1 2 3\n1 3 9\n2 0 1\n2 3 6\n3 2 4\n","output":"16\n"},{"problem_id":"p02324","input":"4 4\n0 1 1\n0 2 2\n1 3 3\n2 3 4\n","output":"10\n"},{"problem_id":"p02325","input":"3\n0 0\n1 1\n2 0\n","output":"4.82842712\n"},{"problem_id":"p02326","input":"4 5\n0 0 1 0 0\n1 0 0 0 0\n0 0 0 1 0\n0 0 0 1 0\n","output":"4\n"},{"problem_id":"p02327","input":"4 5\n0 0 1 0 0\n1 0 0 0 0\n0 0 0 1 0\n0 0 0 1 0\n","output":"6\n"},{"problem_id":"p02328","input":"8\n2 1 3 5 3 4 2 1\n","output":"12\n"},{"problem_id":"p02329","input":"3 14\n3 1 2\n4 8 2\n1 2 3\n7 3 2\n","output":"9\n"},{"problem_id":"p02330","input":"2 2 1 9\n5 1\n","output":"1\n"},{"problem_id":"p02331","input":"2 3\n","output":"9\n"},{"problem_id":"p02332","input":"2 3\n","output":"6\n"},{"problem_id":"p02333","input":"4 3\n","output":"36\n"},{"problem_id":"p02334","input":"5 3\n","output":"21\n"},{"problem_id":"p02335","input":"3 5\n","output":"10\n"},{"problem_id":"p02336","input":"5 3\n","output":"6\n"},{"problem_id":"p02337","input":"3 5\n","output":"5\n"},{"problem_id":"p02338","input":"5 10\n","output":"1\n"},{"problem_id":"p02339","input":"4 3\n","output":"6\n"},{"problem_id":"p02340","input":"5 3\n","output":"5\n"},{"problem_id":"p02341","input":"5 10\n","output":"1\n"},{"problem_id":"p02342","input":"10 5\n","output":"7\n"},{"problem_id":"p02343","input":"5 12\n0 1 4\n0 2 3\n1 1 2\n1 3 4\n1 1 4\n1 3 2\n0 1 3\n1 2 4\n1 3 0\n0 0 4\n1 0 2\n1 3 0\n","output":"0\n0\n1\n1\n1\n0\n1\n1\n"},{"problem_id":"p02344","input":"5 6\n0 0 2 5\n0 1 2 3\n1 0 1\n1 1 3\n0 1 4 8\n1 0 4\n","output":"2\n?\n10\n"},{"problem_id":"p02345","input":"3 5\n0 0 1\n0 1 2\n0 2 3\n1 0 2\n1 1 2\n","output":"1\n2\n"},{"problem_id":"p02346","input":"3 5\n0 1 1\n0 2 2\n0 3 3\n1 1 2\n1 2 2\n","output":"3\n2\n"},{"problem_id":"p02347","input":"6\n2 1\n2 2\n4 2\n6 2\n3 3\n5 4\n2\n2 4 0 4\n4 10 2 5\n","output":"0\n1\n2\n4\n\n2\n3\n5\n"},{"problem_id":"p02348","input":"3 5\n0 0 1 1\n0 1 2 3\n0 2 2 2\n1 0\n1 1\n","output":"1\n3\n"},{"problem_id":"p02349","input":"3 5\n0 1 2 1\n0 2 3 2\n0 3 3 3\n1 2\n1 3\n","output":"3\n5\n"},{"problem_id":"p02350","input":"3 5\n0 0 1 1\n0 1 2 3\n0 2 2 2\n1 0 2\n1 1 2\n","output":"1\n2\n"},{"problem_id":"p02351","input":"3 5\n0 1 2 1\n0 2 3 2\n0 3 3 3\n1 1 2\n1 2 3\n","output":"4\n8\n"},{"problem_id":"p02352","input":"6 7\n0 1 3 1\n0 2 4 -2\n1 0 5\n1 0 1\n0 3 5 3\n1 3 4\n1 0 5\n","output":"-2\n0\n1\n-1\n"},{"problem_id":"p02353","input":"6 7\n0 1 3 1\n0 2 4 -2\n1 0 5\n1 0 1\n0 3 5 3\n1 3 4\n1 0 5\n","output":"-5\n1\n6\n8\n"},{"problem_id":"p02354","input":"6 4\n1 2 1 2 3 2\n","output":"2\n"},{"problem_id":"p02355","input":"6 2\n4 1 2 1 3 5\n","output":"2\n"},{"problem_id":"p02356","input":"6 5\n1 2 3 4 5 6\n6 9 12 21 15\n","output":"9\n12\n15\n21\n18\n"},{"problem_id":"p02357","input":"7 3\n1 7 7 4 8 1 6\n","output":"1 4 4 1 1\n"},{"problem_id":"p02358","input":"2\n0 0 3 4\n1 2 4 3\n","output":"13\n"},{"problem_id":"p02359","input":"6 10\n0 2\n1 3\n2 6\n3 8\n4 10\n5 10\n","output":"4\n"},{"problem_id":"p02360","input":"2\n0 0 3 2\n2 1 4 3\n","output":"2\n"},{"problem_id":"p02361","input":"4 5 0\n0 1 1\n0 2 4\n1 2 2\n2 3 1\n1 3 5\n","output":"0\n1\n3\n4\n"},{"problem_id":"p02362","input":"4 5 0\n0 1 2\n0 2 3\n1 2 -5\n1 3 1\n2 3 2\n","output":"0\n2\n-3\n-1\n"},{"problem_id":"p02363","input":"4 6\n0 1 1\n0 2 5\n1 2 2\n1 3 4\n2 3 1\n3 2 7\n","output":"0 1 3 4\nINF 0 2 3\nINF INF 0 1\nINF INF 7 0\n"},{"problem_id":"p02364","input":"4 6\n0 1 2\n1 2 1\n2 3 1\n3 0 1\n0 2 3\n1 3 5\n","output":"3\n"},{"problem_id":"p02365","input":"4 6 0\n0 1 3\n0 2 2\n2 0 1\n2 3 1\n3 0 1\n3 1 5\n","output":"6\n"},{"problem_id":"p02366","input":"4 4\n0 1\n0 2\n1 2\n2 3\n","output":"2\n"},{"problem_id":"p02367","input":"4 4\n0 1\n0 2\n1 2\n2 3\n","output":"2 3\n"},{"problem_id":"p02368","input":"5 6\n0 1\n1 0\n1 2\n2 4\n4 3\n3 2\n4\n0 1\n0 3\n2 3\n3 4\n","output":"1\n0\n1\n1\n"},{"problem_id":"p02369","input":"3 3\n0 1\n0 2\n1 2\n","output":"0\n"},{"problem_id":"p02370","input":"6 6\n0 1\n1 2\n3 1\n3 4\n4 5\n5 2\n","output":"0\n3\n1\n4\n5\n2\n"},{"problem_id":"p02371","input":"4\n0 1 2\n1 2 1\n1 3 3\n","output":"5\n"},{"problem_id":"p02372","input":"4\n0 1 2\n1 2 1\n1 3 3\n","output":"5\n3\n4\n5\n"},{"problem_id":"p02373","input":"8\n3 1 2 3\n2 4 5\n0\n0\n0\n2 6 7\n0\n0\n4\n4 6\n4 7\n4 3\n5 2\n","output":"1\n1\n0\n0\n"},{"problem_id":"p02374","input":"6\n2 1 2\n2 3 5\n0\n0\n0\n1 4\n7\n1 1\n0 3 10\n1 2\n0 4 20\n1 3\n0 5 40\n1 4\n","output":"0\n0\n10\n60\n"},{"problem_id":"p02375","input":"6\n2 1 2\n2 3 5\n0\n0\n0\n1 4\n7\n1 1\n0 3 10\n1 2\n0 4 20\n1 3\n0 5 40\n1 4\n","output":"0\n0\n40\n150\n"},{"problem_id":"p02376","input":"4 5\n0 1 2\n0 2 1\n1 2 1\n1 3 1\n2 3 2\n","output":"3\n"},{"problem_id":"p02377","input":"4 5 2\n0 1 2 1\n0 2 1 2\n1 2 1 1\n1 3 1 3\n2 3 2 1\n","output":"6\n"},{"problem_id":"p02378","input":"3 4 6\n0 0\n0 2\n0 3\n1 1\n2 1\n2 3\n","output":"3\n"},{"problem_id":"p02379","input":"0 0 1 1\n","output":"1.41421356\n"},{"problem_id":"p02380","input":"4 3 90\n","output":"6.00000000\n12.00000000\n3.00000000\n"},{"problem_id":"p02381","input":"5\n70 80 100 90 20\n3\n80 80 80\n0\n","output":"27.85677655\n0.00000000\n"},{"problem_id":"p02382","input":"3\n1 2 3\n2 0 4\n","output":"4.000000\n2.449490\n2.154435\n2.000000\n"},{"problem_id":"p02383","input":"1 2 4 8 16 32\nSE\n","output":"8\n"},{"problem_id":"p02384","input":"1 2 3 4 5 6\n3\n6 5\n1 3\n3 2\n","output":"3\n5\n6\n"},{"problem_id":"p02385","input":"1 2 3 4 5 6\n6 2 4 3 5 1\n","output":"Yes\n"},{"problem_id":"p02386","input":"3\n1 2 3 4 5 6\n6 2 4 3 5 1\n6 5 4 3 2 1\n","output":"No\n"},{"problem_id":"p02387","input":"No input\n","output":"Hello World\n"},{"problem_id":"p02388","input":"2\n","output":"8\n"},{"problem_id":"p02389","input":"3 5\n","output":"15 16\n"},{"problem_id":"p02390","input":"46979\n","output":"13:2:59\n"},{"problem_id":"p02391","input":"1 2\n","output":"a\n"},{"problem_id":"p02392","input":"1 3 8\n","output":"Yes\n"},{"problem_id":"p02393","input":"3 8 1\n","output":"1 3 8\n"},{"problem_id":"p02394","input":"5 4 2 2 1\n","output":"Yes\n"},{"problem_id":"p02395","input":"No input\n","output":"Hello World\nHello World\nHello World\nHello World\nHello World\nHello World\nHello World\n.\n.\n.\n.\n.\n.\nHello World\n"},{"problem_id":"p02396","input":"3\n5\n11\n7\n8\n19\n0\n","output":"Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"},{"problem_id":"p02397","input":"3 2\n2 2\n5 3\n0 0\n","output":"2 3\n2 2\n3 5\n"},{"problem_id":"p02398","input":"5 14 80\n","output":"3\n"},{"problem_id":"p02399","input":"3 2\n","output":"1 1 1.50000\n"},{"problem_id":"p02400","input":"2\n","output":"12.566371 12.566371\n"},{"problem_id":"p02401","input":"1 + 2\n56 - 18\n13 * 2\n100 \/ 10\n27 + 81\n0 ? 0\n","output":"3\n38\n26\n10\n108\n"},{"problem_id":"p02402","input":"5\n10 1 5 4 17\n","output":"1 17 37\n"},{"problem_id":"p02403","input":"3 4\n5 6\n2 2\n0 0\n","output":"####\n####\n####\n\n######\n######\n######\n######\n######\n\n##\n##\n"},{"problem_id":"p02404","input":"3 4\n5 6\n3 3\n0 0\n","output":"####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n"},{"problem_id":"p02405","input":"3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n","output":"#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n"},{"problem_id":"p02406","input":"30\n","output":" 3 6 9 12 13 15 18 21 23 24 27 30\n"},{"problem_id":"p02407","input":"5\n1 2 3 4 5\n","output":"5 4 3 2 1\n"},{"problem_id":"p02408","input":"47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 5\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13\n","output":"S 1\nH 3\nH 7\nC 12\nD 8\n"},{"problem_id":"p02409","input":"3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n","output":" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"},{"problem_id":"p02410","input":"3 4\n1 2 0 1\n0 3 0 1\n4 1 1 0\n1\n2\n3\n0\n","output":"5\n6\n9\n"},{"problem_id":"p02411","input":"40 42 -1\n20 30 -1\n0 2 -1\n-1 -1 -1\n","output":"A\nC\nF\n"},{"problem_id":"p02412","input":"5 9\n0 0\n","output":"2\n"},{"problem_id":"p02413","input":"4 5\n1 1 3 4 5\n2 2 2 4 5\n3 3 0 1 1\n2 3 4 4 6\n","output":"1 1 3 4 5 14\n2 2 2 4 5 15\n3 3 0 1 1 8\n2 3 4 4 6 19\n8 9 9 13 17 56\n"},{"problem_id":"p02414","input":"3 2 3\n1 2\n0 3\n4 5\n1 2 1\n0 3 2\n","output":"1 8 5\n0 9 6\n4 23 14\n"},{"problem_id":"p02415","input":"fAIR, LATER, OCCASIONALLY CLOUDY.\n","output":"Fair, later, occasionally cloudy.\n"},{"problem_id":"p02416","input":"123\n55\n1000\n0\n","output":"6\n10\n1\n"},{"problem_id":"p02417","input":"This is a pen.\n","output":"a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n"},{"problem_id":"p02418","input":"vanceknowledgetoad\nadvance\n","output":"Yes\n"},{"problem_id":"p02419","input":"computer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the new era.\nProvides an outstanding computer environment.\nEND_OF_TEXT\n","output":"3\n"},{"problem_id":"p02420","input":"aabc\n3\n1\n2\n1\nvwxyz\n2\n3\n4\n-\n","output":"aabc\nxyzvw\n"},{"problem_id":"p02421","input":"3\ncat dog\nfish fish\nlion tiger\n","output":"1 7\n"},{"problem_id":"p02422","input":"abcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 1 4\n","output":"xaze\n"},{"problem_id":"p02423","input":"8\n","output":"00000000000000000000000000001000\n11111111111111111111111111110111\n00000000000000000000000000010000\n00000000000000000000000000000100\n"},{"problem_id":"p02424","input":"8 10\n","output":"00000000000000000000000000001000\n00000000000000000000000000001010\n00000000000000000000000000000010\n"},{"problem_id":"p02425","input":"14\n1 0\n1 1\n1 2\n2 1\n0 0\n0 1\n0 2\n0 3\n3 3\n4\n5\n6\n7\n8\n","output":"1\n0\n1\n0\n0\n1\n0\n3\n13\n"},{"problem_id":"p02426","input":"3\n3 0 1 3\n1 3\n3 0 1 2\n8\n1 0\n2 1\n3 1\n4 2\n5 2\n6 2\n7 2\n8 2\n","output":"0\n1\n0\n2\n3\n"},{"problem_id":"p02427","input":"4\n","output":"0:\n1: 0\n2: 1\n3: 0 1\n4: 2\n5: 0 2\n6: 1 2\n7: 0 1 2\n8: 3\n9: 0 3\n10: 1 3\n11: 0 1 3\n12: 2 3\n13: 0 2 3\n14: 1 2 3\n15: 0 1 2 3\n"},{"problem_id":"p02428","input":"4\n2 0 2\n","output":"5: 0 2\n7: 0 1 2\n13: 0 2 3\n15: 0 1 2 3\n"},{"problem_id":"p02429","input":"4\n2 0 2\n","output":"0:\n1: 0\n4: 2\n5: 0 2\n"},{"problem_id":"p02430","input":"5 3\n","output":"7: 0 1 2\n11: 0 1 3\n13: 0 2 3\n14: 1 2 3\n19: 0 1 4\n21: 0 2 4\n22: 1 2 4\n25: 0 3 4\n26: 1 3 4\n28: 2 3 4\n"},{"problem_id":"p02431","input":"8\n0 1\n0 2\n0 3\n2\n0 4\n1 0\n1 1\n1 2\n","output":"1\n2\n4\n"},{"problem_id":"p02432","input":"11\n0 0 1\n0 0 2\n0 1 3\n1 0\n1 1\n1 2\n2 0\n2 1\n0 0 4\n1 0\n1 1\n","output":"2\n1\n3\n4\n1\n"},{"problem_id":"p02433","input":"5\n0 1\n0 2\n0 3\n1 1\n2\n","output":"3\n1\n"},{"problem_id":"p02434","input":"3 13\n0 0 1\n0 0 2\n0 0 3\n0 1 -1\n0 2 4\n0 2 5\n1 0\n1 1\n1 2\n2 1\n1 0\n1 1\n1 2\n","output":"1 2 3\n-1\n4 5\n1 2 3\n\n4 5\n"},{"problem_id":"p02435","input":"3 9\n0 0 1\n0 0 2\n0 0 3\n0 2 4\n0 2 5\n1 0\n1 2\n2 0\n1 0\n","output":"3\n5\n2\n"},{"problem_id":"p02436","input":"3 9\n0 0 1\n0 0 2\n0 0 3\n0 2 4\n0 2 5\n1 0\n1 2\n2 0\n1 0\n","output":"1\n4\n2\n"},{"problem_id":"p02437","input":"2 10\n0 0 3\n0 0 9\n0 0 1\n1 0\n2 0\n1 0\n0 0 4\n1 0\n0 1 8\n1 1\n","output":"9\n3\n4\n8\n"},{"problem_id":"p02438","input":"3 10\n0 0 1\n0 0 2\n0 0 3\n0 1 4\n0 1 5\n2 1 0\n0 2 6\n1 0\n1 1\n1 2\n","output":"1 2 3 4 5\n\n6\n"},{"problem_id":"p02439","input":"4 5 3\n","output":"3 5\n"},{"problem_id":"p02440","input":"7\n8 3 7 1 9 1 4\n3\n0 0 3\n0 1 5\n1 0 7\n","output":"3\n1\n9\n"},{"problem_id":"p02441","input":"9\n1 4 1 4 2 1 3 5 6\n3\n0 9 1\n1 6 1\n3 7 5\n","output":"3\n2\n0\n"},{"problem_id":"p02442","input":"3\n1 2 3\n2\n2 4\n","output":"1\n"},{"problem_id":"p02443","input":"8\n1 2 3 4 5 6 7 8\n2\n1 6\n3 8\n","output":"1 6 5 8 7 2 3 4\n"},{"problem_id":"p02444","input":"11\n1 2 3 4 5 6 7 8 9 10 11\n1\n2 6 9\n","output":"1 2 7 8 9 3 4 5 6 10 11\n"},{"problem_id":"p02445","input":"11\n1 2 3 4 5 6 7 8 9 10 11\n1\n1 4 7\n","output":"1 8 9 10 5 6 7 2 3 4 11\n"},{"problem_id":"p02446","input":"4\n1 2 2 4\n","output":"1 2 4\n"},{"problem_id":"p02447","input":"5\n4 7\n5 5\n2 3\n6 8\n2 1\n","output":"2 1\n2 3\n4 7\n5 5\n6 8\n"},{"problem_id":"p02448","input":"5\n105 24 C 1500000000000 white\n100 23 C 1500000000000 blue\n105 23 A 1480000000000 pink\n110 25 B 1500000000000 black\n110 20 A 1300000000000 gree\n","output":"100 23 C 1500000000000 blue\n105 23 A 1480000000000 pink\n105 24 C 1500000000000 white\n110 20 A 1300000000000 gree\n110 25 B 1500000000000 black\n"},{"problem_id":"p02449","input":"3\n2 1 3\n","output":"1 3 2\n2 1 3\n2 3 1\n"},{"problem_id":"p02450","input":"2\n","output":"1 2\n2 1\n"},{"problem_id":"p02451","input":"4\n1 2 2 4\n3\n2\n3\n5\n","output":"1\n0\n0\n"},{"problem_id":"p02452","input":"4\n1 2 3 4\n2\n2 4\n","output":"1\n"},{"problem_id":"p02453","input":"4\n1 2 2 4\n3\n2\n3\n5\n","output":"1\n3\n4\n"},{"problem_id":"p02454","input":"4\n1 2 2 4\n3\n2\n3\n5\n","output":"1 3\n3 3\n4 4\n"},{"problem_id":"p02455","input":"7\n0 1\n0 2\n0 3\n0 2\n0 4\n1 3\n1 10\n","output":"1\n2\n3\n3\n4\n1\n0\n"},{"problem_id":"p02456","input":"8\n0 1\n0 2\n0 3\n2 2\n1 1\n1 2\n1 3\n0 2\n","output":"1\n2\n3\n1\n0\n1\n3\n"},{"problem_id":"p02457","input":"9\n0 1\n0 2\n0 3\n2 2\n1 1\n1 2\n1 3\n0 4\n3 2 4\n","output":"1\n2\n3\n1\n0\n1\n3\n3\n4\n"},{"problem_id":"p02458","input":"10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n1 2\n1 3\n0 4\n3 1 4\n","output":"1\n2\n3\n4\n2\n0\n1\n4\n1\n1\n3\n4\n"},{"problem_id":"p02459","input":"7\n0 blue 4\n0 red 1\n0 white 5\n1 red\n1 blue\n0 black 8\n1 black\n","output":"1\n4\n8\n"},{"problem_id":"p02460","input":"8\n0 blue 4\n0 red 1\n0 white 5\n1 red\n1 blue\n2 red\n1 black\n1 red\n","output":"1\n4\n0\n0\n"},{"problem_id":"p02461","input":"9\n0 blue 4\n0 red 1\n0 white 5\n1 red\n1 blue\n2 red\n1 black\n1 red\n3 w z\n","output":"1\n4\n0\n0\nwhite 5\n"},{"problem_id":"p02462","input":"10\n0 blue 6\n0 red 1\n0 blue 4\n0 white 5\n1 red\n1 blue\n2 red\n1 black\n1 red\n3 w z\n","output":"1\n6\n4\nwhite 5\n"},{"problem_id":"p02463","input":"3\n1 5 8\n2\n5 9\n","output":"1\n5\n8\n9\n"},{"problem_id":"p02464","input":"4\n1 2 5 8\n5\n2 3 5 9 11\n","output":"2\n5\n"},{"problem_id":"p02465","input":"5\n1 2 3 5 8\n2\n2 5\n","output":"1\n3\n8\n"},{"problem_id":"p02466","input":"7\n1 2 3 4 5 6 7\n4\n2 4 6 8\n","output":"1\n3\n5\n7\n8\n"},{"problem_id":"p02467","input":"12\n","output":"12: 2 2 3\n"},{"problem_id":"p02468","input":"2 3\n","output":"8\n"},{"problem_id":"p02469","input":"3\n3 4 6\n","output":"12\n"},{"problem_id":"p02470","input":"6\n","output":"2\n"},{"problem_id":"p02471","input":"4 12\n","output":"1 0\n"},{"problem_id":"p02472","input":"5 8\n","output":"13\n"},{"problem_id":"p02473","input":"5 8\n","output":"-3\n"},{"problem_id":"p02474","input":"5 8\n","output":"40\n"},{"problem_id":"p02475","input":"5 8\n","output":"0\n"},{"problem_id":"p02476","input":"5 8\n","output":"5\n"},{"problem_id":"p02477","input":"5 8\n","output":"40\n"},{"problem_id":"p02534","input":"3\n","output":"ACLACLACL\n"},{"problem_id":"p02535","input":"10 30 20 40\n","output":"Yes\n"},{"problem_id":"p02536","input":"3 1\n1 2\n","output":"1\n"},{"problem_id":"p02537","input":"10 3\n1\n5\n4\n3\n8\n6\n9\n7\n2\n4\n","output":"7\n"},{"problem_id":"p02538","input":"8 5\n3 6 2\n1 4 7\n3 8 3\n2 2 2\n4 5 1\n","output":"11222211\n77772211\n77333333\n72333333\n72311333\n"},{"problem_id":"p02539","input":"2\n1\n1\n2\n3\n","output":"2\n"},{"problem_id":"p02540","input":"4\n1 4\n2 3\n3 1\n4 2\n","output":"1\n1\n2\n2\n"},{"problem_id":"p02541","input":"11\n","output":"10\n"},{"problem_id":"p02542","input":"3 3\no..\n...\no.#\n","output":"4\n"},{"problem_id":"p02543","input":"5 3\n1 2 4 7 8\n2\n1 5\n1 2\n","output":"4\n2\n"},{"problem_id":"p02544","input":"3 2\n1 2 3\n","output":"1\n"},{"problem_id":"p02545","input":"3\n2 3 1 1 3 2 2 1 3\n1 2 2 3 1 2 3 1 3\n","output":"4\n"},{"problem_id":"p02546","input":"apple\n","output":"apples\n"},{"problem_id":"p02547","input":"5\n1 2\n6 6\n4 4\n3 3\n3 2\n","output":"Yes\n"},{"problem_id":"p02548","input":"3\n","output":"3\n"},{"problem_id":"p02549","input":"5 2\n1 1\n3 4\n","output":"4\n"},{"problem_id":"p02550","input":"6 2 1001\n","output":"1369\n"},{"problem_id":"p02551","input":"5 5\n1 3\n2 3\n1 4\n2 2\n1 2\n","output":"1\n"},{"problem_id":"p02552","input":"1\n","output":"0\n"},{"problem_id":"p02553","input":"1 2 1 1\n","output":"2\n"},{"problem_id":"p02554","input":"2\n","output":"2\n"},{"problem_id":"p02555","input":"7\n","output":"3\n"},{"problem_id":"p02556","input":"3\n1 1\n2 4\n3 2\n","output":"4\n"},{"problem_id":"p02557","input":"6\n1 1 1 2 2 3\n1 1 1 2 2 3\n","output":"Yes\n2 2 3 1 1 1\n"},{"problem_id":"p02558","input":"4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n","output":"0\n1\n0\n1\n"},{"problem_id":"p02559","input":"5 5\n1 2 3 4 5\n1 0 5\n1 2 4\n0 3 10\n1 0 5\n1 0 3\n","output":"15\n7\n25\n6\n"},{"problem_id":"p02560","input":"5\n4 10 6 3\n6 5 4 3\n1 1 0 0\n31415 92653 58979 32384\n1000000000 1000000000 999999999 999999999\n","output":"3\n13\n0\n314095480\n499999999500000000\n"},{"problem_id":"p02561","input":"3 3\n#..\n..#\n...\n","output":"3\n#><\nvv#\n^^.\n"},{"problem_id":"p02562","input":"3 1\n5 3 2\n1 4 8\n7 6 9\n","output":"19\nX..\n..X\n.X.\n"},{"problem_id":"p02563","input":"4 5\n1 2 3 4\n5 6 7 8 9\n","output":"5 16 34 60 70 70 59 36\n"},{"problem_id":"p02564","input":"6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n","output":"4\n1 5\n2 4 1\n1 2\n2 3 0\n"},{"problem_id":"p02565","input":"3 2\n1 4\n2 5\n0 6\n","output":"Yes\n4\n2\n0\n"},{"problem_id":"p02566","input":"abcbcba\n","output":"21\n"},{"problem_id":"p02567","input":"5 5\n1 2 3 2 1\n2 1 5\n3 2 3\n1 3 1\n2 2 4\n3 1 3\n","output":"3\n3\n2\n6\n"},{"problem_id":"p02568","input":"5 7\n1 2 3 4 5\n1 0 5\n0 2 4 100 101\n1 0 3\n0 1 3 102 103\n1 2 5\n0 2 5 104 105\n1 0 5\n","output":"15\n404\n41511\n4317767\n"},{"problem_id":"p02569","input":"5 5\n0 1 0 0 1\n2 1 5\n1 3 4\n2 2 5\n1 1 3\n2 1 2\n","output":"2\n0\n1\n"},{"problem_id":"p02570","input":"1000 15 80\n","output":"Yes\n"},{"problem_id":"p02571","input":"cabacc\nabc\n","output":"1\n"},{"problem_id":"p02572","input":"3\n1 2 3\n","output":"11\n"},{"problem_id":"p02573","input":"5 3\n1 2\n3 4\n5 1\n","output":"3\n"},{"problem_id":"p02574","input":"3\n3 4 5\n","output":"pairwise coprime\n"},{"problem_id":"p02575","input":"4 4\n2 4\n1 1\n2 3\n2 4\n","output":"1\n3\n6\n-1\n"},{"problem_id":"p02576","input":"20 12 6\n","output":"12\n"},{"problem_id":"p02577","input":"123456789\n","output":"Yes\n"},{"problem_id":"p02578","input":"5\n2 1 5 4 3\n","output":"4\n"},{"problem_id":"p02579","input":"4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n","output":"1\n"},{"problem_id":"p02580","input":"2 3 3\n2 2\n1 1\n1 3\n","output":"3\n"},{"problem_id":"p02581","input":"2\n1 2 1 2 2 1\n","output":"2\n"},{"problem_id":"p02582","input":"RRS\n","output":"2\n"},{"problem_id":"p02583","input":"5\n4 4 9 7 5\n","output":"5\n"},{"problem_id":"p02584","input":"6 2 4\n","output":"2\n"},{"problem_id":"p02585","input":"5 2\n2 4 5 1 3\n3 4 -10 -8 8\n","output":"8\n"},{"problem_id":"p02586","input":"2 2 3\n1 1 3\n2 1 4\n1 2 5\n","output":"8\n"},{"problem_id":"p02587","input":"3\nba 3\nabc 4\ncbaa 5\n","output":"7\n"},{"problem_id":"p02588","input":"5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n","output":"3\n"},{"problem_id":"p02589","input":"3\nabcxyx\ncyx\nabc\n","output":"1\n"},{"problem_id":"p02590","input":"4\n2019 0 2020 200002\n","output":"474287\n"},{"problem_id":"p02591","input":"3\n2 3 1 4\n","output":"121788\n"},{"problem_id":"p02593","input":"6\n1 8\n6 10\n2 7\n4 4\n9 3\n5 1\n","output":"5\n0\n7\n5\n0\n0\n"},{"problem_id":"p02594","input":"25\n","output":"No\n"},{"problem_id":"p02595","input":"4 5\n0 5\n-2 4\n3 4\n4 -4\n","output":"3\n"},{"problem_id":"p02596","input":"101\n","output":"4\n"},{"problem_id":"p02597","input":"4\nWWRR\n","output":"2\n"},{"problem_id":"p02598","input":"2 3\n7 9\n","output":"4\n"},{"problem_id":"p02599","input":"4 3\n1 2 1 3\n1 3\n2 4\n3 3\n","output":"2\n3\n1\n"},{"problem_id":"p02600","input":"725\n","output":"7\n"},{"problem_id":"p02601","input":"7 2 5\n3\n","output":"Yes\n"},{"problem_id":"p02602","input":"5 3\n96 98 95 100 20\n","output":"Yes\nNo\n"},{"problem_id":"p02603","input":"7\n100 130 130 130 115 115 150\n","output":"1685\n"},{"problem_id":"p02604","input":"3\n1 2 300\n3 3 600\n1 4 800\n","output":"2900\n900\n0\n0\n"},{"problem_id":"p02605","input":"2\n11 1 U\n11 47 D\n","output":"230\n"},{"problem_id":"p02606","input":"5 10 2\n","output":"3\n"},{"problem_id":"p02607","input":"5\n1 3 4 5 7\n","output":"2\n"},{"problem_id":"p02608","input":"20\n","output":"0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"},{"problem_id":"p02609","input":"3\n011\n","output":"2\n1\n1\n"},{"problem_id":"p02610","input":"3\n2\n1 5 10\n2 15 5\n3\n2 93 78\n1 71 59\n3 57 96\n19\n19 23 16\n5 90 13\n12 85 70\n19 67 78\n12 16 60\n18 48 28\n5 4 24\n12 97 97\n4 57 87\n19 91 74\n18 100 76\n7 86 46\n9 100 57\n3 76 73\n6 84 93\n1 6 84\n11 75 94\n19 15 3\n12 11 34\n","output":"25\n221\n1354\n"},{"problem_id":"p02611","input":"4\n4\n6\n10\n1000000000\n","output":"0\n11\n4598\n257255556\n"},{"problem_id":"p02612","input":"1900\n","output":"100\n"},{"problem_id":"p02613","input":"6\nAC\nTLE\nAC\nAC\nWA\nTLE\n","output":"AC x 3\nWA x 1\nTLE x 2\nRE x 0\n"},{"problem_id":"p02614","input":"2 3 2\n..#\n###\n","output":"5\n"},{"problem_id":"p02615","input":"4\n2 2 1 3\n","output":"7\n"},{"problem_id":"p02616","input":"4 2\n1 2 -3 -4\n","output":"12\n"},{"problem_id":"p02617","input":"3\n1 3\n2 3\n","output":"7\n"},{"problem_id":"p02618","input":"5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n","output":"1\n17\n13\n14\n13\n"},{"problem_id":"p02619","input":"5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n","output":"18398\n35037\n51140\n65837\n79325\n"},{"problem_id":"p02620","input":"5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570\n6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256\n8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452\n19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192\n1\n17\n13\n14\n13\n5\n1 7\n4 11\n3 4\n5 24\n4 19\n","output":"72882\n56634\n38425\n27930\n42884\n"},{"problem_id":"p02621","input":"2\n","output":"14\n"},{"problem_id":"p02622","input":"cupofcoffee\ncupofhottea\n","output":"4\n"},{"problem_id":"p02623","input":"3 4 240\n60 90 120\n80 150 80 150\n","output":"3\n"},{"problem_id":"p02624","input":"4\n","output":"23\n"},{"problem_id":"p02625","input":"2 2\n","output":"2\n"},{"problem_id":"p02626","input":"2\n5 3\n","output":"1\n"},{"problem_id":"p02627","input":"B\n","output":"A\n"},{"problem_id":"p02628","input":"5 3\n50 100 80 120 80\n","output":"210\n"},{"problem_id":"p02629","input":"2\n","output":"b\n"},{"problem_id":"p02630","input":"4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n","output":"11\n12\n16\n"},{"problem_id":"p02631","input":"4\n20 11 9 24\n","output":"26 5 7 22\n"},{"problem_id":"p02632","input":"5\noof\n","output":"575111451\n"},{"problem_id":"p02633","input":"90\n","output":"4\n"},{"problem_id":"p02634","input":"1 1 2 2\n","output":"3\n"},{"problem_id":"p02635","input":"0101 1\n","output":"4\n"},{"problem_id":"p02636","input":"0001\n","output":"8\n"},{"problem_id":"p02637","input":"3\n2 4 3\n","output":"2 1 3 2 2 3 1 2 3\n"},{"problem_id":"p02638","input":"4 3 998244353\n","output":"56\n"},{"problem_id":"p02639","input":"0 2 3 4 5\n","output":"1\n"},{"problem_id":"p02640","input":"3 8\n","output":"Yes\n"},{"problem_id":"p02641","input":"6 5\n4 7 10 6 5\n","output":"8\n"},{"problem_id":"p02642","input":"5\n24 11 8 3 16\n","output":"3\n"},{"problem_id":"p02643","input":"6 3\n8 1\n6 2\n9 3\n1 1\n2 2\n1 3\n4 3\n2 1\n1 2\n","output":"6\n2\n6\n"},{"problem_id":"p02644","input":"3 5 2\n3 2 3 4\n.....\n.@..@\n..@..\n","output":"5\n"},{"problem_id":"p02645","input":"takahashi\n","output":"tak\n"},{"problem_id":"p02646","input":"1 2\n3 1\n3\n","output":"YES\n"},{"problem_id":"p02647","input":"5 1\n1 0 0 1 0\n","output":"1 2 2 1 2\n"},{"problem_id":"p02648","input":"3\n1 2\n2 3\n3 4\n3\n1 1\n2 5\n3 5\n","output":"0\n3\n3\n"},{"problem_id":"p02649","input":"3 3 0 3\n1 2 3\n","output":"2\n"},{"problem_id":"p02650","input":"2 3 1\n","output":"12\n"},{"problem_id":"p02651","input":"3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000\n","output":"1\n0\n0\n"},{"problem_id":"p02652","input":"0??\n","output":"1\n"},{"problem_id":"p02653","input":"4 2 3\n","output":"11\n"},{"problem_id":"p02654","input":"3 1\n","output":"2\n"},{"problem_id":"p02655","input":"3 3\n1 2 1\n2 1 1\n1 3 2\n","output":"3\n"},{"problem_id":"p02656","input":"3\n3 3 4 4 5\n2 1 1 5 3\n3 1 4 2 5\n","output":"2\n2\n0\n"},{"problem_id":"p02657","input":"2 5\n","output":"10\n"},{"problem_id":"p02658","input":"2\n1000000000 1000000000\n","output":"1000000000000000000\n"},{"problem_id":"p02659","input":"198 1.10\n","output":"217\n"},{"problem_id":"p02660","input":"24\n","output":"3\n"},{"problem_id":"p02661","input":"2\n1 2\n2 3\n","output":"3\n"},{"problem_id":"p02662","input":"3 4\n2 2 4\n","output":"6\n"},{"problem_id":"p02663","input":"10 0 15 0 30\n","output":"270\n"},{"problem_id":"p02664","input":"PD?D??P\n","output":"PDPDPDP\n"},{"problem_id":"p02665","input":"3\n0 1 1 2\n","output":"7\n"},{"problem_id":"p02666","input":"4\n2 1 -1 3\n","output":"8\n"},{"problem_id":"p02667","input":"1101\n","output":"5\n"},{"problem_id":"p02668","input":"2 5\n","output":"352\n"},{"problem_id":"p02669","input":"5\n11 1 2 4 8\n11 1 2 2 8\n32 10 8 5 4\n29384293847243 454353412 332423423 934923490 1\n900000000000000000 332423423 454353412 934923490 987654321\n","output":"20\n19\n26\n3821859835\n23441258666\n"},{"problem_id":"p02670","input":"3\n1 3 7 9 5 4 8 6 2\n","output":"1\n"},{"problem_id":"p02671","input":"1\nSRS\n","output":"2 0 1\n"},{"problem_id":"p02673","input":"5\n4 2 6 3 5\n1 1 1 1 1\n","output":"4.700000000000\n"},{"problem_id":"p02674","input":"2\n","output":"1\n"},{"problem_id":"p02675","input":"16\n","output":"pon\n"},{"problem_id":"p02676","input":"7\nnikoandsolstice\n","output":"nikoand...\n"},{"problem_id":"p02677","input":"3 4 9 0\n","output":"5.00000000000000000000\n"},{"problem_id":"p02678","input":"4 4\n1 2\n2 3\n3 4\n4 2\n","output":"Yes\n1\n2\n2\n"},{"problem_id":"p02679","input":"3\n1 2\n-1 1\n2 -1\n","output":"5\n"},{"problem_id":"p02680","input":"5 6\n1 2 0\n0 1 1\n0 2 2\n-3 4 -1\n-2 6 3\n1 0 1\n0 1 2\n2 0 2\n-1 -4 5\n3 -2 4\n1 2 4\n","output":"13\n"},{"problem_id":"p02681","input":"chokudai\nchokudaiz\n","output":"Yes\n"},{"problem_id":"p02682","input":"2 1 1 3\n","output":"2\n"},{"problem_id":"p02683","input":"3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n","output":"120\n"},{"problem_id":"p02684","input":"4 5\n3 2 4 1\n","output":"4\n"},{"problem_id":"p02685","input":"3 2 1\n","output":"6\n"},{"problem_id":"p02686","input":"2\n)\n(()\n","output":"Yes\n"},{"problem_id":"p02687","input":"ABC\n","output":"ARC\n"},{"problem_id":"p02688","input":"3 2\n2\n1 3\n1\n3\n","output":"1\n"},{"problem_id":"p02689","input":"4 3\n1 2 3 4\n1 3\n2 3\n2 4\n","output":"2\n"},{"problem_id":"p02690","input":"33\n","output":"2 -1\n"},{"problem_id":"p02691","input":"6\n2 3 3 1 3 1\n","output":"3\n"},{"problem_id":"p02692","input":"2 1 3 0\nAB\nAC\n","output":"Yes\nA\nC\n"},{"problem_id":"p02693","input":"7\n500 600\n","output":"OK\n"},{"problem_id":"p02694","input":"103\n","output":"3\n"},{"problem_id":"p02695","input":"3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n","output":"110\n"},{"problem_id":"p02696","input":"5 7 4\n","output":"2\n"},{"problem_id":"p02697","input":"4 1\n","output":"2 3\n"},{"problem_id":"p02698","input":"10\n1 2 5 3 4 6 7 3 2 4\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n1 8\n8 9\n9 10\n","output":"1\n2\n3\n3\n4\n4\n5\n2\n2\n3\n"},{"problem_id":"p02699","input":"4 5\n","output":"unsafe\n"},{"problem_id":"p02700","input":"10 9 10 10\n","output":"No\n"},{"problem_id":"p02701","input":"3\napple\norange\napple\n","output":"2\n"},{"problem_id":"p02702","input":"1817181712114\n","output":"3\n"},{"problem_id":"p02703","input":"3 2 1\n1 2 1 2\n1 3 2 4\n1 11\n1 2\n2 5\n","output":"2\n14\n"},{"problem_id":"p02704","input":"2\n0 1\n1 0\n1 1\n1 0\n","output":"1 1\n1 0\n"},{"problem_id":"p02705","input":"1\n","output":"6.28318530717958623200\n"},{"problem_id":"p02706","input":"41 2\n5 6\n","output":"30\n"},{"problem_id":"p02707","input":"5\n1 1 2 2\n","output":"2\n2\n0\n0\n0\n"},{"problem_id":"p02708","input":"3 2\n","output":"10\n"},{"problem_id":"p02709","input":"4\n1 3 4 2\n","output":"20\n"},{"problem_id":"p02710","input":"3\n1 2 1\n1 2\n2 3\n","output":"5\n4\n0\n"},{"problem_id":"p02711","input":"117\n","output":"Yes\n"},{"problem_id":"p02712","input":"15\n","output":"60\n"},{"problem_id":"p02713","input":"2\n","output":"9\n"},{"problem_id":"p02714","input":"4\nRRGB\n","output":"1\n"},{"problem_id":"p02715","input":"3 2\n","output":"9\n"},{"problem_id":"p02716","input":"6\n1 2 3 4 5 6\n","output":"12\n"},{"problem_id":"p02717","input":"1 2 3\n","output":"3 1 2\n"},{"problem_id":"p02718","input":"4 1\n5 4 2 1\n","output":"Yes\n"},{"problem_id":"p02719","input":"7 4\n","output":"1\n"},{"problem_id":"p02720","input":"15\n","output":"23\n"},{"problem_id":"p02721","input":"11 3 2\nooxxxoxxxoo\n","output":"6\n"},{"problem_id":"p02722","input":"6\n","output":"3\n"},{"problem_id":"p02723","input":"sippuu\n","output":"Yes\n"},{"problem_id":"p02724","input":"1024\n","output":"2020\n"},{"problem_id":"p02725","input":"20 3\n5 10 15\n","output":"10\n"},{"problem_id":"p02726","input":"5 2 4\n","output":"5\n4\n1\n0\n"},{"problem_id":"p02727","input":"1 2 2 2 1\n2 4\n5 1\n3\n","output":"12\n"},{"problem_id":"p02728","input":"3\n1 2\n1 3\n","output":"2\n1\n1\n"},{"problem_id":"p02729","input":"2 1\n","output":"1\n"},{"problem_id":"p02730","input":"akasaka\n","output":"Yes\n"},{"problem_id":"p02731","input":"3\n","output":"1.000000000000\n"},{"problem_id":"p02732","input":"5\n1 1 2 1 2\n","output":"2\n2\n3\n2\n3\n"},{"problem_id":"p02733","input":"3 5 4\n11100\n10001\n00111\n","output":"2\n"},{"problem_id":"p02734","input":"3 4\n2 2 4\n","output":"5\n"},{"problem_id":"p02735","input":"3 3\n.##\n.#.\n##.\n","output":"1\n"},{"problem_id":"p02736","input":"4\n1231\n","output":"1\n"},{"problem_id":"p02737","input":"2\n1\n1 2\n1\n1 2\n1\n1 2\n","output":"46494701\n"},{"problem_id":"p02738","input":"1 998244353\n","output":"6\n"},{"problem_id":"p02739","input":"1\n10\n","output":"Possible\n4\n0 0\n0 1\n1 1\n1 0\n0 0\n"},{"problem_id":"p02740","input":"3\n2\n1 10 1\n3 1 1\n3\n1 10 1\n2 1 1\n3 10 1\n2\n1 1 1\n3 10 1\n2\n1 2 0\n2 3 0\n3\n1\n2\n3\n","output":"3\n42\n-1\n"},{"problem_id":"p02741","input":"6\n","output":"2\n"},{"problem_id":"p02742","input":"4 5\n","output":"10\n"},{"problem_id":"p02743","input":"2 3 9\n","output":"No\n"},{"problem_id":"p02744","input":"1\n","output":"a\n"},{"problem_id":"p02745","input":"a?c\nder\ncod\n","output":"7\n"},{"problem_id":"p02746","input":"2\n4 2 7 4\n9 9 1 9\n","output":"5\n8\n"},{"problem_id":"p02747","input":"hihi\n","output":"Yes\n"},{"problem_id":"p02748","input":"2 3 1\n3 3\n3 3 3\n1 2 1\n","output":"5\n"},{"problem_id":"p02749","input":"5\n1 2\n1 3\n3 4\n3 5\n","output":"1 2 5 4 3\n"},{"problem_id":"p02750","input":"3 7\n2 0\n3 2\n0 3\n","output":"2\n"},{"problem_id":"p02751","input":"1 2\n","output":"111\n"},{"problem_id":"p02752","input":"6\n1 6\n2 1\n5 2\n3 4\n2 3\n","output":"3\n"},{"problem_id":"p02753","input":"ABA\n","output":"Yes\n"},{"problem_id":"p02754","input":"8 3 4\n","output":"4\n"},{"problem_id":"p02755","input":"2 2\n","output":"25\n"},{"problem_id":"p02756","input":"a\n4\n2 1 p\n1\n2 2 c\n1\n","output":"cpa\n"},{"problem_id":"p02757","input":"4 3\n3543\n","output":"6\n"},{"problem_id":"p02758","input":"2\n1 5\n3 3\n","output":"3\n"},{"problem_id":"p02759","input":"5\n","output":"3\n"},{"problem_id":"p02760","input":"84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n","output":"Yes\n"},{"problem_id":"p02761","input":"3 3\n1 7\n3 2\n1 7\n","output":"702\n"},{"problem_id":"p02762","input":"4 4 1\n2 1\n1 3\n3 2\n3 4\n4 1\n","output":"0 1 0 1\n"},{"problem_id":"p02763","input":"7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n","output":"3\n1\n5\n"},{"problem_id":"p02764","input":"4 3\n-1 0 3\n0 0 3\n1 0 2\n1 1 40\n","output":"2.4\n"},{"problem_id":"p02765","input":"2 2919\n","output":"3719\n"},{"problem_id":"p02766","input":"11 2\n","output":"4\n"},{"problem_id":"p02767","input":"2\n1 4\n","output":"5\n"},{"problem_id":"p02768","input":"4 1 3\n","output":"7\n"},{"problem_id":"p02769","input":"3 2\n","output":"10\n"},{"problem_id":"p02770","input":"3 1\n3 1 4\n5 3 2\n","output":"1\n"},{"problem_id":"p02771","input":"5 7 5\n","output":"Yes\n"},{"problem_id":"p02772","input":"5\n6 7 9 10 31\n","output":"APPROVED\n"},{"problem_id":"p02773","input":"7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n","output":"beet\nvet\n"},{"problem_id":"p02774","input":"4 3\n3 3 -4 -2\n","output":"-6\n"},{"problem_id":"p02775","input":"36\n","output":"8\n"},{"problem_id":"p02776","input":"3 4\n5 1\n10 1\n8 0\n1 10\n4 5\n6 7\n8 9\n","output":"2\n1 4\n"},{"problem_id":"p02777","input":"red blue\n3 4\nred\n","output":"2 4\n"},{"problem_id":"p02778","input":"sardine\n","output":"xxxxxxx\n"},{"problem_id":"p02779","input":"5\n2 6 1 4 5\n","output":"YES\n"},{"problem_id":"p02780","input":"5 3\n1 2 2 4 5\n","output":"7.000000000000\n"},{"problem_id":"p02781","input":"100\n1\n","output":"19\n"},{"problem_id":"p02782","input":"1 1 2 2\n","output":"14\n"},{"problem_id":"p02783","input":"10 4\n","output":"3\n"},{"problem_id":"p02784","input":"10 3\n4 5 6\n","output":"Yes\n"},{"problem_id":"p02785","input":"3 1\n4 1 5\n","output":"5\n"},{"problem_id":"p02786","input":"2\n","output":"3\n"},{"problem_id":"p02787","input":"9 3\n8 3\n4 2\n2 1\n","output":"4\n"},{"problem_id":"p02788","input":"3 3 2\n1 2\n5 4\n9 2\n","output":"2\n"},{"problem_id":"p02789","input":"3 3\n","output":"Yes\n"},{"problem_id":"p02790","input":"4 3\n","output":"3333\n"},{"problem_id":"p02791","input":"5\n4 2 5 1 3\n","output":"3\n"},{"problem_id":"p02792","input":"25\n","output":"17\n"},{"problem_id":"p02793","input":"3\n2 3 4\n","output":"13\n"},{"problem_id":"p02794","input":"3\n1 2\n2 3\n1\n1 3\n","output":"3\n"},{"problem_id":"p02795","input":"3\n7\n10\n","output":"2\n"},{"problem_id":"p02796","input":"4\n2 4\n4 3\n9 3\n100 5\n","output":"3\n"},{"problem_id":"p02797","input":"4 2 3\n","output":"1 2 3 4\n"},{"problem_id":"p02798","input":"3\n3 4 3\n3 2 3\n","output":"1\n"},{"problem_id":"p02799","input":"5 5\n3 4 3 5 7\n1 2\n1 3\n3 2\n4 2\n4 5\n","output":"BWWBB\n4\n3\n1\n5\n2\n"},{"problem_id":"p02800","input":"2 2\n#.\n.#\n","output":"15\n"},{"problem_id":"p02801","input":"a\n","output":"b\n"},{"problem_id":"p02802","input":"2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n","output":"2 2\n"},{"problem_id":"p02803","input":"3 3\n...\n...\n...\n","output":"4\n"},{"problem_id":"p02804","input":"4 2\n1 1 3 4\n","output":"11\n"},{"problem_id":"p02805","input":"2\n0 0\n1 0\n","output":"0.500000000000000000\n"},{"problem_id":"p02806","input":"3\ndwango 2\nsixth 5\nprelims 25\ndwango\n","output":"30\n"},{"problem_id":"p02807","input":"3\n1 2 3\n","output":"5\n"},{"problem_id":"p02808","input":"3 2\n3 2\n","output":"12\n"},{"problem_id":"p02809","input":"4\n2 3 4 1\n","output":"1 3 2 4\n"},{"problem_id":"p02810","input":"3 3\n1 1 2\n","output":"10\n"},{"problem_id":"p02811","input":"2 900\n","output":"Yes\n"},{"problem_id":"p02812","input":"10\nZABCDBABCQ\n","output":"2\n"},{"problem_id":"p02813","input":"3\n1 3 2\n3 1 2\n","output":"3\n"},{"problem_id":"p02814","input":"2 50\n6 10\n","output":"2\n"},{"problem_id":"p02815","input":"1\n1000000000\n","output":"999999993\n"},{"problem_id":"p02816","input":"3\n0 2 1\n1 2 3\n","output":"1 3\n"},{"problem_id":"p02817","input":"oder atc\n","output":"atcoder\n"},{"problem_id":"p02818","input":"2 3 3\n","output":"0 2\n"},{"problem_id":"p02819","input":"20\n","output":"23\n"},{"problem_id":"p02820","input":"5 2\n8 7 6\nrsrpr\n","output":"27\n"},{"problem_id":"p02821","input":"5 3\n10 14 19 34 33\n","output":"202\n"},{"problem_id":"p02822","input":"3\n1 2\n2 3\n","output":"125000001\n"},{"problem_id":"p02823","input":"5 2 4\n","output":"1\n"},{"problem_id":"p02824","input":"6 1 2 2\n2 1 1 3 0 2\n","output":"5\n"},{"problem_id":"p02825","input":"6\n","output":"aabb..\nb..zz.\nba....\n.a..aa\n..a..b\n..a..b\n"},{"problem_id":"p02826","input":"2 998244353\n","output":"3\n"},{"problem_id":"p02827","input":"4 5 1\n1 3\n2 4\n1 2\n3 4\n2 3\n","output":"^^^^^\n"},{"problem_id":"p02828","input":"2\n2 2\n","output":"11\n"},{"problem_id":"p02829","input":"3\n1\n","output":"2\n"},{"problem_id":"p02830","input":"2\nip cc\n","output":"icpc\n"},{"problem_id":"p02831","input":"2 3\n","output":"6\n"},{"problem_id":"p02832","input":"3\n2 1 2\n","output":"1\n"},{"problem_id":"p02833","input":"12\n","output":"1\n"},{"problem_id":"p02834","input":"5 4 1\n1 2\n2 3\n3 4\n3 5\n","output":"2\n"},{"problem_id":"p02835","input":"5 7 9\n","output":"win\n"},{"problem_id":"p02836","input":"redcoder\n","output":"1\n"},{"problem_id":"p02837","input":"3\n1\n2 1\n1\n1 1\n1\n2 0\n","output":"2\n"},{"problem_id":"p02838","input":"3\n1 2 3\n","output":"6\n"},{"problem_id":"p02839","input":"2 2\n1 2\n3 4\n3 4\n2 1\n","output":"0\n"},{"problem_id":"p02840","input":"3 4 2\n","output":"8\n"},{"problem_id":"p02841","input":"11 16\n11 17\n","output":"0\n"},{"problem_id":"p02842","input":"432\n","output":"400\n"},{"problem_id":"p02843","input":"615\n","output":"1\n"},{"problem_id":"p02844","input":"4\n0224\n","output":"3\n"},{"problem_id":"p02845","input":"6\n0 1 2 3 4 5\n","output":"3\n"},{"problem_id":"p02846","input":"1 2\n10 10\n12 4\n","output":"1\n"},{"problem_id":"p02847","input":"SAT\n","output":"1\n"},{"problem_id":"p02848","input":"2\nABCXYZ\n","output":"CDEZAB\n"},{"problem_id":"p02849","input":"10 7 100\n","output":"9\n"},{"problem_id":"p02850","input":"3\n1 2\n2 3\n","output":"2\n1\n2\n"},{"problem_id":"p02851","input":"5 4\n1 4 2 3 5\n","output":"4\n"},{"problem_id":"p02852","input":"9 3\n0001000100\n","output":"1 3 2 3\n"},{"problem_id":"p02853","input":"1 1\n","output":"1000000\n"},{"problem_id":"p02854","input":"3\n2 4 3\n","output":"3\n"},{"problem_id":"p02855","input":"3 3 5\n#.#\n.#.\n#.#\n","output":"1 2 2\n1 3 4\n5 5 4\n"},{"problem_id":"p02856","input":"2\n2 2\n9 1\n","output":"3\n"},{"problem_id":"p02858","input":"2 2 1\n","output":"9\n"},{"problem_id":"p02859","input":"2\n","output":"4\n"},{"problem_id":"p02860","input":"6\nabcabc\n","output":"Yes\n"},{"problem_id":"p02861","input":"3\n0 0\n1 0\n0 1\n","output":"2.2761423749\n"},{"problem_id":"p02862","input":"3 3\n","output":"2\n"},{"problem_id":"p02863","input":"2 60\n10 10\n100 100\n","output":"110\n"},{"problem_id":"p02864","input":"4 1\n2 3 4 1\n","output":"3\n"},{"problem_id":"p02865","input":"4\n","output":"1\n"},{"problem_id":"p02866","input":"4\n0 1 1 2\n","output":"2\n"},{"problem_id":"p02867","input":"3\n1 3 2\n1 2 3\n","output":"Yes\n"},{"problem_id":"p02868","input":"4 3\n1 3 2\n2 4 3\n1 4 6\n","output":"5\n"},{"problem_id":"p02869","input":"1 1\n","output":"1 2 3\n"},{"problem_id":"p02870","input":"4\no?o\n???\n?x?\n","output":"1\n"},{"problem_id":"p02873","input":"<>>\n","output":"3\n"},{"problem_id":"p02874","input":"4\n4 7\n1 4\n5 8\n2 5\n","output":"6\n"},{"problem_id":"p02875","input":"2\n","output":"7\n"},{"problem_id":"p02876","input":"2\n3 2\n1 2\n","output":"1 4\n"},{"problem_id":"p02877","input":"5\n1 2 1 2 1\n","output":"3\n"},{"problem_id":"p02878","input":"5 1 3\n","output":"4\n"},{"problem_id":"p02879","input":"2 5\n","output":"10\n"},{"problem_id":"p02880","input":"10\n","output":"Yes\n"},{"problem_id":"p02881","input":"10\n","output":"5\n"},{"problem_id":"p02882","input":"2 2 4\n","output":"45.0000000000\n"},{"problem_id":"p02883","input":"3 5\n4 2 1\n2 3 1\n","output":"2\n"},{"problem_id":"p02884","input":"4 6\n1 4\n2 3\n1 3\n1 2\n3 4\n2 4\n","output":"1.5000000000\n"},{"problem_id":"p02885","input":"12 4\n","output":"4\n"},{"problem_id":"p02886","input":"3\n3 1 2\n","output":"11\n"},{"problem_id":"p02887","input":"10\naabbbbaaca\n","output":"5\n"},{"problem_id":"p02888","input":"4\n3 4 2 1\n","output":"1\n"},{"problem_id":"p02889","input":"3 2 5\n1 2 3\n2 3 3\n2\n3 2\n1 3\n","output":"0\n1\n"},{"problem_id":"p02890","input":"3\n2 1 2\n","output":"3\n1\n0\n"},{"problem_id":"p02891","input":"issii\n2\n","output":"4\n"},{"problem_id":"p02892","input":"2\n01\n10\n","output":"2\n"},{"problem_id":"p02893","input":"3\n111\n","output":"40\n"},{"problem_id":"p02894","input":"3 4\n0\n1\n3\n","output":"0.414213562373095 -0.000000000000000\n"},{"problem_id":"p02895","input":"3\n011111\n101111\n110111\n111011\n111101\n111110\n","output":"3\n"},{"problem_id":"p02896","input":"2 2 2 998244353\n","output":"35\n"},{"problem_id":"p02897","input":"4\n","output":"0.5000000000\n"},{"problem_id":"p02898","input":"4 150\n150 140 100 200\n","output":"2\n"},{"problem_id":"p02899","input":"3\n2 3 1\n","output":"3 1 2\n"},{"problem_id":"p02900","input":"12 18\n","output":"3\n"},{"problem_id":"p02901","input":"2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n","output":"25\n"},{"problem_id":"p02902","input":"4 5\n1 2\n2 3\n2 4\n4 1\n4 3\n","output":"3\n1\n2\n4\n"},{"problem_id":"p02903","input":"3 3 1 1\n","output":"100\n010\n001\n"},{"problem_id":"p02904","input":"5 3\n0 2 1 4 3\n","output":"2\n"},{"problem_id":"p02905","input":"3\n2 4 6\n","output":"22\n"},{"problem_id":"p02906","input":"5 5 3\n0 1 0\n1 2 1\n2 3 0\n","output":"Yes\n"},{"problem_id":"p02907","input":"2\n1 1\n1 1\n","output":"3\n"},{"problem_id":"p02908","input":"4\n2 1 3 0\n0 2 3 1\n","output":"3\n"},{"problem_id":"p02909","input":"Sunny\n","output":"Cloudy\n"},{"problem_id":"p02910","input":"RUDLUDR\n","output":"Yes\n"},{"problem_id":"p02911","input":"6 3 4\n3\n1\n3\n2\n","output":"No\nNo\nYes\nNo\nNo\nNo\n"},{"problem_id":"p02912","input":"3 3\n2 13 8\n","output":"9\n"},{"problem_id":"p02913","input":"5\nababa\n","output":"2\n"},{"problem_id":"p02914","input":"3\n3 6 5\n","output":"12\n"},{"problem_id":"p02915","input":"2\n","output":"8\n"},{"problem_id":"p02916","input":"3\n3 1 2\n2 5 4\n3 6\n","output":"14\n"},{"problem_id":"p02917","input":"3\n2 5\n","output":"9\n"},{"problem_id":"p02918","input":"6 1\nLRLRRL\n","output":"3\n"},{"problem_id":"p02919","input":"3\n2 3 1\n","output":"5\n"},{"problem_id":"p02920","input":"2\n4 2 3 1\n","output":"Yes\n"},{"problem_id":"p02921","input":"CSS\nCSR\n","output":"2\n"},{"problem_id":"p02922","input":"4 10\n","output":"3\n"},{"problem_id":"p02923","input":"5\n10 4 8 7 3\n","output":"2\n"},{"problem_id":"p02924","input":"2\n","output":"1\n"},{"problem_id":"p02925","input":"3\n2 3\n1 3\n1 2\n","output":"3\n"},{"problem_id":"p02926","input":"3\n0 10\n5 -5\n-5 -5\n","output":"10.000000000000000000000000000000000000000000000000\n"},{"problem_id":"p02927","input":"15 40\n","output":"10\n"},{"problem_id":"p02928","input":"2 2\n2 1\n","output":"3\n"},{"problem_id":"p02929","input":"2\nBWWB\n","output":"4\n"},{"problem_id":"p02930","input":"3\n","output":"1 2\n1\n"},{"problem_id":"p02931","input":"6 2 2\n2 2 2\n1 1 8\n1 1 5\n1 2 9\n1 2 7\n2 1 4\n","output":"28\n"},{"problem_id":"p02932","input":"4 2 3 7\n","output":"105\n"},{"problem_id":"p02933","input":"3200\npink\n","output":"pink\n"},{"problem_id":"p02934","input":"2\n10 30\n","output":"7.5\n"},{"problem_id":"p02935","input":"2\n3 4\n","output":"3.5\n"},{"problem_id":"p02936","input":"4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n","output":"100 110 111 110\n"},{"problem_id":"p02937","input":"contest\nson\n","output":"10\n"},{"problem_id":"p02938","input":"2 3\n","output":"3\n"},{"problem_id":"p02939","input":"aabbaa\n","output":"4\n"},{"problem_id":"p02940","input":"3\nRRRGGGBBB\n","output":"216\n"},{"problem_id":"p02941","input":"3\n1 1 1\n13 5 7\n","output":"4\n"},{"problem_id":"p02942","input":"3 2\n2 6\n4 3\n1 5\n","output":"2 6\n4 3\n5 1\n2 1\n4 3\n5 6\n"},{"problem_id":"p02943","input":"5 1\nbacba\n","output":"aabca\n"},{"problem_id":"p02944","input":"9 3\n2 1 1 1 1 1 1 2 3\n","output":"22\n"},{"problem_id":"p02945","input":"-13 3\n","output":"-10\n"},{"problem_id":"p02946","input":"3 7\n","output":"5 6 7 8 9\n"},{"problem_id":"p02947","input":"3\nacornistnt\npeanutbomb\nconstraint\n","output":"1\n"},{"problem_id":"p02948","input":"3 4\n4 3\n4 1\n2 2\n","output":"5\n"},{"problem_id":"p02949","input":"3 3 10\n1 2 20\n2 3 30\n1 3 45\n","output":"35\n"},{"problem_id":"p02950","input":"2\n1 0\n","output":"1 1\n"},{"problem_id":"p02951","input":"6 4 3\n","output":"1\n"},{"problem_id":"p02952","input":"11\n","output":"9\n"},{"problem_id":"p02953","input":"5\n1 2 1 1 3\n","output":"Yes\n"},{"problem_id":"p02954","input":"RRLRL\n","output":"0 1 2 1 1\n"},{"problem_id":"p02955","input":"2 3\n8 20\n","output":"7\n"},{"problem_id":"p02956","input":"3\n-1 3\n2 1\n3 -2\n","output":"13\n"},{"problem_id":"p02957","input":"2 16\n","output":"9\n"},{"problem_id":"p02958","input":"5\n5 2 3 4 1\n","output":"YES\n"},{"problem_id":"p02959","input":"2\n3 5 2\n4 5\n","output":"9\n"},{"problem_id":"p02960","input":"??2??5\n","output":"768\n"},{"problem_id":"p02962","input":"abcabab\nab\n","output":"3\n"},{"problem_id":"p02963","input":"3\n","output":"1 0 2 2 0 1\n"},{"problem_id":"p02964","input":"3 2\n1 2 3\n","output":"2 3\n"},{"problem_id":"p02965","input":"2 2\n","output":"3\n"},{"problem_id":"p02966","input":"3\n2 1\n1 4\n3 3\n","output":"2\n"},{"problem_id":"p02967","input":"ABBCBCAB\n","output":"ACBCAB\n"},{"problem_id":"p02968","input":"2 998244353\n","output":"4\n"},{"problem_id":"p02969","input":"4\n","output":"48\n"},{"problem_id":"p02970","input":"6 2\n","output":"2\n"},{"problem_id":"p02971","input":"3\n1\n4\n3\n","output":"4\n3\n4\n"},{"problem_id":"p02972","input":"3\n1 0 0\n","output":"1\n1\n"},{"problem_id":"p02973","input":"5\n2\n1\n4\n5\n3\n","output":"2\n"},{"problem_id":"p02974","input":"3 2\n","output":"2\n"},{"problem_id":"p02975","input":"3\n1 2 3\n","output":"Yes\n"},{"problem_id":"p02976","input":"4 4\n1 2\n2 3\n3 4\n4 1\n","output":"1 2\n1 4\n3 2\n3 4\n"},{"problem_id":"p02977","input":"3\n","output":"Yes\n1 2\n2 3\n3 4\n4 5\n5 6\n"},{"problem_id":"p02978","input":"4\n3 1 4 2\n","output":"16\n"},{"problem_id":"p02979","input":"3 1 998244353\n","output":"7\n"},{"problem_id":"p02980","input":"1 2\n","output":"8\n"},{"problem_id":"p02981","input":"4 2 9\n","output":"8\n"},{"problem_id":"p02982","input":"3 2\n1 2\n5 5\n-2 8\n","output":"1\n"},{"problem_id":"p02983","input":"2020 2040\n","output":"2\n"},{"problem_id":"p02984","input":"3\n2 2 4\n","output":"4 0 4\n"},{"problem_id":"p02986","input":"5 3\n1 2 1 10\n1 3 2 20\n2 4 4 30\n5 2 1 40\n1 100 1 4\n1 100 1 5\n3 1000 3 4\n","output":"130\n200\n60\n"},{"problem_id":"p02987","input":"ASSA\n","output":"Yes\n"},{"problem_id":"p02988","input":"5\n1 3 5 4 2\n","output":"2\n"},{"problem_id":"p02989","input":"6\n9 1 4 4 6 7\n","output":"2\n"},{"problem_id":"p02990","input":"5 3\n","output":"3\n6\n1\n"},{"problem_id":"p02991","input":"4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n","output":"2\n"},{"problem_id":"p02992","input":"3 2\n","output":"5\n"},{"problem_id":"p02993","input":"3776\n","output":"Bad\n"},{"problem_id":"p02994","input":"5 2\n","output":"18\n"},{"problem_id":"p02995","input":"4 9 2 3\n","output":"2\n"},{"problem_id":"p02996","input":"5\n2 4\n1 9\n1 8\n4 9\n3 12\n","output":"Yes\n"},{"problem_id":"p02997","input":"5 3\n","output":"5\n4 3\n1 2\n3 1\n4 5\n2 3\n"},{"problem_id":"p02998","input":"3\n1 1\n5 1\n5 5\n","output":"1\n"},{"problem_id":"p02999","input":"3 5\n","output":"0\n"},{"problem_id":"p03000","input":"3 6\n3 4 5\n","output":"2\n"},{"problem_id":"p03001","input":"2 3 1 2\n","output":"3.000000 0\n"},{"problem_id":"p03002","input":"4 10\n6 1 2 7\n","output":"2\n"},{"problem_id":"p03003","input":"2 2\n1 3\n3 1\n","output":"3\n"},{"problem_id":"p03004","input":"2\n0 3 D\n3 0 L\n","output":"0\n"},{"problem_id":"p03005","input":"3 2\n","output":"1\n"},{"problem_id":"p03006","input":"2\n1 1\n2 2\n","output":"1\n"},{"problem_id":"p03007","input":"3\n1 -1 2\n","output":"4\n-1 1\n2 -2\n"},{"problem_id":"p03008","input":"23\n1 1 1\n2 1 1\n","output":"46\n"},{"problem_id":"p03009","input":"2 2 1\n","output":"6\n"},{"problem_id":"p03010","input":"3\n","output":"0 6 15\n6 0 21\n15 21 0\n"},{"problem_id":"p03011","input":"1 3 4\n","output":"4\n"},{"problem_id":"p03012","input":"3\n1 2 3\n","output":"0\n"},{"problem_id":"p03013","input":"6 1\n3\n","output":"4\n"},{"problem_id":"p03014","input":"4 6\n#..#..\n.....#\n....#.\n#.#...\n","output":"8\n"},{"problem_id":"p03016","input":"5 3 4 10007\n","output":"5563\n"},{"problem_id":"p03017","input":"7 1 3 6 7\n.#..#..\n","output":"Yes\n"},{"problem_id":"p03018","input":"ABCABC\n","output":"3\n"},{"problem_id":"p03019","input":"2 100\n85 2 3\n60 1 1\n","output":"115\n"},{"problem_id":"p03020","input":"2\n0 0 1\n3 2 1\n2 2 1\n5 0 1\n","output":"8\n"},{"problem_id":"p03021","input":"7\n0010101\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7\n","output":"3\n"},{"problem_id":"p03022","input":"2\n1 1 1 1\n","output":"0\n4\n4\n4\n"},{"problem_id":"p03023","input":"3\n","output":"180\n"},{"problem_id":"p03024","input":"oxoxoxoxoxoxox\n","output":"YES\n"},{"problem_id":"p03025","input":"1 25 25 50\n","output":"2\n"},{"problem_id":"p03026","input":"5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n","output":"10\n1 2 3 4 5\n"},{"problem_id":"p03027","input":"2\n7 2 4\n12345 67890 2019\n","output":"9009\n916936\n"},{"problem_id":"p03028","input":"3\n0\n10\n","output":"2\n"},{"problem_id":"p03029","input":"1 3\n","output":"3\n"},{"problem_id":"p03030","input":"6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n","output":"3\n4\n6\n1\n5\n2\n"},{"problem_id":"p03031","input":"2 2\n2 1 2\n1 2\n0 1\n","output":"1\n"},{"problem_id":"p03032","input":"6 4\n-10 8 2 1 2 6\n","output":"14\n"},{"problem_id":"p03033","input":"4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n","output":"2\n2\n10\n-1\n13\n-1\n"},{"problem_id":"p03034","input":"5\n0 2 5 1 0\n","output":"3\n"},{"problem_id":"p03035","input":"30 100\n","output":"100\n"},{"problem_id":"p03036","input":"2 10 20\n","output":"30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n"},{"problem_id":"p03037","input":"4 2\n1 3\n2 4\n","output":"2\n"},{"problem_id":"p03038","input":"3 2\n5 1 4\n2 3\n1 5\n","output":"14\n"},{"problem_id":"p03039","input":"2 2 2\n","output":"8\n"},{"problem_id":"p03040","input":"4\n1 4 2\n2\n1 1 -8\n2\n","output":"4 2\n1 -3\n"},{"problem_id":"p03041","input":"3 1\nABC\n","output":"aBC\n"},{"problem_id":"p03042","input":"1905\n","output":"YYMM\n"},{"problem_id":"p03043","input":"3 10\n","output":"0.145833333333\n"},{"problem_id":"p03044","input":"3\n1 2 2\n2 3 1\n","output":"0\n0\n1\n"},{"problem_id":"p03045","input":"3 1\n1 2 1\n","output":"2\n"},{"problem_id":"p03047","input":"3 2\n","output":"2\n"},{"problem_id":"p03048","input":"1 2 3 4\n","output":"4\n"},{"problem_id":"p03049","input":"3\nABCA\nXBAZ\nBAD\n","output":"2\n"},{"problem_id":"p03050","input":"8\n","output":"10\n"},{"problem_id":"p03051","input":"3\n1 2 3\n","output":"3\n"},{"problem_id":"p03052","input":"3 3\n1 2\n2 3\n1 3\n","output":"6\n"},{"problem_id":"p03053","input":"3 3\n...\n.#.\n...\n","output":"2\n"},{"problem_id":"p03054","input":"2 3 3\n2 2\nRRL\nLUD\n","output":"YES\n"},{"problem_id":"p03055","input":"3\n1 2\n2 3\n","output":"First\n"},{"problem_id":"p03056","input":"3 3\n...\n.##\n.##\n","output":"2\n"},{"problem_id":"p03057","input":"4 7\nRBRRBRR\n","output":"2\n"},{"problem_id":"p03058","input":"5 3\n1 2\n1 3\n3 4\n1 5\n5 4\n2 5\n1 5\n","output":"6\n"},{"problem_id":"p03059","input":"3 5 7\n","output":"10\n"},{"problem_id":"p03060","input":"3\n10 2 5\n6 3 4\n","output":"5\n"},{"problem_id":"p03061","input":"3\n7 6 8\n","output":"2\n"},{"problem_id":"p03062","input":"3\n-10 5 -4\n","output":"19\n"},{"problem_id":"p03063","input":"3\n#.#\n","output":"1\n"},{"problem_id":"p03064","input":"4\n1\n1\n1\n2\n","output":"18\n"},{"problem_id":"p03065","input":"2\n7\n-7\n14\n","output":"2\n7\n"},{"problem_id":"p03066","input":"3 3\n","output":"14\n"},{"problem_id":"p03067","input":"3 8 5\n","output":"Yes\n"},{"problem_id":"p03068","input":"5\nerror\n2\n","output":"*rr*r\n"},{"problem_id":"p03069","input":"3\n#.#\n","output":"1\n"},{"problem_id":"p03070","input":"4\n1\n1\n1\n2\n","output":"18\n"},{"problem_id":"p03071","input":"5 3\n","output":"9\n"},{"problem_id":"p03072","input":"4\n6 5 6 8\n","output":"3\n"},{"problem_id":"p03073","input":"000\n","output":"1\n"},{"problem_id":"p03074","input":"5 1\n00010\n","output":"4\n"},{"problem_id":"p03075","input":"1\n2\n4\n8\n9\n15\n","output":"Yay!\n"},{"problem_id":"p03076","input":"29\n20\n7\n35\n120\n","output":"215\n"},{"problem_id":"p03077","input":"5\n3\n2\n4\n3\n5\n","output":"7\n"},{"problem_id":"p03078","input":"2 2 2 8\n4 6\n1 5\n3 8\n","output":"19\n17\n15\n14\n13\n12\n10\n8\n"},{"problem_id":"p03079","input":"2 2 2\n","output":"Yes\n"},{"problem_id":"p03080","input":"4\nRRBR\n","output":"Yes\n"},{"problem_id":"p03081","input":"3 4\nABC\nA L\nB L\nB R\nA R\n","output":"2\n"},{"problem_id":"p03082","input":"2 19\n3 7\n","output":"3\n"},{"problem_id":"p03083","input":"2 1\n","output":"500000004\n750000006\n750000006\n"},{"problem_id":"p03084","input":"4 5 4\nEEWW\nNSNNS\n4 1 1 4\n1 3 1 2\n4 2 3 2\n3 3 3 5\n","output":"6\n11\n5\n4\n"},{"problem_id":"p03085","input":"A\n","output":"T\n"},{"problem_id":"p03086","input":"ATCODER\n","output":"3\n"},{"problem_id":"p03087","input":"8 3\nACACTACG\n3 7\n2 3\n1 8\n","output":"2\n0\n3\n"},{"problem_id":"p03088","input":"3\n","output":"61\n"},{"problem_id":"p03089","input":"3\n1 2 1\n","output":"1\n1\n2\n"},{"problem_id":"p03090","input":"3\n","output":"2\n1 3\n2 3\n"},{"problem_id":"p03091","input":"7 9\n1 2\n1 3\n2 3\n1 4\n1 5\n4 5\n1 6\n1 7\n6 7\n","output":"Yes\n"},{"problem_id":"p03092","input":"3 20 30\n3 1 2\n","output":"20\n"},{"problem_id":"p03093","input":"3 10\n0 2 3 4 5 9\n","output":"5\n"},{"problem_id":"p03094","input":"2\n","output":"138888890\n"},{"problem_id":"p03095","input":"4\nabcd\n","output":"15\n"},{"problem_id":"p03096","input":"5\n1\n2\n1\n2\n2\n","output":"3\n"},{"problem_id":"p03097","input":"2 1 3\n","output":"YES\n1 0 2 3\n"},{"problem_id":"p03098","input":"3 3\n1 2 3\n3 2 1\n","output":"3 2 1\n"},{"problem_id":"p03099","input":"7\n1 3 6\n1 5 9\n3 1 8\n4 3 8\n6 2 9\n5 4 11\n5 7 10\n4\nL 3 1\nR 2 3\nD 5 3\nU 4 2\n","output":"36\n"},{"problem_id":"p03100","input":"3 2 2 2019\n1 2 1\n2 3 2\n1 3 5\n1 3 4\n","output":"YES\nNO\n"},{"problem_id":"p03101","input":"3 2\n2 1\n","output":"1\n"},{"problem_id":"p03102","input":"2 3 -10\n1 2 3\n3 2 1\n1 2 2\n","output":"1\n"},{"problem_id":"p03103","input":"2 5\n4 9\n2 4\n","output":"12\n"},{"problem_id":"p03105","input":"2 11 4\n","output":"4\n"},{"problem_id":"p03106","input":"8 12 2\n","output":"2\n"},{"problem_id":"p03107","input":"0011\n","output":"4\n"},{"problem_id":"p03108","input":"4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n","output":"0\n0\n4\n5\n6\n"},{"problem_id":"p03109","input":"2019\/04\/30\n","output":"Heisei\n"},{"problem_id":"p03110","input":"2\n10000 JPY\n0.10000000 BTC\n","output":"48000.0\n"},{"problem_id":"p03111","input":"5 100 90 80\n98\n40\n30\n21\n80\n","output":"23\n"},{"problem_id":"p03112","input":"2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n","output":"350\n1400\n301\n399\n"},{"problem_id":"p03113","input":"2 1\n5 5\n","output":"7\n1 1 2 1 2 2 1\n"},{"problem_id":"p03114","input":"4\n2\n1 2\n2 4\n","output":"136\n"},{"problem_id":"p03115","input":"4\n-2 1\n-2 2\n0 1\n1 0\n","output":"-1\n"},{"problem_id":"p03116","input":"4\n-2 1\n-2 2\n0 1\n1 0\n","output":"-1 0\n"},{"problem_id":"p03117","input":"8 3\n","output":"5\n"},{"problem_id":"p03118","input":"1\nX\n","output":"500000004 0 500000003\n"},{"problem_id":"p03119","input":"2 1\n5 5\n","output":"7\n1 1 2 1 2 2 1\n"},{"problem_id":"p03120","input":"4\n2\n1 2\n2 4\n","output":"136\n"},{"problem_id":"p03121","input":"4\n-2 1\n-2 2\n0 1\n1 0\n","output":"-1\n"},{"problem_id":"p03122","input":"4\n-2 1\n-2 2\n0 1\n1 0\n","output":"-1 0\n"},{"problem_id":"p03123","input":"8 3\n","output":"5\n"},{"problem_id":"p03124","input":"1\nX\n","output":"500000004 0 500000003\n"},{"problem_id":"p03125","input":"4 12\n","output":"16\n"},{"problem_id":"p03126","input":"3 4\n2 1 3\n3 1 2 3\n2 3 2\n","output":"1\n"},{"problem_id":"p03127","input":"4\n2 10 8 40\n","output":"2\n"},{"problem_id":"p03128","input":"20 4\n3 7 8 4\n","output":"777773\n"},{"problem_id":"p03129","input":"3 2\n","output":"YES\n"},{"problem_id":"p03130","input":"4 2\n1 3\n2 3\n","output":"YES\n"},{"problem_id":"p03131","input":"4 2 6\n","output":"7\n"},{"problem_id":"p03132","input":"4\n1\n0\n2\n3\n","output":"1\n"},{"problem_id":"p03133","input":"2 2\n0 1\n1 0\n","output":"6\n"},{"problem_id":"p03134","input":"02\n","output":"3\n"},{"problem_id":"p03135","input":"8 3\n","output":"2.6666666667\n"},{"problem_id":"p03136","input":"4\n3 8 5 1\n","output":"Yes\n"},{"problem_id":"p03137","input":"2 5\n10 12 1 2 14\n","output":"5\n"},{"problem_id":"p03139","input":"10 3 5\n","output":"3 0\n"},{"problem_id":"p03140","input":"4\nwest\neast\nwait\n","output":"3\n"},{"problem_id":"p03141","input":"3\n10 10\n20 20\n30 30\n","output":"20\n"},{"problem_id":"p03142","input":"3 1\n1 2\n1 3\n2 3\n","output":"0\n1\n2\n"},{"problem_id":"p03143","input":"4 4\n2 3 5 7\n1 2 7\n1 3 9\n2 3 12\n3 4 18\n","output":"2\n"},{"problem_id":"p03144","input":"5 2\n1 1\n1 2\n1 3\n2 4\n2 5\n","output":"-1\n9\n6\n14\n15\n"},{"problem_id":"p03145","input":"3 4 5\n","output":"6\n"},{"problem_id":"p03146","input":"8\n","output":"5\n"},{"problem_id":"p03147","input":"4\n1 2 2 1\n","output":"2\n"},{"problem_id":"p03148","input":"5 3\n1 9\n1 7\n2 6\n2 5\n3 1\n","output":"26\n"},{"problem_id":"p03149","input":"1 7 9 4\n","output":"YES\n"},{"problem_id":"p03150","input":"keyofscience\n","output":"YES\n"},{"problem_id":"p03151","input":"3\n2 3 5\n3 4 1\n","output":"3\n"},{"problem_id":"p03152","input":"2 2\n4 3\n3 4\n","output":"2\n"},{"problem_id":"p03153","input":"3 1\n1 100 1\n","output":"106\n"},{"problem_id":"p03154","input":"2 1 2\n","output":"34\n"},{"problem_id":"p03155","input":"3\n2\n3\n","output":"2\n"},{"problem_id":"p03156","input":"7\n5 15\n1 10 16 2 7 20 12\n","output":"2\n"},{"problem_id":"p03157","input":"3 3\n.#.\n..#\n#..\n","output":"10\n"},{"problem_id":"p03158","input":"5 5\n3 5 7 11 13\n1\n4\n9\n10\n13\n","output":"31\n31\n27\n23\n23\n"},{"problem_id":"p03159","input":"7\n-2 7 5 6 -8 3 4\n1 2\n2 3\n2 4\n1 5\n5 6\n5 7\n","output":"1\n"},{"problem_id":"p03160","input":"4\n10 30 40 20\n","output":"30\n"},{"problem_id":"p03161","input":"5 3\n10 30 40 50 20\n","output":"30\n"},{"problem_id":"p03162","input":"3\n10 40 70\n20 50 80\n30 60 90\n","output":"210\n"},{"problem_id":"p03163","input":"3 8\n3 30\n4 50\n5 60\n","output":"90\n"},{"problem_id":"p03164","input":"3 8\n3 30\n4 50\n5 60\n","output":"90\n"},{"problem_id":"p03165","input":"axyb\nabyxb\n","output":"axb\n"},{"problem_id":"p03166","input":"4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n","output":"3\n"},{"problem_id":"p03167","input":"3 4\n...#\n.#..\n....\n","output":"3\n"},{"problem_id":"p03168","input":"3\n0.30 0.60 0.80\n","output":"0.612\n"},{"problem_id":"p03169","input":"3\n1 1 1\n","output":"5.5\n"},{"problem_id":"p03170","input":"2 4\n2 3\n","output":"First\n"},{"problem_id":"p03171","input":"4\n10 80 90 30\n","output":"10\n"},{"problem_id":"p03172","input":"3 4\n1 2 3\n","output":"5\n"},{"problem_id":"p03173","input":"4\n10 20 30 40\n","output":"190\n"},{"problem_id":"p03174","input":"3\n0 1 1\n1 0 1\n1 1 1\n","output":"3\n"},{"problem_id":"p03175","input":"3\n1 2\n2 3\n","output":"5\n"},{"problem_id":"p03176","input":"4\n3 1 4 2\n10 20 30 40\n","output":"60\n"},{"problem_id":"p03177","input":"4 2\n0 1 0 0\n0 0 1 1\n0 0 0 1\n1 0 0 0\n","output":"6\n"},{"problem_id":"p03178","input":"30\n4\n","output":"6\n"},{"problem_id":"p03179","input":"4\n<><\n","output":"5\n"},{"problem_id":"p03180","input":"3\n0 10 20\n10 0 -100\n20 -100 0\n","output":"20\n"},{"problem_id":"p03181","input":"3 100\n1 2\n2 3\n","output":"3\n4\n3\n"},{"problem_id":"p03182","input":"5 3\n1 3 10\n2 4 -10\n3 5 10\n","output":"20\n"},{"problem_id":"p03183","input":"3\n2 2 20\n2 1 30\n3 1 40\n","output":"50\n"},{"problem_id":"p03184","input":"3 4 2\n2 2\n1 4\n","output":"3\n"},{"problem_id":"p03185","input":"5 6\n1 2 3 4 5\n","output":"20\n"},{"problem_id":"p03186","input":"3 1 4\n","output":"5\n"},{"problem_id":"p03187","input":"10 3\n2\n7\n9\n","output":"15\n"},{"problem_id":"p03188","input":"2\n","output":"3\n1 1 1\n1 1 1\n2 2 2\n"},{"problem_id":"p03189","input":"3 2\n1\n2\n3\n1 2\n1 3\n","output":"6\n"},{"problem_id":"p03190","input":"4\n0011\n0101\n","output":"4\n"},{"problem_id":"p03191","input":"3\n1 -1 -1 3 6 -1\n","output":"5\n"},{"problem_id":"p03192","input":"1222\n","output":"3\n"},{"problem_id":"p03193","input":"3 5 2\n10 3\n5 2\n2 5\n","output":"2\n"},{"problem_id":"p03194","input":"3 24\n","output":"2\n"},{"problem_id":"p03195","input":"2\n1\n2\n","output":"first\n"},{"problem_id":"p03196","input":"3 24\n","output":"2\n"},{"problem_id":"p03197","input":"2\n1\n2\n","output":"first\n"},{"problem_id":"p03198","input":"4\n3 1 4 1\n","output":"3\n"},{"problem_id":"p03199","input":"3 3\n1 1 1\n3 1 0\n2 3 1\n","output":"8\n"},{"problem_id":"p03200","input":"BBW\n","output":"2\n"},{"problem_id":"p03201","input":"3\n1 2 3\n","output":"1\n"},{"problem_id":"p03202","input":"3\n3 2 1\n","output":"2\n"},{"problem_id":"p03203","input":"3 3 1\n3 2\n","output":"2\n"},{"problem_id":"p03204","input":"6\n1 5\n5 6\n6 2\n6 3\n6 4\n","output":"5 5 5 1 5\n"},{"problem_id":"p03205","input":"5\n2 1 2\n3 1 2 3\n3 3 4 5\n2 4 5\n","output":"1 2\n1 3\n3 4\n4 5\n"},{"problem_id":"p03206","input":"25\n","output":"Christmas\n"},{"problem_id":"p03207","input":"3\n4980\n7980\n6980\n","output":"15950\n"},{"problem_id":"p03208","input":"5 3\n10\n15\n11\n14\n12\n","output":"2\n"},{"problem_id":"p03209","input":"2 7\n","output":"4\n"},{"problem_id":"p03210","input":"5\n","output":"YES\n"},{"problem_id":"p03211","input":"1234567876\n","output":"34\n"},{"problem_id":"p03212","input":"575\n","output":"4\n"},{"problem_id":"p03213","input":"9\n","output":"0\n"},{"problem_id":"p03214","input":"3\n1 2 3\n","output":"1\n"},{"problem_id":"p03215","input":"4 2\n2 5 2 5\n","output":"12\n"},{"problem_id":"p03216","input":"18\nDWANGOMEDIACLUSTER\n1\n18\n","output":"1\n"},{"problem_id":"p03217","input":"3 1\n0 0\n1 0\n2 0\n","output":"1\n"},{"problem_id":"p03218","input":"2\n4 3\n","output":"3\n"},{"problem_id":"p03219","input":"81 58\n","output":"110\n"},{"problem_id":"p03220","input":"2\n12 5\n1000 2000\n","output":"1\n"},{"problem_id":"p03221","input":"2 3\n1 32\n2 63\n1 12\n","output":"000001000002\n000002000001\n000001000001\n"},{"problem_id":"p03222","input":"1 3 2\n","output":"1\n"},{"problem_id":"p03223","input":"5\n6\n8\n1\n2\n3\n","output":"21\n"},{"problem_id":"p03224","input":"3\n","output":"Yes\n3\n2 1 2\n2 3 1\n2 2 3\n"},{"problem_id":"p03225","input":"5 4\n#.##\n.##.\n#...\n..##\n...#\n","output":"3\n"},{"problem_id":"p03226","input":"3\n1\n2\n1\n","output":"2\n"},{"problem_id":"p03227","input":"abc\n","output":"cba\n"},{"problem_id":"p03228","input":"5 4 2\n","output":"5 3\n"},{"problem_id":"p03229","input":"5\n6\n8\n1\n2\n3\n","output":"21\n"},{"problem_id":"p03230","input":"3\n","output":"Yes\n3\n2 1 2\n2 3 1\n2 2 3\n"},{"problem_id":"p03231","input":"3 2\nacp\nae\n","output":"6\n"},{"problem_id":"p03232","input":"2\n1 2\n","output":"9\n"},{"problem_id":"p03233","input":"3\n1 5\n4 2\n6 3\n","output":"7\n"},{"problem_id":"p03234","input":"2 0\n","output":"5\n"},{"problem_id":"p03235","input":"6\n3 1 4 6 2 5\n","output":"001001\n"},{"problem_id":"p03236","input":"2\n11\n11\n","output":"5\n"},{"problem_id":"p03237","input":"2\n11\n11\n","output":"5\n"},{"problem_id":"p03238","input":"1\n","output":"Hello World\n"},{"problem_id":"p03239","input":"3 70\n7 60\n1 80\n4 50\n","output":"4\n"},{"problem_id":"p03240","input":"4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n","output":"2 2 6\n"},{"problem_id":"p03241","input":"3 14\n","output":"2\n"},{"problem_id":"p03242","input":"119\n","output":"991\n"},{"problem_id":"p03243","input":"111\n","output":"111\n"},{"problem_id":"p03244","input":"4\n3 1 3 2\n","output":"1\n"},{"problem_id":"p03245","input":"3\n-1 0\n0 3\n2 -1\n","output":"2\n1 2\nRL\nUU\nDR\n"},{"problem_id":"p03246","input":"4\n3 1 3 2\n","output":"1\n"},{"problem_id":"p03247","input":"3\n-1 0\n0 3\n2 -1\n","output":"2\n1 2\nRL\nUU\nDR\n"},{"problem_id":"p03248","input":"1111\n","output":"-1\n"},{"problem_id":"p03249","input":"7\n10\n15\n13\n18\n11\n14\n19\n","output":"1 2\n1 3\n1 5\n3 4\n5 6\n6 7\n"},{"problem_id":"p03250","input":"1 5 2\n","output":"53\n"},{"problem_id":"p03251","input":"3 2 10 20\n8 15 13\n16 22\n","output":"No War\n"},{"problem_id":"p03252","input":"azzel\napple\n","output":"Yes\n"},{"problem_id":"p03253","input":"2 6\n","output":"4\n"},{"problem_id":"p03254","input":"3 70\n20 30 10\n","output":"2\n"},{"problem_id":"p03255","input":"2 100\n1 10\n","output":"355\n"},{"problem_id":"p03256","input":"2 3\nAB\n1 1\n1 2\n2 2\n","output":"Yes\n"},{"problem_id":"p03257","input":"2\n","output":"4 7\n23 10\n"},{"problem_id":"p03258","input":"aaaa\n","output":"6\n"},{"problem_id":"p03259","input":"2\n3\n1 2\n2 3\n1 3\n3 2\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n1 2\n2 4\n4 3\n3 5\n5 6\n","output":"1\n-1\n"},{"problem_id":"p03260","input":"3 1\n","output":"Yes\n"},{"problem_id":"p03261","input":"4\nhoge\nenglish\nhoge\nenigma\n","output":"No\n"},{"problem_id":"p03262","input":"3 3\n1 7 11\n","output":"2\n"},{"problem_id":"p03263","input":"2 3\n1 2 3\n0 1 1\n","output":"3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n"},{"problem_id":"p03264","input":"3\n","output":"2\n"},{"problem_id":"p03265","input":"0 0 0 1\n","output":"-1 1 -1 0\n"},{"problem_id":"p03266","input":"3 2\n","output":"9\n"},{"problem_id":"p03267","input":"4\n","output":"8 10\n1 2 0\n2 3 0\n3 4 0\n1 5 0\n2 6 0\n3 7 0\n4 8 0\n5 6 1\n6 7 1\n7 8 1\n"},{"problem_id":"p03268","input":"3 2\n","output":"9\n"},{"problem_id":"p03269","input":"4\n","output":"8 10\n1 2 0\n2 3 0\n3 4 0\n1 5 0\n2 6 0\n3 7 0\n4 8 0\n5 6 1\n6 7 1\n7 8 1\n"},{"problem_id":"p03270","input":"3 3\n","output":"7\n7\n4\n7\n7\n"},{"problem_id":"p03271","input":"5\n5\n2\n1\n4\n3\n","output":"Yes\n"},{"problem_id":"p03272","input":"4 2\n","output":"3\n"},{"problem_id":"p03273","input":"4 4\n##.#\n....\n##.#\n.#.#\n","output":"###\n###\n.##\n"},{"problem_id":"p03274","input":"5 3\n-30 -10 10 20 50\n","output":"40\n"},{"problem_id":"p03275","input":"3\n10 30 20\n","output":"30\n"},{"problem_id":"p03276","input":"5 3\n-30 -10 10 20 50\n","output":"40\n"},{"problem_id":"p03277","input":"3\n10 30 20\n","output":"30\n"},{"problem_id":"p03278","input":"4\n1 2\n2 3\n3 4\n","output":"2\n"},{"problem_id":"p03279","input":"2 2\n2 3\n1 4\n","output":"3\n"},{"problem_id":"p03280","input":"2 2\n","output":"1\n"},{"problem_id":"p03281","input":"105\n","output":"1\n"},{"problem_id":"p03282","input":"1214\n4\n","output":"2\n"},{"problem_id":"p03283","input":"2 3 1\n1 1\n1 2\n2 2\n1 2\n","output":"3\n"},{"problem_id":"p03284","input":"7 3\n","output":"1\n"},{"problem_id":"p03285","input":"11\n","output":"Yes\n"},{"problem_id":"p03286","input":"-9\n","output":"1011\n"},{"problem_id":"p03287","input":"3 2\n4 1 5\n","output":"3\n"},{"problem_id":"p03288","input":"1199\n","output":"ABC\n"},{"problem_id":"p03289","input":"AtCoder\n","output":"AC\n"},{"problem_id":"p03290","input":"2 700\n3 500\n5 800\n","output":"3\n"},{"problem_id":"p03291","input":"A??C\n","output":"8\n"},{"problem_id":"p03292","input":"1 6 3\n","output":"5\n"},{"problem_id":"p03293","input":"kyoto\ntokyo\n","output":"Yes\n"},{"problem_id":"p03294","input":"3\n3 4 6\n","output":"10\n"},{"problem_id":"p03295","input":"5 2\n1 4\n2 5\n","output":"1\n"},{"problem_id":"p03296","input":"5\n1 1 2 2 2\n","output":"2\n"},{"problem_id":"p03297","input":"14\n9 7 5 9\n9 7 6 9\n14 10 7 12\n14 10 8 12\n14 10 9 12\n14 10 7 11\n14 10 8 11\n14 10 9 11\n9 10 5 10\n10 10 5 10\n11 10 5 10\n16 10 5 10\n1000000000000000000 17 14 999999999999999985\n1000000000000000000 17 15 999999999999999985\n","output":"No\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nYes\nNo\nNo\nYes\n"},{"problem_id":"p03298","input":"4\ncabaacba\n","output":"4\n"},{"problem_id":"p03299","input":"9\n2 3 5 4 1 2 4 2 1\n","output":"12800\n"},{"problem_id":"p03300","input":"3\naababb\n","output":"abab\n"},{"problem_id":"p03301","input":"5\n20 100 10 1 10\n","output":"120 21\n"},{"problem_id":"p03302","input":"4 11\n","output":"+\n"},{"problem_id":"p03303","input":"abcdefgh\n3\n","output":"adg\n"},{"problem_id":"p03304","input":"2 3 1\n","output":"1.0000000000\n"},{"problem_id":"p03305","input":"4 3 2 3\n1 4 1 100\n1 2 1 10\n1 3 20 1\n","output":"999999999999998\n999999999999989\n999999999999979\n999999999999897\n"},{"problem_id":"p03306","input":"3 3\n1 2 3\n2 3 5\n1 3 4\n","output":"1\n"},{"problem_id":"p03307","input":"3\n","output":"6\n"},{"problem_id":"p03308","input":"4\n1 4 6 3\n","output":"5\n"},{"problem_id":"p03309","input":"5\n2 2 3 5 5\n","output":"2\n"},{"problem_id":"p03310","input":"5\n3 2 4 1 2\n","output":"2\n"},{"problem_id":"p03311","input":"5\n2 2 3 5 5\n","output":"2\n"},{"problem_id":"p03312","input":"5\n3 2 4 1 2\n","output":"2\n"},{"problem_id":"p03313","input":"2\n1 2 3 1\n","output":"3\n4\n5\n"},{"problem_id":"p03314","input":"3 2 1\n1\n","output":"9\n"},{"problem_id":"p03315","input":"+-++\n","output":"2\n"},{"problem_id":"p03316","input":"12\n","output":"Yes\n"},{"problem_id":"p03317","input":"4 3\n2 3 1 4\n","output":"2\n"},{"problem_id":"p03318","input":"10\n","output":"1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n"},{"problem_id":"p03319","input":"4 3\n2 3 1 4\n","output":"2\n"},{"problem_id":"p03320","input":"10\n","output":"1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n"},{"problem_id":"p03321","input":"5 5\n1 2\n1 3\n3 4\n3 5\n4 5\n","output":"4\n"},{"problem_id":"p03322","input":"5\n+>+<-\n","output":"3\n"},{"problem_id":"p03323","input":"5 4\n","output":"Yay!\n"},{"problem_id":"p03324","input":"0 5\n","output":"5\n"},{"problem_id":"p03325","input":"3\n5 2 4\n","output":"3\n"},{"problem_id":"p03326","input":"5 3\n3 1 4\n1 5 9\n2 6 5\n3 5 8\n9 7 9\n","output":"56\n"},{"problem_id":"p03327","input":"999\n","output":"ABC\n"},{"problem_id":"p03328","input":"8 13\n","output":"2\n"},{"problem_id":"p03329","input":"127\n","output":"4\n"},{"problem_id":"p03330","input":"2 3\n0 1 1\n1 0 1\n1 4 0\n1 2\n3 3\n","output":"3\n"},{"problem_id":"p03331","input":"15\n","output":"6\n"},{"problem_id":"p03332","input":"4 1 2 5\n","output":"40\n"},{"problem_id":"p03333","input":"3\n-5 1\n3 7\n-4 -2\n","output":"10\n"},{"problem_id":"p03334","input":"2 1 2\n","output":"0 0\n0 2\n2 0\n2 2\n"},{"problem_id":"p03335","input":"4 3\n2 1\n3 1\n4 1\n2 3\n3 4\n4 2\n","output":"6\n2 3\n3 4\n4 2\n"},{"problem_id":"p03336","input":"2 3 3\n11\n101\n","output":"10000\n10010\n"},{"problem_id":"p03337","input":"3 1\n","output":"4\n"},{"problem_id":"p03338","input":"6\naabbca\n","output":"2\n"},{"problem_id":"p03339","input":"5\nWEEWW\n","output":"1\n"},{"problem_id":"p03341","input":"5\nWEEWW\n","output":"1\n"},{"problem_id":"p03343","input":"5 3 2\n4 3 1 5 2\n","output":"1\n"},{"problem_id":"p03344","input":"4 5\n3 1\n1 2\n4 1\n6 2\n1 2\n2 3\n2 4\n1 4\n3 4\n","output":"6\n"},{"problem_id":"p03345","input":"1 2 3 1\n","output":"1\n"},{"problem_id":"p03346","input":"4\n1\n3\n2\n4\n","output":"2\n"},{"problem_id":"p03347","input":"4\n0\n1\n1\n2\n","output":"3\n"},{"problem_id":"p03348","input":"5\n1 2\n2 3\n3 4\n3 5\n","output":"2 4\n"},{"problem_id":"p03349","input":"2 2 100\n","output":"5\n"},{"problem_id":"p03350","input":"3 4\n1\n01\n1011\n01001110\n","output":"10\n"},{"problem_id":"p03351","input":"4 7 9 3\n","output":"Yes\n"},{"problem_id":"p03352","input":"10\n","output":"9\n"},{"problem_id":"p03353","input":"aba\n4\n","output":"b\n"},{"problem_id":"p03354","input":"5 2\n5 3 1 4 2\n1 3\n5 4\n","output":"2\n"},{"problem_id":"p03355","input":"aba\n4\n","output":"b\n"},{"problem_id":"p03356","input":"5 2\n5 3 1 4 2\n1 3\n5 4\n","output":"2\n"},{"problem_id":"p03357","input":"3\nB 1\nW 2\nB 3\nW 1\nW 3\nB 2\n","output":"4\n"},{"problem_id":"p03358","input":"5\n1 2\n2 3\n2 4\n4 5\nWBBWW\n","output":"5\n"},{"problem_id":"p03359","input":"5 5\n","output":"5\n"},{"problem_id":"p03360","input":"5 3 11\n1\n","output":"30\n"},{"problem_id":"p03361","input":"3 3\n.#.\n###\n.#.\n","output":"Yes\n"},{"problem_id":"p03362","input":"5\n","output":"3 5 7 11 31\n"},{"problem_id":"p03363","input":"6\n1 3 -4 2 2 -2\n","output":"3\n"},{"problem_id":"p03364","input":"2\nab\nca\n","output":"2\n"},{"problem_id":"p03365","input":"4\n","output":"16\n"},{"problem_id":"p03366","input":"3 2\n1 3\n3 4\n4 2\n","output":"4\n"},{"problem_id":"p03367","input":"3\n2 3 3\n","output":"4\n"},{"problem_id":"p03368","input":"6\n1 1 2 3 3\n0 1 1 0 0 0\n","output":"4\n"},{"problem_id":"p03369","input":"oxo\n","output":"900\n"},{"problem_id":"p03370","input":"3 1000\n120\n100\n140\n","output":"9\n"},{"problem_id":"p03371","input":"1500 2000 1600 3 2\n","output":"7900\n"},{"problem_id":"p03372","input":"3 20\n2 80\n9 120\n16 1\n","output":"191\n"},{"problem_id":"p03373","input":"1500 2000 1600 3 2\n","output":"7900\n"},{"problem_id":"p03374","input":"3 20\n2 80\n9 120\n16 1\n","output":"191\n"},{"problem_id":"p03375","input":"2 1000000007\n","output":"2\n"},{"problem_id":"p03376","input":"3 100 1\n15\n10 1\n20 1\n","output":"7\n"},{"problem_id":"p03377","input":"3 5 4\n","output":"YES\n"},{"problem_id":"p03378","input":"5 3 3\n1 2 4\n","output":"1\n"},{"problem_id":"p03379","input":"4\n2 4 4 3\n","output":"4\n3\n3\n4\n"},{"problem_id":"p03380","input":"5\n6 9 4 2 11\n","output":"11 6\n"},{"problem_id":"p03381","input":"4\n2 4 4 3\n","output":"4\n3\n3\n4\n"},{"problem_id":"p03382","input":"5\n6 9 4 2 11\n","output":"11 6\n"},{"problem_id":"p03383","input":"2 3\narc\nrac\n","output":"YES\n"},{"problem_id":"p03384","input":"6\n1 2\n1 3\n1 4\n1 5\n5 6\n","output":"1 2 4 5 3 6\n"},{"problem_id":"p03385","input":"bac\n","output":"Yes\n"},{"problem_id":"p03386","input":"3 8 2\n","output":"3\n4\n7\n8\n"},{"problem_id":"p03387","input":"2 5 4\n","output":"2\n"},{"problem_id":"p03388","input":"8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n","output":"1\n12\n4\n11\n14\n57\n31\n671644785\n"},{"problem_id":"p03389","input":"2 5 4\n","output":"2\n"},{"problem_id":"p03390","input":"8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323\n","output":"1\n12\n4\n11\n14\n57\n31\n671644785\n"},{"problem_id":"p03391","input":"2\n1 2\n3 2\n","output":"2\n"},{"problem_id":"p03392","input":"abc\n","output":"3\n"},{"problem_id":"p03393","input":"atcoder\n","output":"atcoderb\n"},{"problem_id":"p03394","input":"3\n","output":"2 5 63\n"},{"problem_id":"p03395","input":"3\n19 10 14\n0 3 4\n","output":"160\n"},{"problem_id":"p03396","input":"2 10\n5 8\n10 4\n","output":"40\n"},{"problem_id":"p03397","input":"1??00\n","output":"2\n"},{"problem_id":"p03398","input":"3\n","output":"12\n"},{"problem_id":"p03399","input":"600\n300\n220\n420\n","output":"520\n"},{"problem_id":"p03400","input":"3\n7 1\n2\n5\n10\n","output":"8\n"},{"problem_id":"p03401","input":"3\n3 5 -1\n","output":"12\n8\n10\n"},{"problem_id":"p03402","input":"2 3\n","output":"3 3\n##.\n..#\n#.#\n"},{"problem_id":"p03403","input":"3\n3 5 -1\n","output":"12\n8\n10\n"},{"problem_id":"p03404","input":"2 3\n","output":"3 3\n##.\n..#\n#.#\n"},{"problem_id":"p03405","input":"3 3\n2\n1 2 1\n2 3 1\n3 1 1\n","output":"6\n"},{"problem_id":"p03406","input":"2 1\n3\n","output":"8\n"},{"problem_id":"p03407","input":"50 100 120\n","output":"Yes\n"},{"problem_id":"p03408","input":"3\napple\norange\napple\n1\ngrape\n","output":"2\n"},{"problem_id":"p03409","input":"3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n","output":"2\n"},{"problem_id":"p03411","input":"3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n","output":"2\n"},{"problem_id":"p03413","input":"5\n1 4 3 7 5\n","output":"11\n3\n1\n4\n2\n"},{"problem_id":"p03414","input":"3 3\n1 2\n1 3\n2 3\n","output":"same\ndiff\nsame\n"},{"problem_id":"p03415","input":"ant\nobe\nrec\n","output":"abc\n"},{"problem_id":"p03416","input":"11009 11332\n","output":"4\n"},{"problem_id":"p03417","input":"2 2\n","output":"0\n"},{"problem_id":"p03418","input":"5 2\n","output":"7\n"},{"problem_id":"p03419","input":"2 2\n","output":"0\n"},{"problem_id":"p03420","input":"5 2\n","output":"7\n"},{"problem_id":"p03421","input":"5 3 2\n","output":"2 4 1 5 3\n"},{"problem_id":"p03422","input":"2\n5 2\n3 3\n","output":"Aoki\n"},{"problem_id":"p03423","input":"8\n","output":"2\n"},{"problem_id":"p03424","input":"6\nG W Y P Y W\n","output":"Four\n"},{"problem_id":"p03425","input":"5\nMASHIKE\nRUMOI\nOBIRA\nHABORO\nHOROKANAI\n","output":"2\n"},{"problem_id":"p03426","input":"3 3 2\n1 4 3\n2 5 7\n8 9 6\n1\n4 8\n","output":"5\n"},{"problem_id":"p03427","input":"100\n","output":"18\n"},{"problem_id":"p03428","input":"2\n0 0\n1 1\n","output":"0.5\n0.5\n"},{"problem_id":"p03429","input":"3 4 4 2\n","output":"YES\n<><>\n^<>^\nv<>v\n"},{"problem_id":"p03430","input":"abcabcabc\n1\n","output":"7\n"},{"problem_id":"p03431","input":"2 4\n","output":"7\n"},{"problem_id":"p03432","input":"2 3\n","output":"64\n"},{"problem_id":"p03433","input":"2018\n218\n","output":"Yes\n"},{"problem_id":"p03434","input":"2\n3 1\n","output":"2\n"},{"problem_id":"p03435","input":"1 0 1\n2 1 2\n1 0 1\n","output":"Yes\n"},{"problem_id":"p03436","input":"3 3\n..#\n#..\n...\n","output":"2\n"},{"problem_id":"p03437","input":"8 6\n","output":"16\n"},{"problem_id":"p03438","input":"3\n1 2 3\n5 2 2\n","output":"Yes\n"},{"problem_id":"p03440","input":"7 5\n1 2 3 4 5 6 7\n3 0\n4 0\n1 2\n1 3\n5 6\n","output":"7\n"},{"problem_id":"p03441","input":"5\n0 1\n0 2\n0 3\n3 4\n","output":"2\n"},{"problem_id":"p03442","input":"5\n0 1 1\n0 2 3\n0 3 6\n3 4 4\n","output":"3\n"},{"problem_id":"p03443","input":"2\n010\n","output":"Yes\n1 1 2 2\n"},{"problem_id":"p03444","input":"5\n0 1 2 3\n2 4 0 1 3\n","output":"2\n3\n4\n"},{"problem_id":"p03445","input":"2 3\n1\n1 1\n","output":"20\n"},{"problem_id":"p03446","input":"1 1 1 2 2 2\n","output":"1\n"},{"problem_id":"p03447","input":"1234\n150\n100\n","output":"84\n"},{"problem_id":"p03448","input":"2\n2\n2\n100\n","output":"2\n"},{"problem_id":"p03449","input":"5\n3 2 2 4 1\n1 2 2 2 1\n","output":"14\n"},{"problem_id":"p03450","input":"3 3\n1 2 1\n2 3 1\n1 3 2\n","output":"Yes\n"},{"problem_id":"p03451","input":"5\n3 2 2 4 1\n1 2 2 2 1\n","output":"14\n"},{"problem_id":"p03452","input":"3 3\n1 2 1\n2 3 1\n1 3 2\n","output":"Yes\n"},{"problem_id":"p03453","input":"4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n","output":"2\n"},{"problem_id":"p03454","input":"1\n","output":"9\n"},{"problem_id":"p03455","input":"3 4\n","output":"Even\n"},{"problem_id":"p03456","input":"1 21\n","output":"Yes\n"},{"problem_id":"p03457","input":"2\n3 1 2\n6 1 1\n","output":"Yes\n"},{"problem_id":"p03458","input":"4 3\n0 1 W\n1 2 W\n5 3 B\n5 4 B\n","output":"4\n"},{"problem_id":"p03459","input":"2\n3 1 2\n6 1 1\n","output":"Yes\n"},{"problem_id":"p03460","input":"4 3\n0 1 W\n1 2 W\n5 3 B\n5 4 B\n","output":"4\n"},{"problem_id":"p03461","input":"2 3\n1 2 2\n1 2 3\n","output":"Possible\n3 4\n1 2 X\n2 3 1\n3 2 Y\n1 3 Y\n1 3\n"},{"problem_id":"p03462","input":"2 2\nrb\n","output":"9\n"},{"problem_id":"p03463","input":"5 2 4\n","output":"Alice\n"},{"problem_id":"p03464","input":"4\n3 4 3 2\n","output":"6 8\n"},{"problem_id":"p03465","input":"3\n1 2 1\n","output":"2\n"},{"problem_id":"p03466","input":"5\n2 3 1 5\n6 4 1 10\n2 3 4 4\n6 4 3 7\n8 10 5 8\n","output":"BABAB\nAABAABAABB\nA\nBAABA\nABAB\n"},{"problem_id":"p03467","input":"011\n","output":"9\n"},{"problem_id":"p03468","input":"2 3\n2 2\n","output":"0.3333333333333333\n"},{"problem_id":"p03469","input":"2017\/01\/07\n","output":"2018\/01\/07\n"},{"problem_id":"p03470","input":"4\n10\n8\n8\n6\n","output":"3\n"},{"problem_id":"p03471","input":"9 45000\n","output":"4 0 5\n"},{"problem_id":"p03472","input":"1 10\n3 5\n","output":"3\n"},{"problem_id":"p03473","input":"21\n","output":"27\n"},{"problem_id":"p03474","input":"3 4\n269-6650\n","output":"Yes\n"},{"problem_id":"p03475","input":"3\n6 5 1\n1 10 1\n","output":"12\n11\n0\n"},{"problem_id":"p03476","input":"1\n3 7\n","output":"2\n"},{"problem_id":"p03477","input":"3 8 7 1\n","output":"Left\n"},{"problem_id":"p03478","input":"20 2 5\n","output":"84\n"},{"problem_id":"p03479","input":"3 20\n","output":"3\n"},{"problem_id":"p03480","input":"010\n","output":"2\n"},{"problem_id":"p03481","input":"3 20\n","output":"3\n"},{"problem_id":"p03482","input":"010\n","output":"2\n"},{"problem_id":"p03483","input":"eel\n","output":"1\n"},{"problem_id":"p03484","input":"7\n1 2\n2 3\n2 4\n4 5\n4 6\n6 7\n","output":"3 2\n"},{"problem_id":"p03485","input":"1 3\n","output":"2\n"},{"problem_id":"p03486","input":"yx\naxy\n","output":"Yes\n"},{"problem_id":"p03487","input":"4\n3 3 3 3\n","output":"1\n"},{"problem_id":"p03488","input":"FTFFTFFF\n4 2\n","output":"Yes\n"},{"problem_id":"p03489","input":"4\n3 3 3 3\n","output":"1\n"},{"problem_id":"p03490","input":"FTFFTFFF\n4 2\n","output":"Yes\n"},{"problem_id":"p03491","input":"2 2\n00\n01\n","output":"Alice\n"},{"problem_id":"p03492","input":"3\n1 2\n2 3\n","output":"3\n"},{"problem_id":"p03493","input":"101\n","output":"2\n"},{"problem_id":"p03494","input":"3\n8 12 40\n","output":"2\n"},{"problem_id":"p03495","input":"5 2\n1 1 2 2 5\n","output":"1\n"},{"problem_id":"p03496","input":"3\n-2 5 -1\n","output":"2\n2 3\n3 3\n"},{"problem_id":"p03497","input":"5 2\n1 1 2 2 5\n","output":"1\n"},{"problem_id":"p03498","input":"3\n-2 5 -1\n","output":"2\n2 3\n3 3\n"},{"problem_id":"p03499","input":"2\n0 0\n","output":"8\n"},{"problem_id":"p03500","input":"2 2\n5 7\n","output":"6\n"},{"problem_id":"p03501","input":"7 17 120\n","output":"119\n"},{"problem_id":"p03502","input":"12\n","output":"Yes\n"},{"problem_id":"p03503","input":"1\n1 1 0 1 0 0 0 1 0 1\n3 4 5 6 7 8 9 -2 -3 4 -2\n","output":"8\n"},{"problem_id":"p03504","input":"3 2\n1 7 2\n7 8 1\n8 12 1\n","output":"2\n"},{"problem_id":"p03505","input":"4000 2000 500\n","output":"5\n"},{"problem_id":"p03506","input":"3 3\n5 7\n8 11\n3 9\n","output":"2\n1\n3\n"},{"problem_id":"p03507","input":"2 6\n20 10\n25 15\n","output":"50\n"},{"problem_id":"p03508","input":"4 1\n1 3\n","output":"2\n"},{"problem_id":"p03509","input":"4 75\n1 1\n1 1\n1 1\n1 1\n","output":"3\n"},{"problem_id":"p03510","input":"5\n10 20\n40 50\n60 30\n70 40\n90 10\n","output":"90\n"},{"problem_id":"p03511","input":"6\nat\ncode\n","output":"atatat\n"},{"problem_id":"p03512","input":"3\n2 10\n3 -20\n6 15\n","output":"10\n"},{"problem_id":"p03513","input":"4 3\n1 3\n2 3\n3 4\n","output":"6\n"},{"problem_id":"p03514","input":"1\n150000\n108\n","output":"150000.0\n"},{"problem_id":"p03515","input":"3\n1 2 10\n2 3 20\n","output":"20\n30\n30\n"},{"problem_id":"p03516","input":"5\n1 2 2 3 2\n","output":"6\n"},{"problem_id":"p03517","input":"4 3 3\n1 0 1 2\n1 2 10\n2 3 20\n2 4 50\n","output":"60\n"},{"problem_id":"p03518","input":"5\n4 2 0 1 3\n","output":"4\n2\n3\n1\n2\n"},{"problem_id":"p03519","input":"2 2\n1 1 7 3\n4 2 3 3\n2 4 6\n3 2 5\n","output":"15\n15\n"},{"problem_id":"p03520","input":"4\n1 2\n2 3\n3 4\n8 6 6 8\n","output":"1\n2\n1\n"},{"problem_id":"p03521","input":"4\n1\n2\n3\n","output":"2\n"},{"problem_id":"p03522","input":"5\n4\n1\n8\n8\n7\n","output":"2\n"},{"problem_id":"p03523","input":"KIHBR\n","output":"YES\n"},{"problem_id":"p03524","input":"abac\n","output":"YES\n"},{"problem_id":"p03525","input":"3\n7 12 8\n","output":"4\n"},{"problem_id":"p03526","input":"3\n0 2\n1 3\n3 4\n","output":"2\n"},{"problem_id":"p03527","input":"bixzja\n2\n2 3\n3 6\n","output":"YES\n"},{"problem_id":"p03529","input":"2 2\n","output":"10\n"},{"problem_id":"p03530","input":"3 3\n+#+\n#P#\n+#+\n","output":"2\n"},{"problem_id":"p03531","input":"3\n0 3 0 6 0 0 0 8\n","output":"YES\n3 4 8 6 2 1 7 5\n"},{"problem_id":"p03532","input":"4\n1 3 5 1\n1 2 1\n2 3 2\n3 4 3\n","output":"22\n"},{"problem_id":"p03533","input":"KIHBR\n","output":"YES\n"},{"problem_id":"p03534","input":"abac\n","output":"YES\n"},{"problem_id":"p03535","input":"3\n7 12 8\n","output":"4\n"},{"problem_id":"p03536","input":"3\n0 2\n1 3\n3 4\n","output":"2\n"},{"problem_id":"p03537","input":"bixzja\n2\n2 3\n3 6\n","output":"YES\n"},{"problem_id":"p03539","input":"2 2\n","output":"10\n"},{"problem_id":"p03540","input":"3 3\n+#+\n#P#\n+#+\n","output":"2\n"},{"problem_id":"p03541","input":"3\n0 3 0 6 0 0 0 8\n","output":"YES\n3 4 8 6 2 1 7 5\n"},{"problem_id":"p03542","input":"4\n1 3 5 1\n1 2 1\n2 3 2\n3 4 3\n","output":"22\n"},{"problem_id":"p03543","input":"1118\n","output":"Yes\n"},{"problem_id":"p03544","input":"5\n","output":"11\n"},{"problem_id":"p03545","input":"1222\n","output":"1+2+2+2=7\n"},{"problem_id":"p03546","input":"2 4\n0 9 9 9 9 9 9 9 9 9\n9 0 9 9 9 9 9 9 9 9\n9 9 0 9 9 9 9 9 9 9\n9 9 9 0 9 9 9 9 9 9\n9 9 9 9 0 9 9 9 9 2\n9 9 9 9 9 0 9 9 9 9\n9 9 9 9 9 9 0 9 9 9\n9 9 9 9 9 9 9 0 9 9\n9 9 9 9 2 9 9 9 0 9\n9 2 9 9 9 9 9 9 9 0\n-1 -1 -1 -1\n8 1 1 8\n","output":"12\n"},{"problem_id":"p03547","input":"A B\n","output":"<\n"},{"problem_id":"p03548","input":"13 3 1\n","output":"3\n"},{"problem_id":"p03549","input":"1 1\n","output":"3800\n"},{"problem_id":"p03550","input":"3 100 100\n10 1000 100\n","output":"900\n"},{"problem_id":"p03551","input":"1 1\n","output":"3800\n"},{"problem_id":"p03552","input":"3 100 100\n10 1000 100\n","output":"900\n"},{"problem_id":"p03553","input":"6\n1 2 -6 4 5 3\n","output":"12\n"},{"problem_id":"p03554","input":"3\n1 0 1\n1\n1 3\n","output":"1\n"},{"problem_id":"p03555","input":"pot\ntop\n","output":"YES\n"},{"problem_id":"p03556","input":"10\n","output":"9\n"},{"problem_id":"p03557","input":"2\n1 5\n2 4\n3 6\n","output":"3\n"},{"problem_id":"p03558","input":"6\n","output":"3\n"},{"problem_id":"p03559","input":"2\n1 5\n2 4\n3 6\n","output":"3\n"},{"problem_id":"p03560","input":"6\n","output":"3\n"},{"problem_id":"p03561","input":"3 2\n","output":"2 1\n"},{"problem_id":"p03562","input":"3 111\n1111\n10111\n10010\n","output":"4\n"},{"problem_id":"p03563","input":"2002\n2017\n","output":"2032\n"},{"problem_id":"p03564","input":"4\n3\n","output":"10\n"},{"problem_id":"p03565","input":"?tc????\ncoder\n","output":"atcoder\n"},{"problem_id":"p03566","input":"1\n100\n30\n","output":"2100.000000000000000\n"},{"problem_id":"p03567","input":"BACD\n","output":"Yes\n"},{"problem_id":"p03568","input":"2\n2 3\n","output":"7\n"},{"problem_id":"p03569","input":"xabxa\n","output":"2\n"},{"problem_id":"p03570","input":"aabxyyzz\n","output":"2\n"},{"problem_id":"p03571","input":"3 4 5 1\n","output":"54\n"},{"problem_id":"p03572","input":"3\n1 2 3\n2 3 1\n","output":"2\n"},{"problem_id":"p03573","input":"5 7 5\n","output":"7\n"},{"problem_id":"p03574","input":"3 5\n.....\n.#.#.\n.....\n","output":"11211\n1#2#1\n11211\n"},{"problem_id":"p03575","input":"7 7\n1 3\n2 7\n3 4\n4 5\n4 6\n5 6\n6 7\n","output":"4\n"},{"problem_id":"p03576","input":"4 4\n1 4\n3 3\n6 2\n8 1\n","output":"21\n"},{"problem_id":"p03577","input":"CODEFESTIVAL\n","output":"CODE\n"},{"problem_id":"p03578","input":"5\n3 1 4 1 5\n3\n5 4 3\n","output":"YES\n"},{"problem_id":"p03579","input":"6 5\n1 2\n2 3\n3 4\n4 5\n5 6\n","output":"4\n"},{"problem_id":"p03580","input":"7\n1010101\n","output":"2\n"},{"problem_id":"p03581","input":"3 3\n","output":"20\n"},{"problem_id":"p03582","input":"2 2 0\n","output":"abab\n"},{"problem_id":"p03583","input":"2\n","output":"1 2 2\n"},{"problem_id":"p03584","input":"3 5\n3 3\n4 4\n2 5\n","output":"8\n"},{"problem_id":"p03585","input":"3\n1 1 1\n2 -1 2\n-1 2 2\n","output":"1.000000000000000 1.000000000000000\n"},{"problem_id":"p03586","input":"4\n2 4\n3 8\n9 6\n10 7\n","output":"4\n11\n9\n2\n"},{"problem_id":"p03587","input":"111100\n","output":"4\n"},{"problem_id":"p03588","input":"3\n4 7\n2 9\n6 2\n","output":"8\n"},{"problem_id":"p03589","input":"2\n","output":"1 2 2\n"},{"problem_id":"p03590","input":"3 5\n3 3\n4 4\n2 5\n","output":"8\n"},{"problem_id":"p03591","input":"YAKINIKU\n","output":"Yes\n"},{"problem_id":"p03592","input":"2 2 2\n","output":"Yes\n"},{"problem_id":"p03593","input":"3 4\naabb\naabb\naacc\n","output":"Yes\n"},{"problem_id":"p03594","input":"2 2 1\n","output":"RY\nGR\n"},{"problem_id":"p03595","input":"2 2\n10\n01\n10\n01\n","output":"6\n"},{"problem_id":"p03596","input":"2\n3 3\n","output":"2\n"},{"problem_id":"p03597","input":"3\n4\n","output":"5\n"},{"problem_id":"p03598","input":"1\n10\n2\n","output":"4\n"},{"problem_id":"p03599","input":"1 2 10 20 15 200\n","output":"110 10\n"},{"problem_id":"p03600","input":"3\n0 1 3\n1 0 2\n3 2 0\n","output":"3\n"},{"problem_id":"p03601","input":"1 2 10 20 15 200\n","output":"110 10\n"},{"problem_id":"p03602","input":"3\n0 1 3\n1 0 2\n3 2 0\n","output":"3\n"},{"problem_id":"p03603","input":"3\n1 1\n4 3 2\n","output":"POSSIBLE\n"},{"problem_id":"p03604","input":"2\n1 1\n1 2\n2 1\n2 2\n","output":"8\n"},{"problem_id":"p03605","input":"29\n","output":"Yes\n"},{"problem_id":"p03606","input":"1\n24 30\n","output":"7\n"},{"problem_id":"p03607","input":"3\n6\n2\n6\n","output":"1\n"},{"problem_id":"p03608","input":"3 3 3\n1 2 3\n1 2 1\n2 3 1\n3 1 4\n","output":"2\n"},{"problem_id":"p03609","input":"100 17\n","output":"83\n"},{"problem_id":"p03610","input":"atcoder\n","output":"acdr\n"},{"problem_id":"p03611","input":"7\n3 1 4 1 5 9 2\n","output":"4\n"},{"problem_id":"p03612","input":"5\n1 4 3 5 2\n","output":"2\n"},{"problem_id":"p03613","input":"7\n3 1 4 1 5 9 2\n","output":"4\n"},{"problem_id":"p03614","input":"5\n1 4 3 5 2\n","output":"2\n"},{"problem_id":"p03615","input":"4\n0 0\n0 1\n1 0\n1 1\n","output":"5\n"},{"problem_id":"p03616","input":"180\n3\n60 120 180\n3\n30 90\n61 1\n180 180\n","output":"60\n1\n120\n"},{"problem_id":"p03617","input":"20 30 70 90\n3\n","output":"150\n"},{"problem_id":"p03618","input":"aatt\n","output":"5\n"},{"problem_id":"p03619","input":"1 1 6 5\n3\n3 2\n5 3\n2 4\n","output":"891.415926535897938\n"},{"problem_id":"p03620","input":"1010\n1100\n","output":"3\n"},{"problem_id":"p03621","input":"1010\n1100\n","output":"3\n"},{"problem_id":"p03622","input":"1 1\n","output":"499122178\n"},{"problem_id":"p03623","input":"5 2 7\n","output":"B\n"},{"problem_id":"p03624","input":"atcoderregularcontest\n","output":"b\n"},{"problem_id":"p03625","input":"6\n3 1 2 4 2 1\n","output":"2\n"},{"problem_id":"p03626","input":"3\naab\nccb\n","output":"6\n"},{"problem_id":"p03627","input":"6\n3 1 2 4 2 1\n","output":"2\n"},{"problem_id":"p03628","input":"3\naab\nccb\n","output":"6\n"},{"problem_id":"p03629","input":"atcoderregularcontest\n","output":"b\n"},{"problem_id":"p03630","input":"3 3\n..#\n##.\n.#.\n","output":"6\n"},{"problem_id":"p03631","input":"575\n","output":"Yes\n"},{"problem_id":"p03632","input":"0 75 25 100\n","output":"50\n"},{"problem_id":"p03633","input":"2\n2\n3\n","output":"6\n"},{"problem_id":"p03634","input":"5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5\n","output":"3\n2\n4\n"},{"problem_id":"p03635","input":"3 4\n","output":"6\n"},{"problem_id":"p03636","input":"internationalization\n","output":"i18n\n"},{"problem_id":"p03637","input":"3\n1 10 100\n","output":"Yes\n"},{"problem_id":"p03638","input":"2 2\n3\n2 1 1\n","output":"1 1\n2 3\n"},{"problem_id":"p03639","input":"3\n1 10 100\n","output":"Yes\n"},{"problem_id":"p03640","input":"2 2\n3\n2 1 1\n","output":"1 1\n2 3\n"},{"problem_id":"p03641","input":"4\n3 2 4 1\n","output":"3 1 2 4\n"},{"problem_id":"p03642","input":"2\n4 5\n","output":"2\n"},{"problem_id":"p03643","input":"100\n","output":"ABC100\n"},{"problem_id":"p03644","input":"7\n","output":"4\n"},{"problem_id":"p03645","input":"3 2\n1 2\n2 3\n","output":"POSSIBLE\n"},{"problem_id":"p03646","input":"0\n","output":"4\n3 3 3 3\n"},{"problem_id":"p03647","input":"3 2\n1 2\n2 3\n","output":"POSSIBLE\n"},{"problem_id":"p03648","input":"0\n","output":"4\n3 3 3 3\n"},{"problem_id":"p03649","input":"4\n3 3 3 3\n","output":"0\n"},{"problem_id":"p03650","input":"4\n2 3 4 1\n","output":"POSSIBLE\n"},{"problem_id":"p03651","input":"3 7\n9 3 4\n","output":"POSSIBLE\n"},{"problem_id":"p03652","input":"4 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 4 5\n2 5 4 3 1\n","output":"2\n"},{"problem_id":"p03653","input":"1 2 1\n2 4 4\n3 2 1\n7 6 7\n5 2 3\n","output":"18\n"},{"problem_id":"p03654","input":"5\n1 2 5\n3 4 7\n2 3 3\n2 5 2\n","output":"38\n"},{"problem_id":"p03655","input":"1 1 2 2 3 4\n1 1 2 2 3 3\n","output":"10\n"},{"problem_id":"p03656","input":"5\n3 3 4 -1 4\n4 4 1 -1 1\n","output":"POSSIBLE\n1 -1 -1 3 -1\n"},{"problem_id":"p03657","input":"4 5\n","output":"Possible\n"},{"problem_id":"p03658","input":"5 3\n1 2 3 4 5\n","output":"12\n"},{"problem_id":"p03659","input":"6\n1 2 3 4 5 6\n","output":"1\n"},{"problem_id":"p03660","input":"7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n","output":"Fennec\n"},{"problem_id":"p03661","input":"6\n1 2 3 4 5 6\n","output":"1\n"},{"problem_id":"p03662","input":"7\n3 6\n1 2\n3 1\n7 4\n5 7\n1 4\n","output":"Fennec\n"},{"problem_id":"p03664","input":"4 6\n1 2 100\n3 1 100\n2 4 100\n4 3 100\n1 4 100\n3 2 100\n","output":"200\n"},{"problem_id":"p03665","input":"2 0\n1 3\n","output":"2\n"},{"problem_id":"p03666","input":"5 1 5 2 4\n","output":"YES\n"},{"problem_id":"p03667","input":"5 3\n1 1 3 4 5\n1 2\n2 5\n5 4\n","output":"0\n1\n1\n"},{"problem_id":"p03668","input":"5\n1 2\n2 3\n2 4\n4 5\n","output":"Alice\n"},{"problem_id":"p03669","input":"3 4\n1 1 0 0\n2 2 0 1\n3 3 1 0\n","output":"YES\n"},{"problem_id":"p03670","input":"3 2 1\n1 2 0\n","output":"6\n"},{"problem_id":"p03671","input":"700 600 780\n","output":"1300\n"},{"problem_id":"p03672","input":"abaababaab\n","output":"6\n"},{"problem_id":"p03673","input":"4\n1 2 3 4\n","output":"4 2 1 3\n"},{"problem_id":"p03674","input":"3\n1 2 1 3\n","output":"3\n5\n4\n1\n"},{"problem_id":"p03675","input":"4\n1 2 3 4\n","output":"4 2 1 3\n"},{"problem_id":"p03676","input":"3\n1 2 1 3\n","output":"3\n5\n4\n1\n"},{"problem_id":"p03677","input":"4 6\n1 5 1 4\n","output":"5\n"},{"problem_id":"p03678","input":"abaaba\n6 10\n","output":"3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"},{"problem_id":"p03679","input":"4 3 6\n","output":"safe\n"},{"problem_id":"p03680","input":"3\n3\n1\n2\n","output":"2\n"},{"problem_id":"p03681","input":"2 2\n","output":"8\n"},{"problem_id":"p03682","input":"3\n1 5\n3 9\n7 8\n","output":"3\n"},{"problem_id":"p03683","input":"2 2\n","output":"8\n"},{"problem_id":"p03684","input":"3\n1 5\n3 9\n7 8\n","output":"3\n"},{"problem_id":"p03685","input":"4 2 3\n0 1 3 1\n1 1 4 1\n2 0 2 2\n","output":"YES\n"},{"problem_id":"p03686","input":"4 4\n0 3\n2 3\n1 3\n3 4\n","output":"0\n"},{"problem_id":"p03687","input":"serval\n","output":"3\n"},{"problem_id":"p03688","input":"3\n1 2 2\n","output":"Yes\n"},{"problem_id":"p03689","input":"3 3 2 2\n","output":"Yes\n1 1 1\n1 -4 1\n1 1 1\n"},{"problem_id":"p03690","input":"3\n0 1 2\n3 1 0\n","output":"2\n"},{"problem_id":"p03691","input":"3 1\n1 2\n","output":"2\n"},{"problem_id":"p03692","input":"2 1\n1 2\n","output":"1\n"},{"problem_id":"p03693","input":"4 3 2\n","output":"YES\n"},{"problem_id":"p03694","input":"4\n2 3 7 9\n","output":"7\n"},{"problem_id":"p03695","input":"4\n2100 2500 2700 2700\n","output":"2 2\n"},{"problem_id":"p03696","input":"3\n())\n","output":"(())\n"},{"problem_id":"p03697","input":"6 3\n","output":"9\n"},{"problem_id":"p03698","input":"uncopyrightable\n","output":"yes\n"},{"problem_id":"p03699","input":"3\n5\n10\n15\n","output":"25\n"},{"problem_id":"p03700","input":"4 5 3\n8\n7\n4\n2\n","output":"2\n"},{"problem_id":"p03701","input":"3\n5\n10\n15\n","output":"25\n"},{"problem_id":"p03702","input":"4 5 3\n8\n7\n4\n2\n","output":"2\n"},{"problem_id":"p03703","input":"3 6\n7\n5\n7\n","output":"5\n"},{"problem_id":"p03704","input":"63\n","output":"2\n"},{"problem_id":"p03705","input":"4 4 6\n","output":"5\n"},{"problem_id":"p03706","input":"UUD\n","output":"7\n"},{"problem_id":"p03707","input":"3 4 4\n1101\n0110\n1101\n1 1 3 4\n1 1 3 1\n2 2 3 4\n1 2 2 4\n","output":"3\n2\n2\n2\n"},{"problem_id":"p03708","input":"7\n9\n","output":"4\n"},{"problem_id":"p03709","input":"3\n2 5\n6 1\n3 7\n","output":"6\n"},{"problem_id":"p03710","input":"3\n4 4\n6 10\n12 11\n","output":"2 4\n4 1\n4 7\n"},{"problem_id":"p03711","input":"1 3\n","output":"Yes\n"},{"problem_id":"p03712","input":"2 3\nabc\narc\n","output":"#####\n#abc#\n#arc#\n#####\n"},{"problem_id":"p03713","input":"3 5\n","output":"0\n"},{"problem_id":"p03714","input":"2\n3 1 4 1 5 9\n","output":"1\n"},{"problem_id":"p03715","input":"3 5\n","output":"0\n"},{"problem_id":"p03716","input":"2\n3 1 4 1 5 9\n","output":"1\n"},{"problem_id":"p03717","input":"3 1\n1 3 3\n","output":"6\n"},{"problem_id":"p03718","input":"3 3\nS.o\n.o.\no.T\n","output":"2\n"},{"problem_id":"p03719","input":"1 3 2\n","output":"Yes\n"},{"problem_id":"p03720","input":"4 3\n1 2\n2 3\n1 4\n","output":"2\n2\n1\n1\n"},{"problem_id":"p03721","input":"3 4\n1 1\n2 2\n3 3\n","output":"3\n"},{"problem_id":"p03722","input":"3 3\n1 2 4\n2 3 3\n1 3 5\n","output":"7\n"},{"problem_id":"p03723","input":"4 12 20\n","output":"3\n"},{"problem_id":"p03724","input":"4 4\n1 2\n2 4\n1 3\n3 4\n","output":"YES\n"},{"problem_id":"p03725","input":"3 3 3\n#.#\n#S.\n###\n","output":"1\n"},{"problem_id":"p03726","input":"3\n1 2\n2 3\n","output":"First\n"},{"problem_id":"p03727","input":"3\n1 2\n2 3\n1 3\n3 2\n","output":"YES\n"},{"problem_id":"p03728","input":"5\n3 5 1 2 4\n","output":"3\n"},{"problem_id":"p03729","input":"rng gorilla apple\n","output":"YES\n"},{"problem_id":"p03730","input":"7 5 1\n","output":"YES\n"},{"problem_id":"p03731","input":"2 4\n0 3\n","output":"7\n"},{"problem_id":"p03732","input":"4 6\n2 1\n3 4\n4 10\n3 4\n","output":"11\n"},{"problem_id":"p03733","input":"2 4\n0 3\n","output":"7\n"},{"problem_id":"p03734","input":"4 6\n2 1\n3 4\n4 10\n3 4\n","output":"11\n"},{"problem_id":"p03735","input":"3\n1 2\n3 4\n5 6\n","output":"15\n"},{"problem_id":"p03736","input":"8 3 1 8\n3 5 1\n","output":"7\n"},{"problem_id":"p03737","input":"atcoder beginner contest\n","output":"ABC\n"},{"problem_id":"p03738","input":"36\n24\n","output":"GREATER\n"},{"problem_id":"p03739","input":"4\n1 -3 1 0\n","output":"4\n"},{"problem_id":"p03740","input":"2 1\n","output":"Brown\n"},{"problem_id":"p03741","input":"4\n1 -3 1 0\n","output":"4\n"},{"problem_id":"p03742","input":"2 1\n","output":"Brown\n"},{"problem_id":"p03743","input":"4 10\n3 4 3 3\n2\n4 3\n","output":"NO\nYES\n"},{"problem_id":"p03744","input":"3 10\n10 10\n20 5\n4 3\n","output":"10.0000000\n15.0000000\n13.2000000\n"},{"problem_id":"p03745","input":"6\n1 2 3 2 2 1\n","output":"2\n"},{"problem_id":"p03746","input":"5 6\n1 3\n1 4\n2 3\n1 5\n3 5\n2 4\n","output":"4\n2 3 1 4\n"},{"problem_id":"p03747","input":"3 8 3\n0 1\n3 2\n6 1\n","output":"1\n3\n0\n"},{"problem_id":"p03748","input":"2 3\n","output":"56\n"},{"problem_id":"p03749","input":"3 1\n2\n","output":"13\n"},{"problem_id":"p03750","input":"3\n4 1\n5 3\n3 1\n1 2 3 4\n3\n5 4\n4 3\n2 3\n","output":"0\n1\n2\n"},{"problem_id":"p03751","input":"2\ntourist\npetr\ne\n","output":"1\n"},{"problem_id":"p03752","input":"5 5\n3949 3774 3598 3469 3424\n","output":"1541\n"},{"problem_id":"p03753","input":"7 7 3\n1 3 5\n","output":"4\n"},{"problem_id":"p03754","input":"4\n1 2\n2 3\n2 4\n","output":"2.0\n1.0\n2.0\n2.0\n"},{"problem_id":"p03755","input":"7 2 3\n0 7\n","output":"55\n"},{"problem_id":"p03756","input":"4 4 2 2\n1 1 2 2\n1 1 E 1 1\n1 2 E 2 2\n","output":"4\n"},{"problem_id":"p03757","input":"6 7\n-1 6\n0 5\n0 4\n2 3\n2 2\n1 1\n2 0 1\n1 0 2 1\n2 2 1\n3 3 3\n2 0 3\n3 3 4\n2 1 1\n","output":"15\n12\n30\n8\n"},{"problem_id":"p03759","input":"2 4 6\n","output":"YES\n"},{"problem_id":"p03760","input":"xyz\nabc\n","output":"xaybzc\n"},{"problem_id":"p03761","input":"3\ncbaa\ndaacc\nacacac\n","output":"aac\n"},{"problem_id":"p03762","input":"3 3\n1 3 4\n1 3 6\n","output":"60\n"},{"problem_id":"p03763","input":"3\ncbaa\ndaacc\nacacac\n","output":"aac\n"},{"problem_id":"p03764","input":"3 3\n1 3 4\n1 3 6\n","output":"60\n"},{"problem_id":"p03765","input":"BBBAAAABA\nBBBBA\n4\n7 9 2 5\n7 9 1 4\n1 7 2 5\n1 7 2 4\n","output":"YES\nNO\nYES\nNO\n"},{"problem_id":"p03766","input":"2\n","output":"4\n"},{"problem_id":"p03767","input":"2\n5 2 8 5 1 5\n","output":"10\n"},{"problem_id":"p03768","input":"7 7\n1 2\n1 3\n1 4\n4 5\n5 6\n5 7\n2 3\n2\n6 1 1\n1 2 2\n","output":"2\n2\n2\n2\n2\n1\n0\n"},{"problem_id":"p03769","input":"7\n","output":"4\n1 1 1 1\n"},{"problem_id":"p03770","input":"4 7 3\n3 2\n4 3\n2 1\n4 4\n","output":"2\n"},{"problem_id":"p03771","input":"3 2\n1 3 6\n","output":"Possible\nPossible\nPossible\n"},{"problem_id":"p03772","input":"2\n1 3 2\n","output":"3\n"},{"problem_id":"p03773","input":"9 12\n","output":"21\n"},{"problem_id":"p03774","input":"2 2\n2 0\n0 0\n-1 0\n1 0\n","output":"2\n1\n"},{"problem_id":"p03775","input":"10000\n","output":"3\n"},{"problem_id":"p03776","input":"5 2 2\n1 2 3 4 5\n","output":"4.500000\n1\n"},{"problem_id":"p03777","input":"H H\n","output":"H\n"},{"problem_id":"p03778","input":"3 2 6\n","output":"1\n"},{"problem_id":"p03779","input":"6\n","output":"3\n"},{"problem_id":"p03780","input":"3 6\n1 4 3\n","output":"1\n"},{"problem_id":"p03781","input":"6\n","output":"3\n"},{"problem_id":"p03782","input":"3 6\n1 4 3\n","output":"1\n"},{"problem_id":"p03783","input":"3\n1 3\n5 7\n1 3\n","output":"2\n"},{"problem_id":"p03785","input":"5 3 5\n1\n2\n3\n6\n12\n","output":"3\n"},{"problem_id":"p03786","input":"3\n3 1 4\n","output":"2\n"},{"problem_id":"p03787","input":"3 1\n1 2\n","output":"7\n"},{"problem_id":"p03788","input":"5 1\nABAAA\n","output":"BBAAA\n"},{"problem_id":"p03789","input":"80\n","output":"2\n"},{"problem_id":"p03790","input":"3 10\n4 1\n3 1\n4 1\n","output":"26\n"},{"problem_id":"p03791","input":"3\n1 2 3\n","output":"4\n"},{"problem_id":"p03792","input":"2\n#.\n.#\n","output":"3\n"},{"problem_id":"p03793","input":"axxxxza\n2\n1 7\n2 6\n","output":"No\nYes\n"},{"problem_id":"p03794","input":"4\n1 2\n1 3\n1 4\n","output":"2\n"},{"problem_id":"p03795","input":"20\n","output":"15800\n"},{"problem_id":"p03796","input":"3\n","output":"6\n"},{"problem_id":"p03797","input":"1 6\n","output":"2\n"},{"problem_id":"p03798","input":"6\nooxoox\n","output":"SSSWWS\n"},{"problem_id":"p03799","input":"1 6\n","output":"2\n"},{"problem_id":"p03800","input":"6\nooxoox\n","output":"SSSWWS\n"},{"problem_id":"p03801","input":"2\n1 2\n","output":"2\n1\n"},{"problem_id":"p03802","input":"3\n1 3\n2 5\n1 9\n","output":"4\n"},{"problem_id":"p03803","input":"8 6\n","output":"Alice\n"},{"problem_id":"p03804","input":"3 2\n#.#\n.#.\n#.#\n#.\n.#\n","output":"Yes\n"},{"problem_id":"p03805","input":"3 3\n1 2\n1 3\n2 3\n","output":"2\n"},{"problem_id":"p03806","input":"3 1 1\n1 2 1\n2 1 2\n3 3 10\n","output":"3\n"},{"problem_id":"p03807","input":"3\n1 2 3\n","output":"YES\n"},{"problem_id":"p03808","input":"5\n4 5 1 2 3\n","output":"YES\n"},{"problem_id":"p03809","input":"5\n1 2 1 1 2\n2 4\n5 2\n3 2\n1 3\n","output":"YES\n"},{"problem_id":"p03810","input":"3\n3 6 7\n","output":"First\n"},{"problem_id":"p03811","input":"5\n1 2 3 4 5\n","output":"5 3 2 4 1\n"},{"problem_id":"p03812","input":"3\n1 2 3\n1 2\n2 3\n","output":"2\n"},{"problem_id":"p03813","input":"1000\n","output":"ABC\n"},{"problem_id":"p03814","input":"QWERTYASDFZXCV\n","output":"5\n"},{"problem_id":"p03815","input":"7\n","output":"2\n"},{"problem_id":"p03816","input":"5\n1 2 1 3 7\n","output":"3\n"},{"problem_id":"p03817","input":"7\n","output":"2\n"},{"problem_id":"p03818","input":"5\n1 2 1 3 7\n","output":"3\n"},{"problem_id":"p03819","input":"3 3\n1 2\n2 3\n3 3\n","output":"3\n2\n2\n"},{"problem_id":"p03820","input":"2 1\n","output":"1\n"},{"problem_id":"p03821","input":"3\n3 5\n2 7\n9 4\n","output":"7\n"},{"problem_id":"p03822","input":"5\n1\n1\n2\n4\n","output":"3\n"},{"problem_id":"p03823","input":"5 3 7\n1\n3\n6\n9\n12\n","output":"5\n"},{"problem_id":"p03824","input":"7\n1 2\n2 3\n2 4\n4 6\n6 7\n7 5\n","output":"2\n"},{"problem_id":"p03825","input":"2 2 2\n","output":"5\n"},{"problem_id":"p03826","input":"3 5 2 7\n","output":"15\n"},{"problem_id":"p03827","input":"5\nIIDID\n","output":"2\n"},{"problem_id":"p03828","input":"3\n","output":"4\n"},{"problem_id":"p03829","input":"4 2 5\n1 2 5 7\n","output":"11\n"},{"problem_id":"p03830","input":"3\n","output":"4\n"},{"problem_id":"p03831","input":"4 2 5\n1 2 5 7\n","output":"11\n"},{"problem_id":"p03832","input":"3 1 3 1 2\n","output":"4\n"},{"problem_id":"p03833","input":"3 4\n1 4\n2 2 5 1\n1 3 3 2\n2 2 5 1\n","output":"11\n"},{"problem_id":"p03834","input":"happy,newyear,enjoy\n","output":"happy newyear enjoy\n"},{"problem_id":"p03835","input":"2 2\n","output":"6\n"},{"problem_id":"p03836","input":"0 0 1 2\n","output":"UURDDLLUUURRDRDDDLLU\n"},{"problem_id":"p03837","input":"3 3\n1 2 1\n1 3 1\n2 3 3\n","output":"1\n"},{"problem_id":"p03838","input":"10 20\n","output":"10\n"},{"problem_id":"p03839","input":"5 3\n-10 10 -10 10 -10\n","output":"10\n"},{"problem_id":"p03840","input":"2 1 1 0 0 0 0\n","output":"3\n"},{"problem_id":"p03841","input":"3\n1 5 9\n","output":"Yes\n1 1 1 2 2 2 3 3 3\n"},{"problem_id":"p03842","input":"3\n1 2 3\n","output":"4\n"},{"problem_id":"p03843","input":"4\n1 2\n1 3\n1 4\n1100\n","output":"4\n"},{"problem_id":"p03844","input":"1 + 2\n","output":"3\n"},{"problem_id":"p03845","input":"3\n2 1 4\n2\n1 1\n2 3\n","output":"6\n9\n"},{"problem_id":"p03846","input":"5\n2 4 4 0 2\n","output":"4\n"},{"problem_id":"p03847","input":"3\n","output":"5\n"},{"problem_id":"p03848","input":"5\n2 4 4 0 2\n","output":"4\n"},{"problem_id":"p03849","input":"3\n","output":"5\n"},{"problem_id":"p03850","input":"3\n5 - 1 - 3\n","output":"7\n"},{"problem_id":"p03851","input":"5\n1 1 4 1 1\n2\n3 2\n3 10\n","output":"9\n2\n"},{"problem_id":"p03852","input":"a\n","output":"vowel\n"},{"problem_id":"p03853","input":"2 2\n*.\n.*\n","output":"*.\n*.\n.*\n.*\n"},{"problem_id":"p03854","input":"erasedream\n","output":"YES\n"},{"problem_id":"p03855","input":"4 3 1\n1 2\n2 3\n3 4\n2 3\n","output":"1 2 2 1\n"},{"problem_id":"p03856","input":"erasedream\n","output":"YES\n"},{"problem_id":"p03857","input":"4 3 1\n1 2\n2 3\n3 4\n2 3\n","output":"1 2 2 1\n"},{"problem_id":"p03858","input":"5 1 2\n1 1\n4 3\n6 1\n5 5\n4 8\n","output":"4\n"},{"problem_id":"p03859","input":"5 2\n01001\n2 4\n3 5\n","output":"6\n"},{"problem_id":"p03860","input":"AtCoder Beginner Contest\n","output":"ABC\n"},{"problem_id":"p03861","input":"4 8 2\n","output":"3\n"},{"problem_id":"p03862","input":"3 3\n2 2 2\n","output":"1\n"},{"problem_id":"p03863","input":"aba\n","output":"Second\n"},{"problem_id":"p03864","input":"3 3\n2 2 2\n","output":"1\n"},{"problem_id":"p03865","input":"aba\n","output":"Second\n"},{"problem_id":"p03866","input":"-2 -2 2 2\n1\n0 0 1\n","output":"3.6568542495\n"},{"problem_id":"p03867","input":"4 2\n","output":"6\n"},{"problem_id":"p03868","input":"2\n0\n10\n20\n30\n","output":"2\n"},{"problem_id":"p03869","input":"0 0\n1 1\n2 0\n","output":"0.292893218813\n"},{"problem_id":"p03870","input":"3\n2\n3\n4\n","output":"3\n"},{"problem_id":"p03871","input":"25 25 25 25 0 0\n0 0 0 0 50 50\n","output":"1.000000000000\n"},{"problem_id":"p03872","input":"3\n0 0 10\n2 0 5\n0 5 8\n","output":"6.500000000000\n"},{"problem_id":"p03873","input":"4\n2 7\n2 5\n4 1\n7 5\n","output":"22\n"},{"problem_id":"p03874","input":"7\n","output":"FESSSSSSSTIVAL\n"},{"problem_id":"p03875","input":"2\n0 1\n1 0\n","output":"6\n"},{"problem_id":"p03876","input":"8\n90\n90\n270\n90\n90\n90\n270\n90\n","output":"0 0\n2 0\n2 1\n3 1\n3 2\n1 2\n1 1\n0 1\n"},{"problem_id":"p03877","input":"3 1 2 0\n","output":"2\n"},{"problem_id":"p03878","input":"2\n0\n10\n20\n30\n","output":"2\n"},{"problem_id":"p03879","input":"0 0\n1 1\n2 0\n","output":"0.292893218813\n"},{"problem_id":"p03880","input":"3\n2\n3\n4\n","output":"3\n"},{"problem_id":"p03881","input":"25 25 25 25 0 0\n0 0 0 0 50 50\n","output":"1.000000000000\n"},{"problem_id":"p03882","input":"3\n0 0 10\n2 0 5\n0 5 8\n","output":"6.500000000000\n"},{"problem_id":"p03883","input":"4\n2 7\n2 5\n4 1\n7 5\n","output":"22\n"},{"problem_id":"p03884","input":"7\n","output":"FESSSSSSSTIVAL\n"},{"problem_id":"p03885","input":"2\n0 1\n1 0\n","output":"6\n"},{"problem_id":"p03886","input":"8\n90\n90\n270\n90\n90\n90\n270\n90\n","output":"0 0\n2 0\n2 1\n3 1\n3 2\n1 2\n1 1\n0 1\n"},{"problem_id":"p03887","input":"3 1 2 0\n","output":"2\n"},{"problem_id":"p03888","input":"2 3\n","output":"1.2000000000\n"},{"problem_id":"p03889","input":"pdbq\n","output":"Yes\n"},{"problem_id":"p03890","input":"2\n1\n3\n10\n19\n","output":"7\n"},{"problem_id":"p03891","input":"8\n3\n5\n","output":"8 3 4\n1 5 9\n6 7 2\n"},{"problem_id":"p03892","input":"1 1 3 4\n","output":"4\n"},{"problem_id":"p03893","input":"2\n","output":"14\n"},{"problem_id":"p03894","input":"10 3\n1 3\n2 4\n4 5\n","output":"4\n"},{"problem_id":"p03895","input":"3\n28800 57600\n28800 57600\n57600 28800\n","output":"2\n"},{"problem_id":"p03896","input":"7\n","output":"2 3 4 5 6 7\n5 3 1 6 4 7\n2 7 4 1 5 6\n2 1 7 5 3 6\n1 4 3 7 6 2\n2 5 7 3 4 1\n2 6 1 4 5 3\n"},{"problem_id":"p03897","input":"2\n","output":"1\n1 0\n"},{"problem_id":"p03898","input":"4\n1 2\n2 3\n2 4\n","output":"3\n"},{"problem_id":"p03899","input":"5 2 3\n10 2 8 10 2\n","output":"56\n"},{"problem_id":"p03900","input":"4\n1 2 3 4\nMmM\n","output":"3\n"},{"problem_id":"p03901","input":"3\n100\n","output":"2.0000000\n"},{"problem_id":"p03902","input":"3 3\n2 3 1\n2 1 2\n2 6 3\n","output":"1\n"},{"problem_id":"p03903","input":"4 3\n1 2 3\n2 3 4\n3 4 5\n2\n2 3\n1 4\n","output":"8\n7\n"},{"problem_id":"p03904","input":"2\n15267315\n","output":"315\n"},{"problem_id":"p03905","input":"4\n0 1\n1 0\n1 1\n2 1\n","output":"4\n"},{"problem_id":"p03906","input":"3\n43 24 37\n","output":"16\n"},{"problem_id":"p03907","input":"4\n0 1\n1 0\n1 1\n2 1\n","output":"4\n"},{"problem_id":"p03908","input":"3\n43 24 37\n","output":"16\n"},{"problem_id":"p03909","input":"15 10\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snuke snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\n","output":"H6\n"},{"problem_id":"p03910","input":"4\n","output":"1\n3\n"},{"problem_id":"p03911","input":"4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n","output":"YES\n"},{"problem_id":"p03912","input":"7 5\n3 1 4 1 5 9 2\n","output":"3\n"},{"problem_id":"p03913","input":"8 1\n","output":"7\n"},{"problem_id":"p03914","input":"3 3\n","output":"2\n"},{"problem_id":"p03915","input":"7 1\n5 2 1\n","output":"21\n"},{"problem_id":"p03916","input":"5\n2 7 1 8\n1\n2\n","output":"0\n"},{"problem_id":"p03917","input":"2 2\ncf\ncf\n","output":"6\n"},{"problem_id":"p03918","input":"3\n0 0 1\n1 1 0\n3 0 1\n0 1 1\n","output":"L1\nL1\nL1\nL3\nD1\nR2\nU3\nR3\nD2\n"},{"problem_id":"p03919","input":"15 10\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snuke snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\n","output":"H6\n"},{"problem_id":"p03920","input":"4\n","output":"1\n3\n"},{"problem_id":"p03921","input":"4 6\n3 1 2 3\n2 4 2\n2 4 6\n1 6\n","output":"YES\n"},{"problem_id":"p03922","input":"7 5\n3 1 4 1 5 9 2\n","output":"3\n"},{"problem_id":"p03923","input":"8 1\n","output":"7\n"},{"problem_id":"p03924","input":"3 3\n","output":"2\n"},{"problem_id":"p03925","input":"7 1\n5 2 1\n","output":"21\n"},{"problem_id":"p03926","input":"5\n2 7 1 8\n1\n2\n","output":"0\n"},{"problem_id":"p03927","input":"2 2\ncf\ncf\n","output":"6\n"},{"problem_id":"p03928","input":"3\n0 0 1\n1 1 0\n3 0 1\n0 1 1\n","output":"L1\nL1\nL1\nL3\nD1\nR2\nU3\nR3\nD2\n"},{"problem_id":"p03929","input":"7 7\n","output":"2\n"},{"problem_id":"p03931","input":"3 1\n1 2 3\n","output":"3\n"},{"problem_id":"p03932","input":"3 3\n1 0 5\n2 2 3\n4 2 4\n","output":"21\n"},{"problem_id":"p03933","input":"4 3\n","output":"1.0000000000000\n"},{"problem_id":"p03934","input":"9 3\n5 11\n8 4\n4 7\n","output":"4\n4\n4\n4\n2\n2\n1\n1\n0\n"},{"problem_id":"p03935","input":"4 7\n","output":"176\n"},{"problem_id":"p03937","input":"4 5\n##...\n.##..\n..##.\n...##\n","output":"Possible\n"},{"problem_id":"p03938","input":"2\n1 2\n","output":"1 4\n5 4\n"},{"problem_id":"p03939","input":"1 3 3\n","output":"4.500000000000000\n"},{"problem_id":"p03940","input":"3 9 1\n1 3 8\n","output":"12\n"},{"problem_id":"p03941","input":"7\n1 1\n1 1\n2 1\n2 1\n3 1\n3 1\n","output":"4\n"},{"problem_id":"p03942","input":"5\nabcde\naaacc\n","output":"2\n"},{"problem_id":"p03943","input":"10 30 20\n","output":"Yes\n"},{"problem_id":"p03944","input":"5 4 2\n2 1 1\n3 3 4\n","output":"9\n"},{"problem_id":"p03945","input":"BBBWW\n","output":"1\n"},{"problem_id":"p03946","input":"3 2\n100 50 200\n","output":"1\n"},{"problem_id":"p03947","input":"BBBWW\n","output":"1\n"},{"problem_id":"p03948","input":"3 2\n100 50 200\n","output":"1\n"},{"problem_id":"p03949","input":"5\n1 2\n3 1\n4 3\n3 5\n2\n2 6\n5 7\n","output":"Yes\n5\n6\n6\n5\n7\n"},{"problem_id":"p03950","input":"10 10 4\n1 6\n4 1\n6 9\n9 4\n","output":"32\n"},{"problem_id":"p03951","input":"3\nabc\ncde\n","output":"5\n"},{"problem_id":"p03952","input":"4 4\n","output":"Yes\n1\n6\n3\n7\n4\n5\n2\n"},{"problem_id":"p03953","input":"3\n-1 0 2\n1 1\n2\n","output":"-1.0\n1.0\n2.0\n"},{"problem_id":"p03954","input":"4\n1 6 3 7 4 5 2\n","output":"4\n"},{"problem_id":"p03955","input":"5\n9 6 15 12 1\n8 5 14 11 2\n7 4 13 10 3\n","output":"Yes\n"},{"problem_id":"p03956","input":"3 2\n1 2\n2 3\n","output":"3\n"},{"problem_id":"p03957","input":"CODEFESTIVAL\n","output":"Yes\n"},{"problem_id":"p03958","input":"7 3\n3 2 2\n","output":"0\n"},{"problem_id":"p03959","input":"5\n1 3 3 3 3\n3 3 2 2 2\n","output":"4\n"},{"problem_id":"p03960","input":"2 3\nrrr\nbrg\n","output":"2\n"},{"problem_id":"p03961","input":"4\n0 2 3 0\n","output":"23\n"},{"problem_id":"p03962","input":"3 1 4\n","output":"3\n"},{"problem_id":"p03963","input":"2 2\n","output":"2\n"},{"problem_id":"p03964","input":"3\n2 3\n1 1\n3 2\n","output":"10\n"},{"problem_id":"p03965","input":"gpg\n","output":"0\n"},{"problem_id":"p03966","input":"3\n2 3\n1 1\n3 2\n","output":"10\n"},{"problem_id":"p03967","input":"gpg\n","output":"0\n"},{"problem_id":"p03968","input":"6\n0 1 2 3\n0 4 6 1\n1 6 7 2\n2 7 5 3\n6 4 5 7\n4 0 3 5\n","output":"1\n"},{"problem_id":"p03969","input":"4 4 2\n1 2\n2 3\n3 1\n3 4\n","output":"8\n"},{"problem_id":"p03970","input":"C0DEFESTIVAL2O16\n","output":"2\n"},{"problem_id":"p03971","input":"10 2 3\nabccabaabb\n","output":"Yes\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\n"},{"problem_id":"p03972","input":"2 2\n3\n5\n2\n7\n","output":"29\n"},{"problem_id":"p03973","input":"3\n3\n2\n5\n","output":"3\n"},{"problem_id":"p03974","input":"5\naa\nabbaa\nabbba\naaab\naaaaaba\n5\n1 abcdefghijklmnopqrstuvwxyz\n2 bacdefghijklmnopqrstuvwxyz\n3 abcdefghijklmnopqrstuvwxyz\n4 bacdefghijklmnopqrstuvwxyz\n5 abcdefghijklmnopqrstuvwxyz\n","output":"1\n2\n5\n4\n2\n"},{"problem_id":"p03975","input":"5 5 9\n4\n3\n6\n9\n1\n","output":"4\n"},{"problem_id":"p03976","input":"9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n","output":"3\n"},{"problem_id":"p03977","input":"3\n3 1\n4 108\n1 10\n","output":"255\n400\n10\n"},{"problem_id":"p03980","input":"4\n_(4,51)?\n^(99,_(3,67))?\n_(0,87)?\n3?\n","output":"4 5\n99 4\n0 3\n3 2\n"},{"problem_id":"p03981","input":"abcabc\n","output":"3\n"},{"problem_id":"p03982","input":"2\n1 5\n3 1\n","output":"2\n"},{"problem_id":"p03983","input":"2\n20 8\n20 12\n","output":"24\n20\n"},{"problem_id":"p03984","input":"4 2\n2\n3\n1\n1\n","output":"12\n"},{"problem_id":"p03985","input":"4\n0 -3 2 0 3 2\n0 0 9 8 8 2\n0 0 9 10 10 5\n0 0 707 1000 1000 707\n","output":"3\n10\n21\n180\n"},{"problem_id":"p03986","input":"TSTTSS\n","output":"4\n"},{"problem_id":"p03987","input":"3\n2 1 3\n","output":"9\n"},{"problem_id":"p03988","input":"5\n3 2 2 3 3\n","output":"Possible\n"},{"problem_id":"p03989","input":"3 1\n","output":"2\n"},{"problem_id":"p03990","input":"4 1 2\n1 2\n1 3\n1 4\n2 1\n2 3\n1 4\n","output":"4\n"},{"problem_id":"p03991","input":"3\n1 2\n2 3\n","output":"3\n7\n3\n"},{"problem_id":"p03992","input":"CODEFESTIVAL\n","output":"CODE FESTIVAL\n"},{"problem_id":"p03993","input":"4\n2 1 4 3\n","output":"2\n"},{"problem_id":"p03994","input":"xyz\n4\n","output":"aya\n"},{"problem_id":"p03995","input":"2 2\n3\n1 1 0\n1 2 10\n2 1 20\n","output":"Yes\n"},{"problem_id":"p03996","input":"2 2\n3\n2 1 2\n","output":"Yes\n"},{"problem_id":"p03997","input":"3\n4\n2\n","output":"7\n"},{"problem_id":"p03998","input":"aca\naccc\nca\n","output":"A\n"},{"problem_id":"p03999","input":"125\n","output":"176\n"},{"problem_id":"p04000","input":"4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n","output":"0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n"},{"problem_id":"p04001","input":"125\n","output":"176\n"},{"problem_id":"p04002","input":"4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4\n","output":"0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n"},{"problem_id":"p04003","input":"3 3\n1 2 1\n2 3 1\n3 1 2\n","output":"1\n"},{"problem_id":"p04004","input":"1 1 1\n","output":"17\n"},{"problem_id":"p04005","input":"3 3 3\n","output":"9\n"},{"problem_id":"p04006","input":"2 10\n1 100\n","output":"12\n"},{"problem_id":"p04007","input":"5 5\n.....\n.#.#.\n.....\n.#.#.\n.....\n","output":".....\n#####\n#....\n#####\n.....\n\n.###.\n.#.#.\n.#.#.\n.#.#.\n.....\n"},{"problem_id":"p04008","input":"3 1\n2 3 1\n","output":"2\n"},{"problem_id":"p04009","input":"3 3\no.o\n.Eo\nooo\n","output":"3\n"},{"problem_id":"p04010","input":"6 5\n1 2\n1 3\n1 4\n2 5\n2 6\n","output":"5\n"},{"problem_id":"p04011","input":"5\n3\n10000\n9000\n","output":"48000\n"},{"problem_id":"p04012","input":"abaccaba\n","output":"Yes\n"},{"problem_id":"p04013","input":"4 8\n7 9 8 9\n","output":"5\n"},{"problem_id":"p04014","input":"87654\n30\n","output":"10\n"},{"problem_id":"p04015","input":"4 8\n7 9 8 9\n","output":"5\n"},{"problem_id":"p04016","input":"87654\n30\n","output":"10\n"},{"problem_id":"p04017","input":"9\n1 3 6 13 15 18 19 29 31\n10\n4\n1 8\n7 3\n6 7\n8 5\n","output":"4\n2\n1\n2\n"},{"problem_id":"p04018","input":"aab\n","output":"1\n1\n"},{"problem_id":"p04019","input":"SENW\n","output":"Yes\n"},{"problem_id":"p04020","input":"4\n4\n0\n3\n2\n","output":"4\n"},{"problem_id":"p04021","input":"4\n2\n4\n3\n1\n","output":"1\n"},{"problem_id":"p04022","input":"8\n1\n2\n3\n4\n5\n6\n7\n8\n","output":"6\n"},{"problem_id":"p04023","input":"5 3\n6\n4\n11\n","output":"3\n3\n3\n2\n0\n"},{"problem_id":"p04024","input":"3 3 3\n.#.\n###\n#.#\n","output":"20\n"},{"problem_id":"p04025","input":"2\n4 8\n","output":"8\n"},{"problem_id":"p04026","input":"needed\n","output":"2 5\n"},{"problem_id":"p04027","input":"2 3\n1 1\n1 1\n","output":"4\n"},{"problem_id":"p04028","input":"3\n0\n","output":"5\n"},{"problem_id":"p04029","input":"3\n","output":"6\n"},{"problem_id":"p04030","input":"01B0\n","output":"00\n"},{"problem_id":"p04031","input":"2\n4 8\n","output":"8\n"},{"problem_id":"p04032","input":"needed\n","output":"2 5\n"},{"problem_id":"p04033","input":"1 3\n","output":"Positive\n"},{"problem_id":"p04034","input":"3 2\n1 2\n2 3\n","output":"2\n"},{"problem_id":"p04035","input":"3 50\n30 20 10\n","output":"Possible\n2\n1\n"},{"problem_id":"p04036","input":"5 6\n2 3\n4 5\n1 2\n1 3\n1 4\n1 5\n6\n2 4 3\n2 4 4\n2 4 5\n1 3 3\n1 3 4\n1 3 5\n","output":"1\n2\n3\n1\n5\n5\n"},{"problem_id":"p04037","input":"2\n1 3\n","output":"First\n"},{"problem_id":"p04038","input":"2 2\n","output":"4\n"},{"problem_id":"p04039","input":"1000 8\n1 3 4 5 6 7 8 9\n","output":"2000\n"},{"problem_id":"p04040","input":"2 3 1 1\n","output":"2\n"},{"problem_id":"p04041","input":"3 5 7 5\n","output":"1\n"},{"problem_id":"p04042","input":"3 7\nat\ncoder\ncodar\n","output":"atcodar\n"},{"problem_id":"p04043","input":"5 5 7\n","output":"YES\n"},{"problem_id":"p04044","input":"3 3\ndxx\naxx\ncxx\n","output":"axxcxxdxx\n"},{"problem_id":"p04045","input":"1000 8\n1 3 4 5 6 7 8 9\n","output":"2000\n"},{"problem_id":"p04046","input":"2 3 1 1\n","output":"2\n"},{"problem_id":"p04047","input":"2\n1 3 1 2\n","output":"3\n"},{"problem_id":"p04048","input":"5 2\n","output":"12\n"},{"problem_id":"p04049","input":"6 2\n1 2\n3 2\n4 2\n1 6\n5 6\n","output":"2\n"},{"problem_id":"p04050","input":"3 2\n2 1\n","output":"1 2\n1\n3\n"},{"problem_id":"p04051","input":"3\n1 1\n1 1\n2 1\n","output":"26\n"},{"problem_id":"p04052","input":"4 2\n4 2 3 1\n","output":"2\n1\n4\n3\n"}]