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\nLittle Monk is an extremely mise...
[{"type": "stdin_stdout", "input": "78 30\n41 12\n6 28\n23 29\n44 32\n20 36\n31 28\n11 19\n41 4\n43 21\n20 16\n38 23\n18 29\n19 38\n10 10\n30 35\n16 30\n22 16\n42 35\n7 22\n36 27\n35 33\n37 21\n29 5\n24 26\n42 40\n35 18\n14 3\n14 46\n11 37\n10 9", "output": "1\n"}, {"type": "stdin_stdout", "input": "78 30\n41 12\n6 28\...
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\nRoy has a wooden log (tree trunk...
[{"type": "stdin_stdout", "input": "19\n2\n10\n110\n1001\n10000\n100000\n1000000\n10000000\n100000000\n1000001000\n9\n96\n515\n11250\n151703\n999999\n10663009\n193683115\n1539023459", "output": "2 0\n6 4\n56 54\n501 500\n5001 4999\n50001 49999\n500001 499999\n5000001 4999999\n50000001 49999999\n500000501 500000499\n5 4...
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 an integer N. Snuke wil...
[{"type": "stdin_stdout", "input": "4\n33\n1\n28\n0111010001", "output": "996765147\n0\n399637805\n501963061\n"}, {"type": "stdin_stdout", "input": "4\n33\n1\n28\n0111110001", "output": "996765147\n0\n399637805\n744953502\n"}, {"type": "stdin_stdout", "input": "4\n24\n2\n30\n0110110001", "output": "192839398\n0\n434820...
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 board with H horizonta...
[{"type": "stdin_stdout", "input": "1001000000 1000000000", "output": "500500000000000000\n"}, {"type": "stdin_stdout", "input": "1001000000 1100000000", "output": "550550000000000000\n"}, {"type": "stdin_stdout", "input": "1001000010 1100000000", "output": "550550005500000000\n"}, {"type": "stdin_stdout", "input": "10...
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 three airports A, B an...
[{"type": "stdin_stdout", "input": "001 -13 -101", "output": "-114\n"}, {"type": "stdin_stdout", "input": "111 -117 -5", "output": "-122\n"}, {"type": "stdin_stdout", "input": "011 -5 -101", "output": "-106\n"}, {"type": "stdin_stdout", "input": "000 -93 -7", "output": "-100\n"}, {"type": "stdin_stdout", "input": "010 ...
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 university student, Takahashi,...
[{"type": "stdin_stdout", "input": "12\n757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604\n102338863 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212", "output": "5\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\nThere are N islands lining up fr...
[{"type": "stdin_stdout", "input": "5 10\n1 2\n1 4\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5", "output": "4\n"}, {"type": "stdin_stdout", "input": "5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 5\n3 5\n4 5", "output": "3\n"}, {"type": "stdin_stdout", "input": "5 10\n1 2\n1 4\n1 4\n1 5\n2 3\n2 4\n2 5\n3 3\n3 5\n4 5", "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\nYou are given an integer sequenc...
[{"type": "stdin_stdout", "input": "10\n-1 1 2 3 2 8 6 7 14 4", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 1 5 8 2 8 4 20 0", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 1 5 8 4 8 4 20 0", "output": "3\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 1 5 8 4 8 4 17 0", "output": "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\nThe king of a country loves prim...
[{"type": "stdin_stdout", "input": "4\n3 -1\n14 4\n3 24\n8 4\n1\n955049 29\n0", "output": "10\n4\n"}, {"type": "stdin_stdout", "input": "4\n0 -1\n13 1\n3 10\n8 3\n1\n964394 20\n0", "output": "6\n-1\n"}, {"type": "stdin_stdout", "input": "4\n0 -1\n18 2\n3 24\n8 4\n1\n190049 29\n0", "output": "10\n3\n"}, {"type": "stdin_...
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 Internet shopping site, o...
[{"type": "stdin_stdout", "input": "5 1\n3 eadrb knim naaabn\n3 llhm dornfmakes\n2 optato dareb inkk\n-1 cornglkaet arecd kmhm btuueq\n3 auotnp dbdqb", "output": "6\n2 dornfmakes\n2 llhm\ndornfmakes llhm\neadrb knim\neadrb naaabn\nknim naaabn\n"}, {"type": "stdin_stdout", "input": "5 1\n3 eadrb knin naaabn\n3 llhm dorn...
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 rabbit, who successfully def...
[{"type": "stdin_stdout", "input": "2 1\n1.4305687758065515 0.5906592296173833 0.7172165110693307\n1.3875130101214004 1.4070366443867153 0.6797862263528347", "output": "1.176249354391\n"}, {"type": "stdin_stdout", "input": "2 1\n1.4305687758065515 0.9585354783138406 0.7172165110693307\n1.3875130101214004 1.407036644386...
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 can obtain profits from fore...
[{"type": "stdin_stdout", "input": "6\n-10\n38\n2\n4\n-2\n8", "output": "48\n"}, {"type": "stdin_stdout", "input": "6\n-17\n38\n2\n4\n-2\n8", "output": "55\n"}, {"type": "stdin_stdout", "input": "6\n-17\n33\n2\n1\n-3\n8", "output": "50\n"}, {"type": "stdin_stdout", "input": "6\n-17\n61\n2\n1\n-3\n8", "output": "78\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\nInnopolis University scientists ...
[{"type": "stdin_stdout", "input": "20 20 80\n5 3\n13 13\n8 5\n2 9\n12 16\n1 11\n15 11\n3 20\n10 7\n5 4\n11 2\n5 20\n14 8\n5 1\n8 13\n11 5\n19 2\n15 12\n12 7\n16 5\n17 3\n12 2\n17 16\n12 3\n12 6\n18 20\n2 20\n9 1\n5 10\n9 18\n17 1\n17 10\n20 1\n12 12\n19 14\n7 8\n2 19\n6 14\n5 6\n15 2\n18 14\n5 7\n14 14\n17 2\n20 20\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\nConsider a tree T (that is, a co...
[{"type": "stdin_stdout", "input": "50\n25 32\n25 36\n31 15\n40 18\n38 25\n44 15\n46 36\n6 15\n25 14\n15 7\n15 13\n41 40\n25 23\n1 40\n25 5\n3 25\n24 15\n40 22\n42 47\n36 42\n37 42\n11 42\n25 49\n42 35\n36 43\n36 30\n17 15\n4 36\n15 19\n12 25\n15 21\n36 50\n15 40\n20 36\n36 48\n8 15\n25 33\n36 10\n25 28\n2 42\n27 25\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 sequence of inte...
[{"type": "stdin_stdout", "input": "100\n94 83 55 57 63 89 73 59 75 97 77 54 77 81 70 81 99 52 88 76 98 88 79 67 76 80 89 50 60 60 53 83 96 87 75 99 61 91 75 85 88 80 90 54 84 88 98 93 69 97 93 54 83 59 57 92 88 78 53 55 99 63 60 70 61 52 60 55 100 85 80 58 53 97 59 61 50 90 75 85 86 63 91 96 67 68 86 96 79 98 51 83 82...
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[Æsir - CHAOS](https://soundclou...
[{"type": "stdin_stdout", "input": "87\n1120 1120 1120 872 1120 731 3583 2815 4019 1291 4568 973 1120 1705 1120 822 203 1120 1120 1120 1120 4196 3166 4589 3030 1120 1120 1120 711 1120 500 1120 1120 3551 1120 1120 1120 1700 1120 1120 2319 4554 1120 1312 1120 1120 4176 1120 1120 3661 1120 1120 1120 1120 142 63 4125 1120 ...
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 an array a_1, a_2,...
[{"type": "stdin_stdout", "input": "50\n1 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "50\n1 1 1 1 1 2 1 1 2 1 4 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "20\...
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 an array a of leng...
[{"type": "stdin_stdout", "input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 12 1 3 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 19 1 3 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 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\nAlice and Bob play a game. The g...
[{"type": "stdin_stdout", "input": "12\n???1??????1?\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "12\n?1?1????????\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "12\n?1??????1???\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1\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\nA matrix of size n × m is called...
[{"type": "stdin_stdout", "input": "9\n1 1\n132703760\n1 1\n33227322\n1 1\n943066084\n1 1\n729139464\n1 1\n450488051\n1 1\n206794512\n1 1\n372520051\n1 1\n552003271\n1 1\n319080560\n", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "9\n1 1\n132703760\n1 1\n44528418\n1 1\n943066084\n1 1\n729...
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 four integers n, c...
[{"type": "stdin_stdout", "input": "7\n10 3 1 1\n1000000110\n1 10 1 1000\n0\n1 1 10 2\n1\n4 4 4 1\n1001\n1 1 1 1\n1\n2 1000 500 1000\n11\n3 500 500 1\n101\n", "output": "17\n10\n3\n16\n1\n1000\n1500\n"}, {"type": "stdin_stdout", "input": "7\n10 3 1 1\n1000000110\n1 10 1 1000\n0\n1 1 10 2\n1\n4 4 4 1\n1001\n1 0 1 1\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\nYou are given a sequence of n in...
[{"type": "stdin_stdout", "input": "4\n3\n3 14 1\n5\n3 3 2 2 4\n6\n1 6 2 2 2 10\n5\n1 12 1 4 2\n", "output": "0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n3\n3 14 1\n5\n3 3 2 1 4\n6\n1 6 2 2 2 10\n5\n1 12 1 4 2\n", "output": "0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 5 0\n5\n5 4 2 2 -1\n6\n0 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\nLet F_k denote the k-th term of ...
[{"type": "stdin_stdout", "input": "13\n1 2\n1 7\n6 8\n1 11\n10 9\n8 10\n11 12\n11 13\n1 3\n3 10\n3 5\n4 12\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "13\n1 2\n1 7\n5 10\n2 11\n8 9\n8 10\n11 12\n11 13\n1 3\n3 4\n6 5\n4 6\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "13\n1 2\n1 7\n5 10\n2 11\...
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\nBaby Badawy's first words were \...
[{"type": "stdin_stdout", "input": "10\n99281 18\n100000 16\n100000 15\n100000 14\n100000 6\n8823 3\n283 17\n299 18\n182 19\n1928 20\n", "output": "207307884\n95964640\n764800965\n570057652\n999657007\n829332965\n995193330\n759808819\n657208696\n258367760\n"}, {"type": "stdin_stdout", "input": "10\n99281 18\n100000 16\...
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 an array a_1, a_2,...
[{"type": "stdin_stdout", "input": "3\n2\n3 1\n3\n3 1 5\n5\n3 1 4 10 2\n", "output": "1\n2\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n2 1\n3\n4 2 5\n5\n3 1 4 10 2\n", "output": "0\n0\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n3 2\n3\n3 1 5\n5\n3 1 4 10 2\n", "output": "0\n2\n3\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\nMaxim has opened his own restaur...
[{"type": "stdin_stdout", "input": "50\n15 28 34 29 17 21 20 34 37 17 10 20 37 10 18 25 31 25 16 1 37 27 39 3 5 18 2 32 10 35 20 17 29 20 3 29 3 25 9 32 37 5 25 23 25 33 35 8 31 29\n39\n", "output": "1.4997987526\n"}, {"type": "stdin_stdout", "input": "50\n15 28 34 29 17 21 20 34 37 17 10 20 37 10 18 25 31 25 16 1 37 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\nPetya and Vasya are playing a ga...
[{"type": "stdin_stdout", "input": "100 27 56\n58 18 50 41 33 37 14 87 77 73 61 53 15 8 70 68 45 96 54 78 39 120 51 60 80 12 93 99 20 92 17 79 4 13 62 91 69 29 49 36 98 34 90 35 84 64 38 83 28 89 165 94 9 16 26 48 10 57 23 75 27 88 44 21 72 76 30 43 32 2 71 24 100 1 31 99 42 40 47 55 86 85 66 5 52 43 95 74 11 19 7 82 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\nThe king Copa often has been rep...
[{"type": "stdin_stdout", "input": "01.01.98\n01.01.80\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "02.05.90\n08.03.50\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "29.02.80\n29.02.60\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "15.12.62\n17.12.21\n", "output": "YES\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\nA group of tourists is going to ...
[{"type": "stdin_stdout", "input": "50 35\n2 93\n1 98\n2 62\n1 56\n1 86\n1 42\n2 67\n2 97\n2 59\n1 73\n1 83\n2 96\n1 20\n1 66\n1 84\n1 83\n1 91\n2 97\n1 81\n2 88\n2 63\n1 99\n2 57\n1 37\n1 74\n2 88\n1 30\n2 68\n1 100\n2 57\n1 87\n1 93\n1 83\n1 100\n1 91\n1 14\n1 38\n2 98\n2 85\n2 61\n1 44\n2 93\n2 66\n2 55\n2 74\n1 67\...
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\nPolar bears Menshykov and Uslada...
[{"type": "stdin_stdout", "input": "1000000000000\n", "output": "272165"}, {"type": "stdin_stdout", "input": "225849940487\n", "output": "129343\n"}, {"type": "stdin_stdout", "input": "542905489591\n", "output": "200537\n"}, {"type": "stdin_stdout", "input": "376593918338\n", "output": "167021\n"}, {"type": "stdin_stdo...
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 this problem is used an extre...
[{"type": "stdin_stdout", "input": "<table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td></td></tr></table></td></tr></table></td></tr></table></td></tr></table></...
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\nTwo bored soldiers are playing c...
[{"type": "stdin_stdout", "input": "10\n9 8 7 6 2 3 5 4 10 1\n1 9\n", "output": "103 1\n"}, {"type": "stdin_stdout", "input": "10\n1 10\n9 5 7 6 1 2 3 9 8 4\n", "output": "105 1\n"}, {"type": "stdin_stdout", "input": "10\n9 8 7 6 2 3 5 4 9 1\n1 10\n", "output": "105 2\n"}, {"type": "stdin_stdout", "input": "10\n8 1 6 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\nEdo has got a collection of n re...
[{"type": "stdin_stdout", "input": "20 5\n1 12 21 22\n9 10 15 20\n10 12 12 20\n1 1 25 29\n5 10 21 22\n4 9 16 25\n12 10 14 24\n3 3 19 27\n3 4 23 28\n12 1 11 31\n9 14 17 18\n8 12 14 20\n8 11 18 19\n12 3 14 29\n7 8 13 22\n6 4 16 30\n11 3 13 27\n9 16 15 18\n6 13 14 21\n9 12 15 22\n", "output": "4\n"}, {"type": "stdin_stdou...
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 two very long inte...
[{"type": "stdin_stdout", "input": "00011111111111111111111111111111111111000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000011000\n11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112091\n", "outpu...
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 remote island chain contains n...
[{"type": "stdin_stdout", "input": "10\n2 4 8 3 6 1 15 0 5 14\n3 6 1 10 0 5 7 2 14 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n2 4 8 3 6 1 15 0 5 7\n3 6 1 10 0 5 7 2 14 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n2 4 8 3 6 1 15 0 5 7\n3 6 1 10 0 5 7 2 22 4\n", "output": "NO\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\nGreatest common divisor GCD(a, b...
[{"type": "stdin_stdout", "input": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "10000000000000000000000000000000000000000000000000000000000000000...
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 Pari and Arya are playing ...
[{"type": "stdin_stdout", "input": "61 531012\n698043 698043 698043 963349 698043 698043 698043 963349 698043 698043 698043 963349 698043 698043 698043 698043 966694 698043 698043 698043 698043 698043 698043 636247 698043 963349 698043 698043 698043 698043 697838 698043 989253 698043 698043 966694 698043 698043 698043 ...
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 an n × n matrix with differ...
[{"type": "stdin_stdout", "input": "53\n", "output": "2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 1 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 \n106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 3 5 7 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\nArseniy is already grown-up and ...
[{"type": "stdin_stdout", "input": "10 1 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n8 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 1 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n3 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 1 3\n2 2 1 3 1 2 1 2 3 2\n10 8\n9 6\n3 10\n", "output": "0\n"}, {"type": "std...
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 new dog show on TV is starting...
[{"type": "stdin_stdout", "input": "100 154\n132 88 72 98 184 47 176 56 68 168 137 88 188 140 198 18 162 139 94 133 90 91 37 156 196 28 186 1 51 47 4 92 18 51 37 121 86 195 153 195 183 191 15 24 104 174 94 83 102 61 131 40 149 46 22 112 13 136 133 177 3 175 160 152 172 48 44 174 77 100 155 157 167 174 64 109 118 194 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\nThere are n incoming messages fo...
[{"type": "stdin_stdout", "input": "108 576 610 844 573\n242 134 45 515 430 354 405 179 174 366 155 4 300 176 96 36 508 70 75 316 118 563 55 340 128 214 138 511 507 437 454 478 341 443 421 573 270 362 208 107 256 471 436 378 336 507 383 352 450 411 297 34 179 551 119 524 141 288 387 9 283 241 304 214 503 559 416 447 49...
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 passing a test, Vasya got ...
[{"type": "stdin_stdout", "input": "3345775397705614178\n", "output": "131353216887383264\n"}, {"type": "stdin_stdout", "input": "2750054323692292581\n", "output": "107965550311522536\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "39259424579862572\n"}, {"type": "stdin_stdout", "input": "128...
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\nChang loves solving mathematical...
[{"type": "stdin_stdout", "input": "6195\n6403 3644 845 9973 9342 2675 9819 6604 8763 5321 5530 1171 9770 7107 5727 677 2077 256 9514 9348 4285 4305 5069 1015 6477 1333 8896 2733 9938 1828 3545 9795 3713 9844 1641 9924 2241 9322 8702 2197 4817 835 7531 5806 6708 8260 8476 1684 6443 9140 1428 5324 5096 6609 1587 4859 26...
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\nRakesh is very good in divisibil...
[{"type": "stdin_stdout", "input": "2\n1254756\n15\n1 7\n29490737\n132\n1 1\n\nSAMPEL", "output": "3\n0\n"}, {"type": "stdin_stdout", "input": "2\n2993708\n3\n1 7\n49610118\n250\n1 1\n\nSANPEL", "output": "13\n0\n"}, {"type": "stdin_stdout", "input": "2\n1323124\n10\n1 2\n130086802\n1\n2 9\n\nSAMPKE", "output": "0\n36\...
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 Fajlu and Laal Baadshah a...
[{"type": "stdin_stdout", "input": "43\n7878 11534 994 594 238 1250\n907 25648 745 699 879 2683\n5983 25441 152 1125 329 2446\n9953 39484 664 217 183 803\n25088 23845 164 1000 625 1234\n20871 43034 798 473 321 2156\n17429 14156 492 470 862 358\n31262 31081 898 244 666 1707\n18780 19848 167 620 545 150\n15265 6082 995 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\nLet there be a set of size N. \n...
[{"type": "stdin_stdout", "input": "1\n151\n\nQNMSBC", "output": "748722695\n"}, {"type": "stdin_stdout", "input": "1\n107\n\nCBSMNQ", "output": "932478769\n"}, {"type": "stdin_stdout", "input": "1\n174\n\nCBNMSQ", "output": "410728596\n"}, {"type": "stdin_stdout", "input": "1\n247\n\nCBNMSQ", "output": "422521524\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\nAtCoder currently hosts three ty...
[{"type": "stdin_stdout", "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 ...
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 tree with N vertices. ...
[{"type": "stdin_stdout", "input": "5\n1 2\n1 3\n2 4\n3 5", "output": "2 1 4 5 3 "}, {"type": "stdin_stdout", "input": "5\n1 2\n2 3\n2 4\n3 5", "output": "2 1 5 3 4 "}, {"type": "stdin_stdout", "input": "5\n1 3\n2 3\n2 4\n3 5", "output": "2 5 1 4 3 "}, {"type": "stdin_stdout", "input": "5\n1 2\n4 3\n2 3\n2 5", "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\nTakahashi and Aoki will take N e...
[{"type": "stdin_stdout", "input": "10 1000\n451 4593 6263\n324 310 6991\n225 1431 7068\n133 1757 4072\n204 3676 4328\n840 6600 9080\n415 1545 15200\n709 5467 8674\n862 6504 9835\n283 4965 9980", "output": "2373\n"}, {"type": "stdin_stdout", "input": "10 1000\n451 4593 6263\n324 310 9662\n378 1431 7068\n120 1757 9218\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 server in company A has a st...
[{"type": "stdin_stdout", "input": "10\n5 4 15 5 1 5 -1 10 -10 -20\n10 4\n5 6\n8 1\n9 5\n7 1\n10 3\n2 8\n2 10\n9 1", "output": "1\n"}, {"type": "stdin_stdout", "input": "10\n3 4 9 6 1 10 -1 10 -10 -10\n7 4\n5 6\n8 1\n9 5\n7 1\n10 3\n2 8\n4 10\n9 2", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n3 4 9 6 0 10 ...
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 two integers a and...
[{"type": "stdin_stdout", "input": "-3 -5", "output": "*\n"}, {"type": "stdin_stdout", "input": "11 -1", "output": "x\n"}, {"type": "stdin_stdout", "input": "15 -1", "output": "x\n"}, {"type": "stdin_stdout", "input": "29 -1", "output": "x\n"}, {"type": "stdin_stdout", "input": "13 -1", "output": "x\n"}, {"type": "stdi...
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\nAtCoDeer the deer has N cards wi...
[{"type": "stdin_stdout", "input": "6 20\n10 4 5 10 25 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 20\n10 4 5 10 25 3", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 20\n10 4 3 10 25 2", "output": "3"}, {"type": "stdin_stdout", "input": "1 586\n-1 2 1 -2 5", "output": "1\n"}, {"type": "stdin_std...
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 of the simple ciphers is the...
[{"type": "stdin_stdout", "input": "1\nx eazqyp pnop pngtg ye obmpngt xmybp mr lygw", "output": "p submit that there is another point of view\n"}, {"type": "stdin_stdout", "input": "1\nx pyqzae pnop pngtg ye obmpngt xmybp mr lygw", "output": "p timbus that there is another point of view\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\nYou have to organize a wedding p...
[{"type": "stdin_stdout", "input": "-2 1 -3 1 1 0 0 1\n1 -1 2 1 2 2 -1 3\n8", "output": "145\n0\n"}, {"type": "stdin_stdout", "input": "-2 1 0 1 1 0 1 3\n2 0 2 0 3 2 0 4\n10", "output": "173\n256\n"}, {"type": "stdin_stdout", "input": "-2 1 -2 1 1 0 1 2\n1 0 2 1 2 2 0 3\n5", "output": "145\n29\n"}, {"type": "stdin_stdo...
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\nMs. Iyo Kiffa-Australis has a ba...
[{"type": "stdin_stdout", "input": "700 300 200\n993 200 300\n244 200 500\n275 111 330\n275 010 385\n694 375 1747\n3 1 10010\n0 0 0", "output": "1 3\n100 495\n25 28\n21 55\n1 11\n163 297\n3336 2\n"}, {"type": "stdin_stdout", "input": "700 300 200\n500 283 300\n349 200 500\n275 110 330\n275 010 385\n1067 344 4002\n3 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\nThis is a story in a depopulated...
[{"type": "stdin_stdout", "input": "6\n5 2\n10 30 40 70 100\n7 3\n3 5 10 53 21 26 28\n1 1\n100\n2 1\n-1 1000000\n3 5\n30 70 211\n6 5\n0 10 20 30 40 50", "output": "60\n-23\n0\n1000001\n0\n10\n"}, {"type": "stdin_stdout", "input": "6\n5 2\n10 30 40 70 100\n7 3\n3 5 10 53 21 26 28\n1 1\n100\n2 1\n-1 1000000\n3 5\n30 70 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\nThe cave, called \"Mass of Darkn...
[{"type": "stdin_stdout", "input": "1 10\n3 3\nAAA\nABA\nCCC\n3\nA 0\nB 5\nC 14\n3\nD 2\nR 1\nU 2\n5\n10\n10\n10\n10\n10\n110 100\n10 10\nTHIRISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISISAPEN\nTHISJSAPEN\nTHISISAPEN\nNEPASISIHT\nTHISISAPEN\n8\nT 0\nH 2\nJ 2\nS 3\nA 4\nP 5\nE 6\nN 7\n9\nR 1\nD 1\nR 10\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\nTaro is an elementary school stu...
[{"type": "stdin_stdout", "input": "4\n1 2 3 4\n1 2 3 4\n1 2 3 4\n2 2 3 4\n1 2 3 4\n1 2 3 4\n1 2 3 4\n1 2 3 4\noooo\noooo\noooo\noooo", "output": "30\n12\n1 1 erase\n1 2 erase\n1 3 erase\n2 1 erase\n2 2 erase\n2 4 erase\n3 1 erase\n3 3 erase\n3 4 erase\n4 2 erase\n4 3 erase\n4 4 erase\n"}, {"type": "stdin_stdout", "inp...
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\nE-Election campaign\n\nProblem S...
[{"type": "stdin_stdout", "input": "2 1\n5\n10 4\n102 1\n15 19\n5 20\n-1 10\n20 7", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 1\n5\n18 4\n102 1\n15 19\n5 20\n-1 10\n20 7", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 1\n5\n18 4\n102 1\n15 19\n5 20\n-1 10\n20 7", "output": "1\n"}, {"type": "stdin_...
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\nLet $ f (x) $ be the ...
[{"type": "stdin_stdout", "input": "10830", "output": "13\n"}, {"type": "stdin_stdout", "input": "1663", "output": "10\n"}, {"type": "stdin_stdout", "input": "2604", "output": "11\n"}, {"type": "stdin_stdout", "input": "5020", "output": "12\n"}, {"type": "stdin_stdout", "input": "170", "output": "7\n"}, {"type": "stdin...
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 implement a doub...
[{"type": "stdin_stdout", "input": "9\ninsert 19\ninsert 2\ninsert 2\ninsert 0\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast", "output": "0 2 2\n"}, {"type": "stdin_stdout", "input": "9\ninsert 19\ninsert 3\ninsert 3\ninsert 0\ndelete 6\ninsert 6\ndeldte 5\ndeleteFirst\ndeleteLast", "output": "0 3 3\n"}, {"typ...
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 a chessboard with a width of ...
[{"type": "stdin_stdout", "input": "0 5\n1 192023486 84774294\n243235878 312125306 50510976\n326016273 338641867 50510976\n570999440 445224816 125759940\n456157384 569789185 50510976\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 5\n1 192023486 50510976\n243235878 312125306 50510976\n326016273 338641867 505...
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\nMaksim walks on a Cartesian plan...
[{"type": "stdin_stdout", "input": "39\n27 47\n30 9\n18 28\n49 16\n10 12\n25 13\n44 11\n13 9\n3 8\n30 2\n8 30\n38 32\n7 29\n38 43\n27 37\n6 13\n21 25\n31 18\n17 26\n51 52\n27 40\n10 43\n50 27\n41 41\n2 11\n38 45\n37 43\n20 52\n36 11\n43 46\n4 39\n22 32\n42 11\n8 37\n9 17\n38 8\n41 1\n24 50\n47 7\n", "output": "861\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\nInternational Coding Procedures ...
[{"type": "stdin_stdout", "input": "8\n< > << >> in out fun in>>out\n6\n# let's rock\nin>>out in >> out inout>>outin bin>>out # yay!\nfun>>in>>out funin>>out out>>in <in> > <out>\nin> >> >>> >>>> >>>>>out\n# what's going on here?\n<> <> <> <> <fun> <funfun> <not so fun>\n", "output": "in>>outin>> out a>>b c>>out fun>>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\nYou have a garland consisting of...
[{"type": "stdin_stdout", "input": "500\nRRGBBGGRRGGRRBGRGGGBRBBRRRGRBBGBGGGRBRGGGRBGBGRRRRGRBGBBBBRRGRGRBRBBRBGRRRRGGBRBRRRBGGRBGGGBRRGGGGBBRRBGGBGRBRRGGBRGGGRRGBGGRBGGGBBRRGBBGBGRBGRGRRRGGBGRGRRGBGBRGBRGRBGGBGRGGRRBGBRBBBBRBRRGBGGRGBBBGGGGGGRBGBBBBRBBRBGRBRGRGBBRRGBBGGRRBRRRGBGRGRRBBRRBRGGRRRRBRRGRBGGGBRRRRGBBRBGBRRR...
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, consisti...
[{"type": "stdin_stdout", "input": "100\nc\nda\na\nee\ned\ndb\nece\nab\nabe\nd\neeb\na\nbab\nbbd\nc\ncab\nc\nbda\ndb\ncca\nbcd\nbae\neb\nde\ndc\naee\nada\nba\nab\nde\ned\nae\nbc\nbec\ndae\nc\nb\ndab\nd\na\ndbd\nda\nb\ne\nde\nbe\nc\na\nb\nc\nbac\nee\nb\ncce\nc\nde\nc\ndee\ned\ncb\nb\ndc\ncc\na\neb\nec\nbcd\na\ndc\nf\nce...
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\nAlice bought a Congo Prime Video...
[{"type": "stdin_stdout", "input": "cbabacacacbabacababcabcbabacababcbcabacacacbababcbcacacbcbabcbcbabacacacabacbcbacacbcabacbcabcbabcbabababcaca\n", "output": "cabaaacbabcababcbcaacbabccaaaccbabbccaccbbabccaaaccbabcaacbcbabacbabcaaabac"}, {"type": "stdin_stdout", "input": "cbabacacacb`bacababcabcbabacababcbcabacacacba...
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 only difference between easy...
[{"type": "stdin_stdout", "input": "3\n5 2\nBGGGG\n5 3\nRBRGR\n5 5\nBBBRR\n", "output": "1\n0\n3\n"}, {"type": "stdin_stdout", "input": "3\n5 2\nBGGGG\n5 3\nRBRGR\n5 5\nBBRBR\n", "output": "1\n0\n2\n"}, {"type": "stdin_stdout", "input": "3\n5 3\nBGGGG\n5 3\nRBRGR\n5 5\nBBBRR\n", "output": "1\n0\n3\n"}, {"type": "stdin_...
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\nAuthors have come up with the st...
[{"type": "stdin_stdout", "input": "6 5\n5 6 1 2 3 4\n6 5 1 2 3 4\n", "output": "YES\nbcdeaa\n"}, {"type": "stdin_stdout", "input": "5 2\n5 2 4 3 1\n5 4 3 1 2\n", "output": "YES\nbbbba\n"}, {"type": "stdin_stdout", "input": "5 1\n1 3 2 4 5\n2 3 5 1 4\n", "output": "YES\naaaaa\n"}, {"type": "stdin_stdout", "input": "5 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\nConsider a tunnel on a one-way r...
[{"type": "stdin_stdout", "input": "7\n5 2 3 6 7 1 4\n2 3 6 7 1 4 5\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n3 5 2 1 4\n4 3 2 5 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2\n1 2\n1 2\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2\n1 2\n2 1\n", "output": "1\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\nBob watches TV every day. He alw...
[{"type": "stdin_stdout", "input": "3\n-1 -1\n13 93\n3 2\n", "output": "0\n16\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n15 93\n3 2\n", "output": "0\n17\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n19 93\n3 2\n", "output": "0\n16\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n9 93\n3 6\n", "outp...
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 the following experimen...
[{"type": "stdin_stdout", "input": "569716410 849619604 5000\n", "output": "122094144\n"}, {"type": "stdin_stdout", "input": "232213466 585535513 4789\n", "output": "454306758\n"}, {"type": "stdin_stdout", "input": "251134010 189925189 5000\n", "output": "103457138\n"}, {"type": "stdin_stdout", "input": "588636954 7308...
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 water tanks in a row...
[{"type": "stdin_stdout", "input": "65\n1000000 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\n", "output": "15416.615384615392\n15416.615384615392\n15416.615384615392\n15416.61538461...
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 bracketed sequence is called c...
[{"type": "stdin_stdout", "input": "101\n(())))))()))()())(()))((())))((())(()()()(()()((()()((()((())))((()))()(())(()(())((()))(()))()(((()(\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "101\n(())))))()))()())(()))((())))((())(()()()(()(*((()()((()((())))((()))()(())(()(())((()))(()))()(((()(\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\nKoa the Koala and her best frien...
[{"type": "stdin_stdout", "input": "4\n5\n4 1 5 1 4\n4\n1 0 1 12\n1\n0\n2\n5 4\n", "output": "LOSE\nWIN\nDRAW\nWIN\n"}, {"type": "stdin_stdout", "input": "4\n5\n4 1 4 1 4\n4\n1 0 1 12\n1\n0\n2\n5 0\n", "output": "LOSE\nWIN\nDRAW\nWIN\n"}, {"type": "stdin_stdout", "input": "4\n5\n4 1 4 1 4\n4\n1 0 1 12\n1\n0\n2\n5 4\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\nChaneka has a hobby of playing w...
[{"type": "stdin_stdout", "input": "2\n4 0 0 1\n0 0 1 0\n", "output": "Tidak Tidak Tidak Ya\nTidak Tidak Ya Tidak\n"}, {"type": "stdin_stdout", "input": "2\n4 0 0 1\n0 1 1 0\n", "output": "Tidak Tidak Tidak Ya\nTidak Ya Tidak Tidak\n"}, {"type": "stdin_stdout", "input": "2\n2 0 0 1\n0 1 0 0\n", "output": "Tidak Tidak T...
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\nFor a given sequence of distinct...
[{"type": "stdin_stdout", "input": "109\n74 18 237 179 195 112 156 11 72 68 173 202 78 250 224 251 107 55 186 144 57 62 28 210 132 64 93 6 211 0 174 163 248 226 167 246 46 102 253 180 121 56 151 35 150 254 168 201 242 118 190 158 196 30 75 116 187 96 215 244 192 73 12 175 33 222 131 256 181 230 114 165 128 234 63 90 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\nAlice and Bob are going to celeb...
[{"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n3 4\n1000000000 999999999 0 1\n", "output": "0 1 0 1 "}, {"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n3 4\n1000000000 999999999 0 2\n", "output": "0 1 0 1\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n1 4\n1000000000 999999999 0 2\n", "output": "0 0 0 0\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 playing the game \"Arran...
[{"type": "stdin_stdout", "input": "5\n6\n**.*..\n5\n*****\n3\n.*.\n3\n...\n10\n*.*...*.**\n", "output": "\n1\n0\n0\n0\n9\n"}, {"type": "stdin_stdout", "input": "5\n6\n..*.**\n5\n*****\n3\n.*.\n3\n...\n10\n*.*...*.**\n", "output": "1\n0\n0\n0\n9\n"}, {"type": "stdin_stdout", "input": "5\n6\n**..*.\n5\n*****\n3\n.*.\n3\...
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\nTo get money for a new aeonic bl...
[{"type": "stdin_stdout", "input": "5 10 15\nDdunkjly\n13 12 4\n83 26 1\n63 42 3\n83 22 2\n57 33 0\n59 10 1\n89 31 1\n57 17 2\n98 79 5\n46 41 3\nFbpbc\n28 21 0\n93 66 5\n66 21 0\n68 58 0\n59 17 3\n57 23 1\n72 71 1\n55 51 2\n58 40 5\n70 67 2\nKeiotmh\n73 44 4\n98 14 0\n19 7 0\n55 10 5\n30 25 4\n66 48 2\n66 51 4\n82 79 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\nLearn, learn and learn again — V...
[{"type": "stdin_stdout", "input": "100\n-88 -5 -96 -45 -11 -81 -68 -58 -73 -91 -27 -23 -89 -34 -51 -46 -70 -95 -9 -77 -99 -61 -74 -98 -88 -44 -61 -88 -35 -71 -43 -23 -25 -98 -23 0 -1 -80 -52 -47 -26 -92 -82 -73 -45 -37 -15 -49 -9 -7 -47 0 -6 -76 -91 -20 -58 -46 -74 -57 -54 -39 -61 -18 -65 -61 -19 -64 -93 -29 -82 -25 -...
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, little Vasya found hims...
[{"type": "stdin_stdout", "input": "129\n1 1 3 3 1 4 7 4 3 5 8 11 3 9 15 4 11 17 1 6 18 9 11 13 17 22 8 18 26 13 16 20 3 16 35 26 23 28 27 30 39 29 43 8 14 6 17 32 26 31 2 18 3 47 52 21 57 1 35 35 53 47 16 26 30 65 48 2 32 11 10 5 4 1 4 53 71 21 53 8 58 49 17 6 19 80 1 49 43 60 12 60 35 25 86 45 47 97 52 74 10 91 93 31...
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\nStudent Valera is an undergradua...
[{"type": "stdin_stdout", "input": "1\n1000000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1010000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1010000000 498441652\n", "output": "498441652\n"}, {"type": "stdin_stdout", "input": "1\n1000000000 115...
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 define a forest as a non-d...
[{"type": "stdin_stdout", "input": "19\n1 13\n0 0\n1 9\n1 11\n1 11\n2 3\n2 30\n0 -1\n1 5\n1 2\n0 0\n5 29\n1 6\n2 11\n0 0\n0 0\n0 0\n0 -1\n2 13\n", "output": "10\n0 13\n2 9\n3 11\n4 11\n8 5\n12 6\n13 11\n5 11\n6 18\n11 18\n\n"}, {"type": "stdin_stdout", "input": "19\n1 13\n0 0\n1 9\n1 11\n1 11\n2 3\n2 30\n0 -1\n1 5\n1 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\nOne day Vasya was sitting on a n...
[{"type": "stdin_stdout", "input": "1000000000000 999999999999\n", "output": "1000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000 999999999998\n", "output": "500000000000\n"}, {"type": "stdin_stdout", "input": "1370863279309 1265273992487\n", "output": "2167\n"}, {"type": "stdin_stdout", "input": "10555...
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\nVanya got bored and he painted n...
[{"type": "stdin_stdout", "input": "62\n-53 -58\n29 89\n-92 15\n-91 -19\n96 23\n-1 -57\n-83 11\n56 -95\n-39 -47\n-75 77\n52 -95\n-13 -12\n-51 80\n32 -78\n94 94\n-51 81\n53 -28\n-83 -78\n76 -25\n91 -60\n-40 -27\n55 86\n-26 1\n-41 89\n61 -23\n81 31\n-21 82\n-12 47\n20 36\n-95 54\n-81 73\n-19 -83\n52 51\n-60 68\n-58 35\n6...
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 string is called palindrome if...
[{"type": "stdin_stdout", "input": "wrwrwfrrfrffrrwwwffffwrfrrwfrrfrwwfwfrwfwfwffwrrwfrrrwwwfrrrwfrrfwrwwrwrrrffffwrrrwrwfffwrffrwwwrwww\n", "output": "fffffffffffffffrrrrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwrrrrrrrrrrrrrrrrrrfffffffffffffff\n"}, {"type": "stdin_stdout", "input": "wrwrwfwrfrffrrwwrffffwrfrrw...
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 all know the impressive story...
[{"type": "stdin_stdout", "input": "123 54564\n38 44 41 42 59 3 95 15 45 32 44 69 35 83 94 57 65 85 64 47 24 20 34 86 26 91 98 12 36 96 80 4 70 40 95 38 70 22 58 50 34 84 80 45 14 60 61 43 11 56 19 59 50 63 21 15 97 98 27 13 9 71 32 18 90 10 2 99 75 87 74 83 79 37 89 3 49 27 92 95 49 1 26 50 72 75 81 37 60 98 28 28 10 ...
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\nAlyona has a tree with n vertice...
[{"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n1 1000000000\n2 1000000000\n3 1000000000\n4 1000000000\n5 1000000000\n6 1000000000\n7 1000000000\n8 1000000000\n9 1000000000\n", "output": "1 1 1 1 1 1 1 1 1 0 "}, {"typ...
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 two integers n and...
[{"type": "stdin_stdout", "input": "866421317361600 26880\n", "output": "866421317361600"}, {"type": "stdin_stdout", "input": "999999961946176 63\n", "output": "999999961946176"}, {"type": "stdin_stdout", "input": "100000000000000 200\n", "output": "160000000000\n"}, {"type": "stdin_stdout", "input": "999999999999989 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\nAnton likes to play chess. Also ...
[{"type": "stdin_stdout", "input": "5\n999612104 999858319\n68705639 989393889\n297814302 732073321\n577979321 991069087\n601930055 838139173\n14\n109756300 291701768\n2296272 497162877\n3869085 255543683\n1508007702 820993688\n54005870 912134860\n1052 99089\n477043210 1124154939\n233115268 920170255\n575163323 7569045...
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\nNot so long ago the Codecraft-17...
[{"type": "stdin_stdout", "input": "101 14627 14479\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "186 18666 18329\n", "output": "23"}, {"type": "stdin_stdout", "input": "406 16527 16314\n", "output": "22"}, {"type": "stdin_stdout", "input": "424 10906 10346\n", "output": "13"}, {"type": "stdin_stdout", "inp...
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 watched TV-show where k...
[{"type": "stdin_stdout", "input": "20 20\n-1012 625 39 -1747 -1626 898 -1261 180 -876 -1417 -1853 -1510 -1499 -561 -1824 442 -895 13 1857 1860\n-1269013 -1270956 -1264151 -1266004 -1268121 -1258341 -1269574 -1271851 -1258302 -1271838 -1260049 -1258966 -1271398 -1267514 -1269981 -1262038 -1261675 -1262734 -1260777 -126...
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 all know that the Library of...
[{"type": "stdin_stdout", "input": "10 10\n8 1 1 6 10 2 2 9 7\n6 2 7 1 9 5 10\n1 5\n7 3 6 9 6 3 7 6\n10 3 9 10 3 6 7 10 6 9 6\n10 4 4 9 8 2 10 3 6 2 9\n8 4 8 6 4 6 4 8 6\n2 7 5\n6 8 6 2 1 9 8\n3 10 2 10\n", "output": "Yes\n3\n1 2 5 "}, {"type": "stdin_stdout", "input": "10 10\n8 1 1 6 10 2 2 9 7\n6 2 7 1 9 5 10\n1 5\n7...
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 Martian boy called Zorg want...
[{"type": "stdin_stdout", "input": "50 161245081749292\n", "output": "00101100010110000001101000110001001101000011000011\n"}, {"type": "stdin_stdout", "input": "50 250144743882708\n", "output": "01010101010010111011000010110101001100000110000101\n"}, {"type": "stdin_stdout", "input": "50 264823400156610\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\nPushok the dog has been chasing ...
[{"type": "stdin_stdout", "input": "100\nh\nshh\nh\nhs\nshh\nhh\nh\nssh\nhss\nh\nhh\nh\nh\nh\nh\nh\nh\nh\nh\nh\nhh\nh\nh\nh\nh\nhhh\nh\nh\nhhh\nsh\nhh\nhs\nh\nh\nshs\nh\nh\nh\nshh\nsh\nhs\nh\nh\nh\nhhh\nh\nhhs\nhh\nh\nssh\nh\nh\nhh\nsh\nh\nhss\nh\nhh\nsh\nhh\nhh\nhhh\nhs\nh\nh\nh\nshs\nhs\nshs\nsh\nh\nh\nhs\nh\nh\nh\nh...
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 dormitories in Berla...
[{"type": "stdin_stdout", "input": "3 10\n1010000000 1000000000 1000000000\n330201655 567869543 1000000000 1000000001 1500000000 1999999999 2000000000 2000000001 2754432345 3000000000\n", "output": "1 330201655\n1 567869543\n1 1000000000\n1 1000000001\n2 490000000\n2 989999999\n2 990000000\n2 990000001\n3 744432345\n3 ...
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 a fact for almost all th...
[{"type": "stdin_stdout", "input": "3\n113\n111\n1100\n\nFAONLS", "output": "-1 -1\n2 109\n523 577\n"}, {"type": "stdin_stdout", "input": "3\n104\n100\n1100\n\nSANPLE", "output": "43 61\n47 53\n523 577\n"}, {"type": "stdin_stdout", "input": "3\n100\n100\n1100\n\nSANPLE", "output": "47 53\n47 53\n523 577\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\nI and my flatmate ,Sayan, went t...
[{"type": "stdin_stdout", "input": "3\n402\n891 2508 4058 9592 3556 7829 9775 1638 6683 2202 4077 669 4776 3487 6231 5125 6495 9302 2328 6610 2696 3979 1937 6755 3373 6593 4975 8243 2180 9309 4923 4432 5621 5864 9653 3440 5886 7867 6927 5999 223 613 6208 9545 4036 806 8199 8377 2232 9144 6137 1237 9432 5986 3896 6935 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\nPuchi hates to carry luggage, bu...
[{"type": "stdin_stdout", "input": "1\n4\n2\n1\n4\n3\n\nSAMPLE", "output": "1 0 1 0\n"}]
code_stdio