messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe well-known Fibonacci sequenc...
[{"type": "stdin_stdout", "input": "1 123456 961946\n", "output": "11954016000000000001 3158031000000000000\n"}, {"type": "stdin_stdout", "input": "10000 154768 13\n", "output": "11015448000000000001 9428455500000000000\n"}, {"type": "stdin_stdout", "input": "0 123456 961946\n", "output": "11954016000000000001 31580310...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis problem is different with h...
[{"type": "stdin_stdout", "input": "100\nssssssssssssssssssssssssssssssssssssssssssssssssssoooooooooooooooooooooooooooooooooooooooooooooooooo\n", "output": "? 1 50\n? 2 50\n? 1 100\n! \n"}, {"type": "stdin_stdout", "input": "100\nqvynouyqhasgfxwavprvmnfpqkzrqtyxpxqgzbfftxvzwsvbdlknukhgexhgbtnlhynwoivkyuvjtkfmlfidqtetef...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nINTERCAL is the oldest of esoter...
[{"type": "stdin_stdout", "input": "aMCT]:0hDJ*Up5g_l:O&>>%gjQkZkb(mi&;\\7dL\"nWOGz/;,6h*@Q0R53MS2<}F~+Ms\\\"cF-lgF0>C&y7)72\\.T\"8*#VO=|^OtYs\n", "output": "122\n212\n240\n152\n112\n94\n80\n246\n244\n208\n254\n170\n156\n98\n198\n236\n196\n218\n106\n142\n232\n0\n216\n190\n144\n204\n180\n124\n132\n144\n50\n94\n32\n50\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya very much likes rec...
[{"type": "stdin_stdout", "input": "-841 -205\n590 -205\n-1000 -1000\n-364 1385\n-682 113\n-841 -1000\n-1000 -205\n908 1067\n", "output": "YES\n2 4 5 8\n1 3 6 7\n"}, {"type": "stdin_stdout", "input": "400 -580\n-580 -895\n-475 -720\n-580 -1000\n-405 -1000\n-20 400\n-300 -825\n-1000 -20\n", "output": "YES\n1 4 6 8 \n2 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOmkar is playing his favorite pi...
[{"type": "stdin_stdout", "input": "5\n4\nRLRL\n6\nLRRRRL\n8\nRLLRRRLL\n12\nLLLLRRLRRRLL\n5\nRRRRR\n", "output": "0\n1\n1\n3\n2\n"}, {"type": "stdin_stdout", "input": "5\n4\nRLRL\n6\nLRRRRL\n8\nRLLRRRLL\n12\nLLRRRLRRLLLL\n5\nRRRRR\n", "output": "0\n1\n1\n3\n2\n"}, {"type": "stdin_stdout", "input": "5\n4\nRLRL\n6\nRRRLR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day, n people (n is an even ...
[{"type": "stdin_stdout", "input": "20\n", "output": "12164510040883200\n"}, {"type": "stdin_stdout", "input": "18\n", "output": "39520825344000\n"}, {"type": "stdin_stdout", "input": "16\n", "output": "163459296000\n"}, {"type": "stdin_stdout", "input": "14\n", "output": "889574400\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the easy version of the ...
[{"type": "stdin_stdout", "input": "5 7\n#....#.\n.#.#...\n#....#.\n#....##\n#.#....\n4 1 1 1 0 3 1\n", "output": "\n3\n"}, {"type": "stdin_stdout", "input": "3 10\n#..###..##\n...#..###.\n.###..##..\n1 1 1 3 1 1 2 2 2 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3 6\n..#..#\n......\n#####.\n1 1 2 1 1 1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's consider one interesting w...
[{"type": "stdin_stdout", "input": "dkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjij\ndddkikjjidkkidijjjjkkjjikjdikiidijjikikjijjiijdikkjjjiddjjijkkkjkiijijki...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Little Elephant loves Ukrain...
[{"type": "stdin_stdout", "input": "100\n922 938 103 689 526 118 314 496 373 47 224 544 495 656 804 754 269 356 354 536 817 597 787 178 516 659 790 993 786 169 866 779 997 350 674 310 219 546 564 893 402 449 751 628 329 686 392 951 716 439 332 563 215 146 746 311 866 773 548 1100 731 183 890 802 488 944 473 25 662 559 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVitaly is a very weird man. He's...
[{"type": "stdin_stdout", "input": "1 2 1000000\n", "output": "786609214\n"}, {"type": "stdin_stdout", "input": "8 9 1000000\n", "output": "573697309\n"}, {"type": "stdin_stdout", "input": "3 6 1000000\n", "output": "786609214\n"}, {"type": "stdin_stdout", "input": "8 9 111111\n", "output": "900401372\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIgor has fallen in love with Tan...
[{"type": "stdin_stdout", "input": "62800\n867 936 2 888 474 530 287 1101 220\n", "output": "33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA festival will be held in a tow...
[{"type": "stdin_stdout", "input": "100 20 5\n47 93 3\n61 49 10\n14 69 10\n88 2 14\n35 86 18\n63 16 20\n39 49 22\n32 45 23\n66 54 25\n77 2 36\n96 85 38\n33 28 45\n29 78 53\n78 13 60\n58 96 64\n74 39 71\n18 80 80\n18 7 85\n97 82 96\n74 99 97\n", "output": " 877...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe finalists of the \"Russian C...
[{"type": "stdin_stdout", "input": "100 100\n100 100\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "10 100\n100 100\n99\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "100 2\n50 100\n0\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "19 76\n91 91\n87\n", "output": "1729\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrey needs one more problem to...
[{"type": "stdin_stdout", "input": "100\n0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.2116826272545882 0.3214958859186292 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTomash keeps wandering off and g...
[{"type": "stdin_stdout", "input": "8 56\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n2 1\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n3 1\n3 2\n3 4\n3 5\n3 6\n3 7\n3 8\n4 1\n4 2\n4 3\n4 5\n4 6\n4 7\n4 8\n5 1\n5 2\n5 3\n5 4\n5 6\n5 7\n5 8\n6 1\n6 2\n6 3\n6 4\n6 5\n6 7\n6 8\n7 1\n7 2\n7 3\n7 4\n7 5\n7 6\n7 8\n8 1\n8 2\n8 3\n8 4\n8 5\n8 6\n8 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIgor has been into chess for a l...
[{"type": "stdin_stdout", "input": "13\n.............\n.....o.......\n......o......\n.............\n...o........o\no............\n.............\n..o..........\n..........ooo\n.............\n..o...o.....o\n.............\n.o........o..\n", "output": "YES\nxx......................x\nxx.....x........x.......x\n...............
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Cereal Guy's friend Serial G...
[{"type": "stdin_stdout", "input": "4 10 10\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........
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBecause of budget cuts one IT co...
[{"type": "stdin_stdout", "input": "444\n", "output": "2159776046970635520\n"}, {"type": "stdin_stdout", "input": "500\n", "output": "5567867859752100000"}, {"type": "stdin_stdout", "input": "498\n", "output": "5392730685240975000"}, {"type": "stdin_stdout", "input": "308\n", "output": "117307091246785440\n"}, {"type":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak is a little polar bear. He...
[{"type": "stdin_stdout", "input": "100 1000\n-62 57 -27 -67 49 -10 66 -64 -36 -78 62 -75 -39 75 -47 -36 41 -88 62 -43 22 29 -20 58 40 16 71 -2 -87 12 86 -90 -92 67 -12 -48 -10 -26 78 68 22 -3 66 -95 -81 34 14 -76 -27 76 -60 87 -84 3 35 -60 46 -65 29 -29 2 -44 -55 18 -75 91 36 34 -86 53 59 -54 -29 33 -95 66 9 72 67 -44...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCodeforces user' handle color de...
[{"type": "stdin_stdout", "input": "9\nmwAz9lQ 1786 -1631\nnYgYFXZQfY -1849 -1775\nKU4jF -1773 -3376\nopR 3752 2931\nGl -1481 -1002\nR -1111 3778\n0i9B21DC 3650 279\nQ8L2dS0 358 -3305\ng -2662 3968\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "9\nmwAz9lQ 1786 -1631\nnYgYFXZQfY -1849 -1775\nKU4jF -1773 -3376...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA rare article in the Internet i...
[{"type": "stdin_stdout", "input": "A,3,B,2,C,0,D,1,E,0,F,1,G,0,H,1,I,1,J,0,K,1,L,0,M,2,N,0,O,1,P,0\n", "output": "4\nA K M \nB F H L N O \nC D G I P \nE J \n"}, {"type": "stdin_stdout", "input": "A,3,B,2,C,0,D,1,E,0,F,1,G,0,H,1,I,1,J,0,K,1,L,0,M,2,O,0,O,1,P,0\n", "output": "4\nA K M\nB F H L O O\nC D G I P\nE J\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnton has the integer x. He is i...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "999999999999999999\n"}, {"type": "stdin_stdout", "input": "999000000001999999\n", "output": "998999999999999999\n"}, {"type": "stdin_stdout", "input": "199999999999999999\n", "output": "199999999999999999\n"}, {"type": "stdin_stdout", "input": "2999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two main kinds of even...
[{"type": "stdin_stdout", "input": "10 1 1 1 2 0 10\n1 1\n2 1\n3 0\n4 0\n5 1\n6 1\n14 1\n8 1\n9 1\n10 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 1 1 1 2 0 10\n1 1\n2 1\n3 0\n4 0\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 1 1 1 2 0 10\n1 1\n2 1\n3 0\n4 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya writes his own library for...
[{"type": "stdin_stdout", "input": "20\nVBox hykl\nVBox enwv\nenwv.pack(hykl)\nVBox dlepf\ndlepf.pack(hykl)\nenwv.set_border(30)\nWidget mjrrik(54,21)\nhykl.set_border(2)\ndlepf.set_border(22)\nenwv.set_border(3)\nenwv.pack(dlepf)\ndlepf.pack(mjrrik)\nhykl.set_spacing(96)\nenwv.set_border(32)\ndlepf.set_border(72)\nWid...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string A. Find a...
[{"type": "stdin_stdout", "input": "fggbyzobbmxtwdajawqdywnppflkkmtxzjvxopqvliwdwhzepcuiwelhbuotlkvesexnwkytonfrpqcxzzqzdvsmbsjcxxeugavekozfjlolrtqgwzqxsfgrnvrgfrqpixhsskbpzghndesvwptpvvkasfalzsetopervpwzmkgpcexqnvtnoulprwnowmsorscecvvvrjfwumcjqyrounqsgdruxttvtmrkivtxauhosokdiahsyrftzsgvgyveqwkzhqstbgywrvmsgfcfyuxpphvm...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMahmoud wants to send a message ...
[{"type": "stdin_stdout", "input": "5 4 4\ni loser am the second\n100 20 1 7 10\n1 1\n1 3\n2 2 5\n1 4\ni am the second\n", "output": "118\n"}, {"type": "stdin_stdout", "input": "5 4 4\ni loser am the second\n101 20 1 5 10\n1 1\n1 3\n2 2 5\n1 4\ni am the second\n", "output": "117\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn the divine friendship day, \"...
[{"type": "stdin_stdout", "input": "350\nrrbbrbbbwbwwbwbbbbwwrrbbwbrwbrwbbbqbrwrwbrwwwrrbbrrwrbbrwbwrwwwrbrwwwwwrwbwwwrrbrrbbbrbrbbbrbbbrbbwbbbbbrbrrbrwwbrrrrwbwrwrbbwbwrbrbrwwbrrbwbrwwbwwwbrbwrwbwbrbbbwrbwwrrrbwbwbbbbbrrwwwrbrwwrbbwrbbrbbrbwrrwwbrrrbrwbrwwrbwbwrrrbwrwrrbrbbwrwrbrwwwrwbwrrwwwwrrrwrrwbbwrwwrwrbwwbwrrrrb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Pandey is someone who is ...
[{"type": "stdin_stdout", "input": "371 446\n1952\n9423\n8541\n57979\n535\n84946\n375\n8735\n8759\n7113\n11413\n65737\n500\n308\n194\n8785\n57265\n10381\n1130\n968\n5961\n76168\n81612\n66595\n66583\n1082\n373\n9386\n28833\n41145\n2566\n239\n722\n838\n5916\n28356\n2427\n602\n38509\n3629\n2636\n7551\n40\n21895\n795\n2518...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a three-digit integer N...
[{"type": "stdin_stdout", "input": "1760", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2578", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3557", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1413", "output": "No\n"}, {"type": "stdin_stdout", "input": "187", "output": "Yes\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given integers A and B, ...
[{"type": "stdin_stdout", "input": "-1 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-3 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 -3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-5 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 -5", "output": "Yes\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the number of palindromic n...
[{"type": "stdin_stdout", "input": "31415 97709", "output": "662\n"}, {"type": "stdin_stdout", "input": "53417 77120", "output": "237\n"}, {"type": "stdin_stdout", "input": "44323 77120", "output": "328\n"}, {"type": "stdin_stdout", "input": "44323 83416", "output": "391\n"}, {"type": "stdin_stdout", "input": "15858 40...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have N points in a two-dimens...
[{"type": "stdin_stdout", "input": "4 3\n-1000000000 -1000000000\n1000000000 1000000000\n-999999999 999999999\n999999999 -1704052742", "output": "4000000000000000000\n"}, {"type": "stdin_stdout", "input": "4 3\n-1000000000 -1000000000\n1000000000 1011100000\n-1080623314 999999999\n176460011 -999999999", "output": "2514...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn a public bath, there is a sho...
[{"type": "stdin_stdout", "input": "4 1000000000\n0 1100 1000000 1000000000", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "4 1000000000\n0 1100 1000000 1010000000", "output": "2001000000\n"}, {"type": "stdin_stdout", "input": "4 1000010000\n0 1000 1000000 1000000000", "output": "2000010000\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi recorded his daily lif...
[{"type": "stdin_stdout", "input": "10\n43196 57600\n4800 9600\n6000 1200\n600 600\n300 600\n5400 600\n6000 5760\n6760 2880\n6000 12000\n9000 600", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n43196 57600\n4800 9600\n6000 1200\n600 600\n300 600\n5400 600\n6000 5760\n6760 2880\n6000 12000\n9000 794", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a data which provides h...
[{"type": "stdin_stdout", "input": "1819\n2003\n1094\n2489\n1723\n492\n4419\n2848\n2834\n1724", "output": "4419\n2848\n2834\n"}, {"type": "stdin_stdout", "input": "1819\n2003\n1094\n2489\n1142\n492\n4419\n4289\n2834\n1724", "output": "4419\n4289\n2834\n"}, {"type": "stdin_stdout", "input": "1819\n2003\n876\n2840\n1723\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCreate a program that rotates th...
[{"type": "stdin_stdout", "input": "#*******\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*****...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have obtained the Izua Japan...
[{"type": "stdin_stdout", "input": "3\n2\n2 1\n3 1\n7\n2\n2 3\n1 1\n0", "output": "4\n120\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 1\n3 1\n7\n2\n1 2\n1 1\n0", "output": "5\n720\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 2\n3 1\n4\n2\n2 2\n1 4\n0", "output": "4\n21\n"}, {"type": "stdin_stdout", "input": "3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nIn one river, there i...
[{"type": "stdin_stdout", "input": "5 1\n2 1 2 2 2\n1 3 3\n1 1 10\n1 1 1\n1 6 4\n5 0\n2 1 3 0 2\n1 3 2\n1 1 7\n1 2 1\n1 4 16\n0 0", "output": "25\n70\n"}, {"type": "stdin_stdout", "input": "5 1\n2 1 2 2 2\n1 3 3\n1 1 10\n1 1 1\n1 6 2\n5 0\n2 1 3 0 2\n1 3 2\n1 1 7\n1 2 1\n1 4 16\n0 0", "output": "15\n70\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe best night ever in the world...
[{"type": "stdin_stdout", "input": "3 2 1\n0 1 1\n1 2 3\n1\n4 5 2\n0 1 1\n0 2 1\n1 2 1\n1 3 1\n2 3 2\n1\n2\n0 -1 0", "output": "1.000000000\n\n1.000000000\n0.000000000\n\n"}, {"type": "stdin_stdout", "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 1", "output": "1.000000000\n\n0.50...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRational numbers are numbers rep...
[{"type": "stdin_stdout", "input": "2 10\n5 10\n19 111\n0 0", "output": "10/7 7/5\n9/4 2/1\n109/25 61/14\n"}, {"type": "stdin_stdout", "input": "11 5\n10 10\n5 100\n0 0", "output": "4/1 3/1\n10/3 3/1\n85/38 38/17\n"}, {"type": "stdin_stdout", "input": "2 5\n3 14\n26 111\n0 0", "output": "3/2 4/3\n7/4 12/7\n51/10 107/21...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have successfully completed ...
[{"type": "stdin_stdout", "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...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n4\n5\n8\n58\...
[{"type": "stdin_stdout", "input": "4\n5\n10\n108\n152", "output": "9263.000000000000000\n"}, {"type": "stdin_stdout", "input": "4\n5\n20\n55\n152", "output": "5887.500000000000000\n"}, {"type": "stdin_stdout", "input": "4\n2\n11\n55\n152", "output": "5082.000000000000000\n"}, {"type": "stdin_stdout", "input": "4\n5\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAirport Codes\n\nAirport code\n\...
[{"type": "stdin_stdout", "input": "3\nhaneda\noookayama\nssu\n2\nazusa\nazishirabe\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaii\n0", "output": "1\n4\n-1\n3\n"}, {"type": "stdin_stdout", "input": "3\nhaneda\noookayama\nstu\n2\nazusa\nebarihsiza\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaih\n0", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA: A-Z-\n\nproblem\n\nThere is a...
[{"type": "stdin_stdout", "input": "AIZV", "output": "2\n"}, {"type": "stdin_stdout", "input": "W\\AG", "output": "1\n"}, {"type": "stdin_stdout", "input": "[VIA", "output": "3\n"}, {"type": "stdin_stdout", "input": "BEW]", "output": "0\n"}, {"type": "stdin_stdout", "input": "VZIA", "output": "2\n"}, {"type": "stdin_st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDiameter of a Tree\n\n\n\n\nGive...
[{"type": "stdin_stdout", "input": "4\n1 0 -2\n2 1 10\n1 3 4", "output": "14\n"}, {"type": "stdin_stdout", "input": "4\n1 0 1\n0 2 12\n2 3 -1", "output": "13\n"}, {"type": "stdin_stdout", "input": "4\n1 0 0\n2 1 11\n0 3 11", "output": "22\n"}, {"type": "stdin_stdout", "input": "4\n1 0 -1\n2 1 15\n1 3 4", "output": "19\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChef, Artem and Eugene are the b...
[{"type": "stdin_stdout", "input": "2\n2 1 -1 11\n6 3 -1 0", "output": "0.666666666667\n0.666666666667\n"}, {"type": "stdin_stdout", "input": "2\n1 10 0 6\n1 2 2 -1", "output": "0.0909090909091\n0.333333333333\n"}, {"type": "stdin_stdout", "input": "2\n4 -1 -1 11\n2 4 0 0", "output": "1.33333333333\n0.333333333333\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAstronaut Natasha arrived on Mar...
[{"type": "stdin_stdout", "input": "2 420\n412 363\n", "output": "420\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider some positive integer x...
[{"type": "stdin_stdout", "input": "4\n4\n2\n72\n10\n", "output": " 2\n 1\n 61\n ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rooted tree on n...
[{"type": "stdin_stdout", "input": "2 100000 1000000000000000000\n1000000000 1000000000\n1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 100000 1000000000100000000\n1000000000 1000000000\n1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 101000 1000000000100000000\n1000000000 1000000000\n1\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChouti was doing a competitive p...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1236540828\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1102703100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1266106036\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000000010\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis morning, Roman woke up and ...
[{"type": "stdin_stdout", "input": "100 47\n-1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1\n", "output": "19\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a garden consisting ent...
[{"type": "stdin_stdout", "input": "3 150\nGGGWGGGGWWGGGGGGGGGGGGGWGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGGGGGGWGGGGGGGGGGGGGGGGGWGGGGGGGGGGGGGGGGGGW\nGGGGGGGGGGGGWGGGGGGGGGWGGGGGGGGGGGGWGGGGGWGGGGGGGWGGGGGGGWGGGGGWGGGGGGGGGGGGGGGGGGGGGGGGWGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call beauty of an array b_...
[{"type": "stdin_stdout", "input": "52 52\n19752 66708 73109 84463 95683 96876 98503 98812 99766 99778 99913 99975 99977 99997 99997 99997 99998 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence of n pa...
[{"type": "stdin_stdout", "input": "4\n2 3\n1 2\n2 1\n2 4\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "4\n2 3\n1 2\n2 1\n0 4\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "4\n3 3\n2 3\n2 1\n2 4\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\n2 3\n4 2\n2 1\n4 4\n", "output": "19\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetr stands in line of n people,...
[{"type": "stdin_stdout", "input": "100 81 58\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "100 81 54\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "100 81 91\n", "output": "19"}, {"type": "stdin_stdout", "input": "100 11 88\n", "output": "89"}, {"type": "stdin_stdout", "input": "59 12 33\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has spent the entire da...
[{"type": "stdin_stdout", "input": "7\n10 3 6 4\n11 3 6 4\n5 9 4 10\n6 5 2 3\n1 1 1 1\n3947465 47342 338129 123123\n234123843 13 361451236 361451000\n", "output": "27\n27\n9\n-1\n1\n6471793\n358578060125049\n"}, {"type": "stdin_stdout", "input": "7\n10 3 6 4\n11 3 6 0\n5 9 4 10\n6 5 2 3\n1 1 1 1\n3947465 47342 338129 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe government of Berland decide...
[{"type": "stdin_stdout", "input": "3\n10\n3 3 2 3 2 5 1 2 11 3\n6 5 2 5 3 2 4 2 1 2\n20\n9 1 10 1 17 7 5 5 8 1 1 2 7 1 4 2 3 7 6 3\n2 6 3 2 37 1 5 5 4 5 1 3 21 15 1 7 7 5 0 1\n20\n9 1 9 1 5 1 3 2 0 3 6 1 2 8 11 7 3 5 14 2\n11 14 6 4 6 8 8 2 9 9 6 5 3 2 5 7 1 9 14 1\n", "output": "NO\nNO\nNO\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n\"You must lift the dam. With a ...
[{"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n1 1 2\n4\n6 2 5 3\n2\n2 4\n1\n1\n", "output": "1\n1\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n1 1 1\n4\n6 2 5 3\n2\n2 4\n1\n1\n", "output": "1\n3\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n2 1 2\n4\n6 2 5 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the easy version of the ...
[{"type": "stdin_stdout", "input": "5\n2 2\n10\n11\n3 3\n011\n101\n110\n4 4\n1111\n0110\n0110\n1111\n5 5\n01011\n11001\n00010\n11011\n10000\n2 3\n011\n101\n", "output": "1\n1 1 2 1 2 2 \n6\n1 1 1 2 2 2 \n1 1 2 1 2 2 \n1 2 1 3 2 2 \n1 2 2 2 2 3 \n2 1 2 2 3 1 \n2 1 2 2 3 2 \n20\n1 1 1 2 2 2 \n1 2 1 3 2 2 \n1 2 2 2 2 3 \n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp calls an array dense if...
[{"type": "stdin_stdout", "input": "6\n4\n4 2 10 1\n2\n1 3\n2\n6 1\n3\n1 4 2\n5\n1 2 3 4 3\n12\n4 31 25 50 30 20 34 46 42 16 15 16\n", "output": "\n5\n1\n2\n1\n0\n3\n"}, {"type": "stdin_stdout", "input": "6\n4\n4 2 10 1\n2\n1 3\n2\n12 1\n3\n1 4 2\n5\n1 2 3 4 3\n12\n4 27 25 50 30 20 34 46 42 16 15 21\n", "output": "5\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a number n and an ...
[{"type": "stdin_stdout", "input": "1\n12\n400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 505032704\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n12\n400000000 400000000 400000000 400000000 400000000 400000000 400000000 40...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya, like many others, likes t...
[{"type": "stdin_stdout", "input": "50\n667406402 354775600 95220950 604569294 945922983 82947113 120853697 25192357 911801905 8804755 572528228 1217518845 180664274 949243037 5283222 128577958 23627567 882714363 413386071 937062768 916521072 1051464852 328941225 17876118 770879655 928962609 331124489 236187404 8786298...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is preparing to pass IQ test...
[{"type": "stdin_stdout", "input": "100\n44 40 6 40 56 90 98 8 36 64 76 86 98 76 36 92 6 30 98 70 24 98 96 60 24 82 88 68 86 96 34 42 58 10 40 26 56 10 88 58 70 32 24 28 14 82 52 12 62 36 70 60 52 34 74 30 78 76 10 16 42 94 66 90 70 38 52 12 58 22 98 96 14 68 24 70 4 30 84 98 8 50 14 52 66 34 100 10 28 100 56 48 38 12 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBessie and the cows are playing ...
[{"type": "stdin_stdout", "input": "5\n2 -1569\n1 2 -156\n2 641\n2 -253\n2 -400\n", "output": "-784.500000\n-940.500000\n-413.333333\n-373.250000\n-378.600000\n"}, {"type": "stdin_stdout", "input": "5\n2 -1481\n1 2 -156\n2 194\n2 -253\n2 -400\n", "output": "-740.500000\n-896.500000\n-533.000000\n-463.000000\n-450.40000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYet another Armageddon is coming...
[{"type": "stdin_stdout", "input": "4198516957\n", "output": " 503887718\n"}, {"type": "stdin_stdout", "input": "1278564645\n", "output": " 154026551\n"}, {"type": "stdin_stdout", "input": "292168270\n", "output"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n schoolchildren, boys...
[{"type": "stdin_stdout", "input": "MFFFMMFMFMFMFFFMMMFFMMMMMMFMMFFMMMFMMFMFFFMMFMMMFFMMFFMFFMFMFFFMMMFFFMFMFMFMFFFMMMMFMMFMMFFMMMMMFFFM\n", "output": "55\n"}, {"type": "stdin_stdout", "input": "FFFFFMFMMFFFMFMFMFFMMFMFMFFMFMMMMFMFFFFFFMFFMMMFFMFFMFFFFFMFFFFMMFFFFFFFFFFFMFMFFMMFFMFMFMFMMFFFMMMM\n", "output": "58\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya works as a PR manager for ...
[{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPeople in the Tomskaya region li...
[{"type": "stdin_stdout", "input": "25\n39226529 640445129 936289624 364461191 1096077769 573427707 1919403410 950067229 1217479531 455229458 1574949468 397268319 1267289585 995220637 1920919164 501015483 1815262670 1197059269 86947741 2000617780 667368575 733666398 1536581408 611239452 947487746\n", "output": "9991962...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya follows a basketball game ...
[{"type": "stdin_stdout", "input": "18\n450 3726 12063 42865 29689 35320 33937 4067 45951 80313 53004 59541 75551 75836 151186 81297 93876 96211\n47\n3393 11375 6494 7645 9549 8499 11145 13121 14801 15578 24104 24125 25871 31280 35036 38969 29966 41342 42708 46033 47491 25404 49152 51905 55002 9827 56565 57901 104645 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Tanya decided to present ...
[{"type": "stdin_stdout", "input": "DpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGdDRWVlqNyGWMWHMrHAIZpyxvgaflrsVZhhZRouvpxrKXFZam\nwwPLFtNfPtJXvMLuHjKfYyaRhreNSWSzOvDpqHCGcqllACNPGHxReeFUCmAqIKXYytsSQwIxJzNiiUtgebVuwRmWpRALLyKAzyDPvgIGxALSaeeTIqm\n", "output": "66 12\n"}, {"type": "stdin_stdout", "input": "maZFX...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA map of some object is a rectan...
[{"type": "stdin_stdout", "input": "100 5000\n", "output": "YES\nLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLS\nSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSL\nLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStepan had a favorite string s w...
[{"type": "stdin_stdout", "input": "200\n200 180 160 140 122 106 92 79 69 60 52 45 38 32 26 20 14 8 4 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 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 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 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 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter the educational reform Pol...
[{"type": "stdin_stdout", "input": "100\n45 55\n3 5 3 4 1 1 1 1 5 2 1 3 1 5 3 5 1 1 3 1 1 3 5 5 1 1 1 5 5 1 3 1 1 1 3 3 1 1 1 4 3 1 5 1 3 1 4 5 4 3 3 1 1 5 5 1 3 5 1 1 5 1 1 3 5 5 1 1 3 3 4 1 1 4 5 3 1 3 1 5 1 5 4 5 1 1 1 1 4 5 4 5 3 1 1 5 1 5 1 4\n", "output": "1 1 1 1 2 2 2 2 1 2 2 1 2 1 1 1 2 2 1 2 2 1 1 1 2 2 2 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you may know, MemSQL has Amer...
[{"type": "stdin_stdout", "input": "100\nSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSF\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100\nSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Travelling Salesman spends a...
[{"type": "stdin_stdout", "input": "10011010111010010111111110001010001010001010110010110010010111101111000101110101010111100101001100011001001001111011111100011110101011011001101101001111111101010010110011111101110010001000111111100011000000111111111100011000000000110101111000001011101000110000111110110000010000010011...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe recent All-Berland Olympiad ...
[{"type": "stdin_stdout", "input": "100\n600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a positive integer...
[{"type": "stdin_stdout", "input": "2000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1234567891\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1881388645\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "1538038021\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1686264392\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAniruddha loves to code on Hacke...
[{"type": "stdin_stdout", "input": "2\n9\n131\n\nARMOKE", "output": "230\n601742908\n"}, {"type": "stdin_stdout", "input": "2\n9\n159\n\nARMOKE", "output": "230\n118865459\n"}, {"type": "stdin_stdout", "input": "2\n6\n131\n\nARMOKE", "output": "52\n601742908\n"}, {"type": "stdin_stdout", "input": "2\n22\n21\n\nNSLALD",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonk visits a magical place, Mak...
[{"type": "stdin_stdout", "input": "2\n2 4 1 \n2 3\n5 3 12 3\n1 2 10 7\n3 4 2\n2 3 5\n5 3 10 2\n1 2 5 7\n\nSAMPLE", "output": "19\n14\n"}, {"type": "stdin_stdout", "input": "2\n2 4 1 \n0 3\n5 3 12 3\n1 2 10 7\n3 4 2\n2 3 5\n5 3 10 2\n1 2 5 7\n\nSAMPLE", "output": "20\n14\n"}, {"type": "stdin_stdout", "input": "2\n2 4 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a set S. Generate T, a set...
[{"type": "stdin_stdout", "input": "100\n100\n41 67 134 100 169 124 78 158 162 64 105 145 81 27 161 91 195 142 27 36 191 4 102 153 92 182 21 116 118 95 47 126 171 138 69 112 67 99 35 94 103 11 122 133 73 64 141 111 53 68 147 44 62 157 37 59 123 141 129 178 116 35 190 42 88 106 40 142 64 48 46 5 90 129 170 150 6 101 193...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday, Vasya has decided to stud...
[{"type": "stdin_stdout", "input": "1000\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have N squares assigned the n...
[{"type": "stdin_stdout", "input": "15\n1 10 145 15 87 138 51 194 1 18 77 20 9 17 93", "output": "8\n"}, {"type": "stdin_stdout", "input": "15\n15 11 46 15 50 98 93 129 31 43 44 11 6 24 14", "output": "3\n"}, {"type": "stdin_stdout", "input": "15\n15 11 46 15 50 98 93 129 41 43 44 11 6 24 14", "output": "3\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a positive integer N. F...
[{"type": "stdin_stdout", "input": "356 1000000007", "output": "614667827\n"}, {"type": "stdin_stdout", "input": "502 1000000007", "output": "749776015\n"}, {"type": "stdin_stdout", "input": "184 1000000007", "output": "550610517\n"}, {"type": "stdin_stdout", "input": "141 1000000007", "output": "536152791\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a string S of length N-...
[{"type": "stdin_stdout", "input": "<>>><<<<<><<>>><", "output": "29\n"}, {"type": "stdin_stdout", "input": "<>>>><<<<><<<>><", "output": "28\n"}, {"type": "stdin_stdout", "input": "<>><<<><<<<>>>><", "output": "26\n"}, {"type": "stdin_stdout", "input": "<<>><<><<<<>>>><", "output": "24\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn a flower bed, there are N flo...
[{"type": "stdin_stdout", "input": "8\n4 39 136 0 23 108 50 101", "output": "295\n"}, {"type": "stdin_stdout", "input": "8\n4 65 136 0 23 108 20 101", "output": "325\n"}, {"type": "stdin_stdout", "input": "8\n4 65 136 0 23 108 20 001", "output": "244\n"}, {"type": "stdin_stdout", "input": "8\n4 65 136 0 23 108 21 101",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe ABC number of a string T is ...
[{"type": "stdin_stdout", "input": "??????????B??????AC??????", "output": "616193984\n"}, {"type": "stdin_stdout", "input": "B?????BA?????????????????", "output": "461993881\n"}, {"type": "stdin_stdout", "input": "?????????????????AB?????B", "output": "428928079\n"}, {"type": "stdin_stdout", "input": "????>????????????...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are playing the following ga...
[{"type": "stdin_stdout", "input": "6\n12\n22\n18\n22\n18\n12", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n12\n22\n18\n35\n18\n12", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n12\n22\n28\n35\n18\n12", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n12\n35\n28\n35\n18\n12", "output": "2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a grid of H rows and W c...
[{"type": "stdin_stdout", "input": "11 -1\n../##\n.##/.\n..#-#\n#\"./.", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "11 -1\n.#/.#\n.##/.\n..#-#\n#\"./.", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "11 -1\n.#/.#\n.##/.\n..#-#\n#!./.", "output": "Impossible\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour task is to write a program ...
[{"type": "stdin_stdout", "input": "Thank you for your mail amd your lectures", "output": "your lectures\n"}, {"type": "stdin_stdout", "input": "ahTnk you for your mail and your serutcel", "output": "your serutcel\n"}, {"type": "stdin_stdout", "input": "Uhank you for your mail mad your lrctuees", "output": "your lrctue...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe courier charges for a courie...
[{"type": "stdin_stdout", "input": "2\n86 25 5 5\n135 60 10 30\n3\n10 8 25 24\n5 16 13 9\n30 30 30 14\n0", "output": "1200\n3800\n"}, {"type": "stdin_stdout", "input": "2\n51 0 5 15\n107 60 3 30\n3\n10 15 25 47\n2 12 12 3\n30 30 11 11\n0", "output": "1200\n2000\n"}, {"type": "stdin_stdout", "input": "2\n50 34 5 5\n80 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDo you know Just Odd Inventions?...
[{"type": "stdin_stdout", "input": "6\n12 13\n5 9\n2 4\n10 12\n6 12\n6 11", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n12 38\n5 9\n2 4\n10 12\n6 12\n11 9", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n12 13\n5 9\n2 2\n10 12\n6 12\n6 11", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have just been put in charge...
[{"type": "stdin_stdout", "input": "50 12346\n712 144139\n927438 667387\n23 3312\n9 3142\n25 1299\n101 63556\n103 862150\n6 1104\n0 0", "output": "43 1 2 34 6\n481 1 441 39\n667387 667387\n18 3 3 12\nerror\n21 1 2 9 9\n97 6 35 56\n103 86 2 15 0\nrejected\n"}, {"type": "stdin_stdout", "input": "50 12346\n712 144139\n158...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nA graph is given in w...
[{"type": "stdin_stdout", "input": "6\n1 2\n2 3\n3 4\n3 5\n5 6", "output": "6\n7\n8\n7\n7\n6\n"}, {"type": "stdin_stdout", "input": "6\n1 2\n2 3\n6 4\n3 5\n5 6", "output": "5\n6\n7\n5\n7\n6\n"}, {"type": "stdin_stdout", "input": "6\n1 2\n2 3\n6 4\n3 4\n5 6", "output": "5\n6\n7\n7\n5\n6\n"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nI'm traveling to a country with ...
[{"type": "stdin_stdout", "input": "5\n101.13623414746552 91.04161232454778\n1 -1\n1 10\n0 3\n19 -1\n20 7", "output": "9\n"}, {"type": "stdin_stdout", "input": "5\n100.60853142327974 90.65666260699702\n1 0\n1 10\n8 3\n10 -1\n12 10", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n100.60853142327974 90.656662606...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3 2\nR1\n\n\...
[{"type": "stdin_stdout", "input": "73 2\nR2", "output": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73\n146 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nThere is a grid of $ ...
[{"type": "stdin_stdout", "input": "9\noxoooooxo\noxxxxxxxx\noxoooooxo\nxxxxxxxxx\noxoxooooo\noxxxxxxxx\noxoxoxooo\nxxxxxxoxo\noxoxoxooo", "output": "4\n"}, {"type": "stdin_stdout", "input": "9\noxoooooxo\noxxxxxxxx\noxoooooxo\nxxxxxxxxx\noxoxooooo\noxxxxxxxx\noxoxoxooo\nxxxxxxoxo\noooxoxoxo", "output": "4\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe want to encode a given string...
[{"type": "stdin_stdout", "input": "aaabbcccdeeegfg", "output": "41\n"}, {"type": "stdin_stdout", "input": "aaadbcccbeedgfg", "output": "42\n"}, {"type": "stdin_stdout", "input": "gegdeebcccbeaaa", "output": "38\n"}, {"type": "stdin_stdout", "input": "aeaaacccbeedgeg", "output": "36\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which reads a se...
[{"type": "stdin_stdout", "input": "5\n114 0 -15 -1 2", "output": "-15 114 100\n"}, {"type": "stdin_stdout", "input": "5\n114 -1 -15 -1 2", "output": "-15 114 99\n"}, {"type": "stdin_stdout", "input": "5\n112 -1 -15 -1 2", "output": "-15 112 97\n"}, {"type": "stdin_stdout", "input": "5\n112 1 -14 -1 2", "output": "-14 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYesterday Chef had a great party...
[{"type": "stdin_stdout", "input": "10 3\n0324152397\n2\n3\n10", "output": "3\n3\n38\n"}, {"type": "stdin_stdout", "input": "10 3\n0324152397\n4\n3\n10", "output": "7\n3\n38\n"}, {"type": "stdin_stdout", "input": "10 3\n0324152397\n1\n3\n10", "output": "0\n3\n38\n"}, {"type": "stdin_stdout", "input": "10 3\n0324152397\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSonya decided that having her ow...
[{"type": "stdin_stdout", "input": "100 10\n-489 -476 -445 -432 -430 -421 -420 -418 -412 -411 -404 -383 -356 -300 -295 -293 -287 -276 -265 -263 -258 -251 -249 -246 -220 -219 -205 -186 -166 -157 -143 -137 -136 -130 -103 -86 -80 -69 -67 -55 -43 -41 -40 -26 -19 -9 16 29 41 42 54 76 84 97 98 99 101 115 134 151 157 167 169 ...
code_stdio