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\nPandeyG, a brilliant tennis play...
[{"type": "stdin_stdout", "input": "2\n17\n11\n\nARMPLE", "output": "16\n10\n"}, {"type": "stdin_stdout", "input": "2\n16\n13\n\nTANPLF", "output": "15\n12\n"}, {"type": "stdin_stdout", "input": "2\n16\n12\n\nTANLPF", "output": "15\n11\n"}, {"type": "stdin_stdout", "input": "2\n146\n1\n\nSAMPLE", "output": "145\n0\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\nCompute A \\times B, truncate it...
[{"type": "stdin_stdout", "input": "1010000000000101 9.99", "output": "10089900000001008\n"}, {"type": "stdin_stdout", "input": "1010000000100101 9.99", "output": "10089900001000008\n"}, {"type": "stdin_stdout", "input": "1010000100000101 9.99", "output": "10089900999001008\n"}, {"type": "stdin_stdout", "input": "10100...
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\nSilver Fox is fighting with N mo...
[{"type": "stdin_stdout", "input": "3 -1 2\n156828556 1001000000\n100000000 1000101000\n114627287 1001010011", "output": "1501055506\n"}, {"type": "stdin_stdout", "input": "3 -1 2\n156828556 1001000000\n100000000 1000101000\n114627287 0001010011", "output": "1001055506\n"}, {"type": "stdin_stdout", "input": "3 -1 1\n86...
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 an integer N, we will choose...
[{"type": "stdin_stdout", "input": "-202", "output": "20503\n"}, {"type": "stdin_stdout", "input": "-158", "output": "12561\n"}, {"type": "stdin_stdout", "input": "-173", "output": "15051\n"}, {"type": "stdin_stdout", "input": "-174", "output": "15225\n"}, {"type": "stdin_stdout", "input": "-140", "output": "9870\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\nTakahashi and Aoki will play a g...
[{"type": "stdin_stdout", "input": "10 10 14\n4 3\n2 2\n9 4\n9 10\n7 7\n10 2\n10 10\n5 4\n3 4\n2 8\n6 4\n5 4\n5 8\n9 0", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 10 14\n4 3\n2 1\n7 3\n9 10\n7 7\n8 1\n10 10\n5 4\n2 4\n2 8\n6 4\n4 4\n9 6\n9 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 10 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\nSnuke is buying a bicycle. The b...
[{"type": "stdin_stdout", "input": "10000 10100 10000", "output": "20000\n"}, {"type": "stdin_stdout", "input": "10000 00100 10000", "output": "10100\n"}, {"type": "stdin_stdout", "input": "11000 10100 10000", "output": "20100\n"}, {"type": "stdin_stdout", "input": "11000 10110 10000", "output": "20110\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\nThere are two rectangles. The le...
[{"type": "stdin_stdout", "input": "100 600 200 300", "output": "60000"}, {"type": "stdin_stdout", "input": "100 600 200 6", "output": "60000\n"}, {"type": "stdin_stdout", "input": "100 480 244 6", "output": "48000\n"}, {"type": "stdin_stdout", "input": "100 169 362 6", "output": "16900\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\nThere are N rabbits, numbered 1 ...
[{"type": "stdin_stdout", "input": "5\n5 5 5 -1 2", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n5 5 5 -2 2", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 5 5 -1 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n5 5 5 -1 1", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 3 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\nRead a set of coordinates of thr...
[{"type": "stdin_stdout", "input": "1.0,0.0,-1.0,0.0,1.0,1.0\n1.0,0.0,0.0,-1.0,3.0,0.0\n0.0,1.0,0.0,-1.0,1.0,1.0", "output": "1.000000 -1.000000\n1.000000 2.000000\n-1.000000 1.000000"}, {"type": "stdin_stdout", "input": "1.0,0.0,-1.0,0.0,1.0,1.0\n1.0,0.0,0.0,-1.0,0.0,0.3\n0.0,1.0,0.0,-1.0,1.0,1.0", "output": "1.00000 ...
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\nHousing maker Yamada House has l...
[{"type": "stdin_stdout", "input": "5 4 6\n1 6\n2 4\n3 3\n4 4\n5 1\n6 2\n0 0 1 0 0\n0 0 0 2 0\n0 0 0 3 0\n0 4 5 0 6\n3 3 1\n1 9\n0 0 1\n0 0 0\n0 0 0\n4 4 4\n1 6\n2 2\n3 4\n4 4\n0 1 1 0\n0 0 0 2\n0 0 3 0\n0 4 0 0\n0 0 0", "output": "1 1 1 2 2\n1 1 1 2 2\n4 4 3 3 3\n4 4 5 6 6\n1 1 1\n1 1 1\n1 1 1\nNA\n"}, {"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\nWe arrange the numbers between 1...
[{"type": "stdin_stdout", "input": "1\n10\n13\n373", "output": "0\n0\n3\n20\n"}, {"type": "stdin_stdout", "input": "1\n175\n19\n12", "output": "0\n14\n4\n2\n"}, {"type": "stdin_stdout", "input": "1\n175\n19\n16", "output": "0\n14\n4\n0\n"}, {"type": "stdin_stdout", "input": "1\n12\n7\n115", "output": "0\n2\n2\n12\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 attempts to tell digits to ...
[{"type": "stdin_stdout", "input": "9\n60 140 200 300\n300 105 330 135\n330 135 250 215\n240 205 250 215\n298 167 285 154\n30 40 30 90\n30 90 150 90\n150 90 150 20\n30 40 150 78\n8\n320 20 300 98\n320 20 380 50\n380 50 438 330\n10 50 40 20\n10 50 110 150\n110 150 180 80\n40 20 37 17\n37 17 27 27\n20\n72 222 132 182\n20...
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 n numbers a0, a1, ..., an-...
[{"type": "stdin_stdout", "input": "19 14\n289383\n930886\n692777\n636915\n747793\n238335\n885386\n435847\n516649\n641421\n2 7 368690\n1 3 6\n0 2 6\n1 1 8\n0 0 9\n2 2 665123\n1 5 9\n0 2 8\n2 7 961393\n1 1 2", "output": "238335\n238335\n289383\n289383\n289383\n289383\n289383\n289383\n289383\n289383\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\nIn 21XX, humanity finally began ...
[{"type": "stdin_stdout", "input": "7 5 1 3 4\n1 2 10\n3 6 0\n2 4 5\n1 3 2\n1 4 12\n0 0 0 0 0", "output": "14\n"}, {"type": "stdin_stdout", "input": "6 5 1 2 4\n1 2 5\n4 3 5\n2 3 -1\n1 3 8\n1 4 36\n0 0 0 0 0", "output": "41\n"}, {"type": "stdin_stdout", "input": "6 5 1 3 4\n1 2 5\n3 3 5\n2 3 5\n1 3 8\n1 4 11\n0 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\nA brave princess in a poor count...
[{"type": "stdin_stdout", "input": "3 2 10\n1 2 13 6\n2 3 10 3\n3 2 10\n1 2 3 16\n2 3 9 7\n3 3 10\n1 3 17 6\n1 2 2 4\n2 3 9 19\n4 4 5\n1 3 13 5\n1 4 7 25\n2 3 8 2\n2 4 9 3\n0 0 0", "output": "6\n7\n4\n10\n"}, {"type": "stdin_stdout", "input": "3 2 10\n1 2 8 5\n2 3 10 0\n3 2 10\n1 2 3 8\n2 3 7 7\n3 3 10\n1 3 17 6\n1 2 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\nTaro, a junior high school stude...
[{"type": "stdin_stdout", "input": "6\nonetwo2\n-\nonetwo1\nonetwo2\n-\nonetwo1\n7\nv\ntopbottom2\nonetwo2\n-\nonetwo1\ntopbottom1\n-\n6\nbaz2\nfoo2\nbaz1v\nbar1\nfoo1\nbar1\n0", "output": "2\n3\n1\n5\n6\n4\n4\n5\n3\n6\n2\n1\n7\n4\n3\n1\n5\n2\n6\n"}, {"type": "stdin_stdout", "input": "6\nonetwo2\n-\nonetwo1\nonetwo1\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\nH: Mercy\n\nSanta Claus found a ...
[{"type": "stdin_stdout", "input": "2 1\n-14 0 2\n-3 -3", "output": "-28\n"}, {"type": "stdin_stdout", "input": "2 1\n-2 -1 2\n-3 -3", "output": "-6\n"}, {"type": "stdin_stdout", "input": "2 1\n-2 -2 2\n-3 -3", "output": "-8\n"}, {"type": "stdin_stdout", "input": "2 1\n-1 -8 2\n-1 3", "output": "-18\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\nProblem\n\nSatake doesn't like b...
[{"type": "stdin_stdout", "input": "3\n2 -1\n1 3\n-2 -1", "output": "439.6951535312\n"}, {"type": "stdin_stdout", "input": "3\n1 0\n0 1\n-2 -2", "output": "405.0000000000\n"}, {"type": "stdin_stdout", "input": "3\n1 1\n0 1\n-2 -1", "output": "386.5650511771\n"}, {"type": "stdin_stdout", "input": "3\n1 0\n0 1\n-2 0", "o...
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 given two circles $c1$ and $...
[{"type": "stdin_stdout", "input": "-26 -2 -2\n15 2 -1", "output": "4\n"}, {"type": "stdin_stdout", "input": "-26 -2 -2\n15 2 -2", "output": "4\n"}, {"type": "stdin_stdout", "input": "-26 -2 -1\n15 2 -2", "output": "4\n"}, {"type": "stdin_stdout", "input": "-26 -2 -1\n21 2 -2", "output": "4\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\nFor given two sequneces $A = \\\...
[{"type": "stdin_stdout", "input": "4\n2 0 3 10\n4\n-2 0 16", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n2 0 3 13\n6\n0 2 11", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n2 2 3 8\n4\n-1 -1 8", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n2 0 3 10\n4\n-2 0 8", "output": "0\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\nWho's interested in football?\nR...
[{"type": "stdin_stdout", "input": "3\n4\n3 7 1 4 2 4\n5\n7 4 3 3 1\n5\n4 3 2 2 0", "output": "4\nUNFIT\nUNFIT\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 -1 4 2 4\n5\n4 4 3 2 1\n5\n4 3 1 2 3", "output": "5\nUNFIT\n2\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 -1 4 2 1\n5\n4 4 3 2 1\n5\n4 0 1 2 3", "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\nLittle Paul wants to learn how t...
[{"type": "stdin_stdout", "input": "100\n5 5 2 4 5 4 4 4 4 2 5 3 4 2 4 4 1 1 5 3 2 2 1 3 3 2 5 3 4 5 1 3 5 4 4 4 3 1 4 4 3 4 5 2 5 4 2 1 2 2 3 5 5 5 1 4 5 3 1 4 2 2 5 1 5 3 4 1 5 1 2 2 3 5 1 3 2 4 2 4 2 2 4 1 3 5 2 2 2 3 3 4 3 2 2 5 5 4 2 5\n", "output": "1 2 1 2 3 1 2 1 2 1 2 1 2 1 2 3 2 1 3 2 1 2 1 3 2 1 2 1 2 3 1 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\nAlice has a birthday today, so s...
[{"type": "stdin_stdout", "input": "10 3\n0 1 1 0 1 0 0 2 -1 0\n1 4 1 2 -1 0 1 1 -1 1\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 10\n1 0 0 0 0 0 0 0 0 1\n0 0 0 0 0 0 0 0 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 3\n0 1 1 0 1 0 0 2 -1 0\n1 2 1 1 -1 0 1 1 0 1\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\nThere is a house with n flats si...
[{"type": "stdin_stdout", "input": "100\n0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 -1 1 0\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "100\n0 0 1 0 1 0 1 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\nAlyona has recently bought a min...
[{"type": "stdin_stdout", "input": "100 1986\n29 77 55 79 29 99 68 31 78 53 80 91 181 52 131 95 58 84 23 65 86 89 84 98 83 40 50 88 53 74 35 53 52 61 69 90 81 53 98 100 12 79 38 93 80 84 46 47 40 56 65 72 95 67 95 80 45 89 58 96 99 96 78 16 43 96 50 68 62 37 59 65 77 64 94 92 69 97 48 76 53 92 100 94 94 70 23 000 93 78...
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\n\nInput\n\nThe input consists ...
[{"type": "stdin_stdout", "input": "ALLALINITY\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "YTINILALLA\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "ALKALINITY\n", "output": "YES"}, {"type": "stdin_stdout", "input": "TNSCRAMBLE\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "TNSARCM...
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\nDora the explorer has decided to...
[{"type": "stdin_stdout", "input": "10 100\n4 51 22 73 78\n1 52\n5 49 74 100 14 80\n1 6\n2 98 128\n5 149 13 47 24 77\n6 47 57 11 24 117 94\n9 89 11 2 67 85 70 44 10 6\n7 12 9 92 30 10 39 70\n8 99 34 89 87 63 3 96 25\n", "output": "impossible\n"}, {"type": "stdin_stdout", "input": "10 100\n4 51 22 73 78\n1 52\n5 49 74 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 only difference between easy...
[{"type": "stdin_stdout", "input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
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": "50 15000\n142 -300\n20 -298\n560 -300\n1815 -292\n282 -297\n92 -293\n34 -284\n555 -299\n408 -293\n504 -284\n278 -284\n139 -582\n64 -298\n311 -293\n130 -293\n89 -298\n129 -294\n385 -295\n136 -288\n41 -293\n112 -290\n416 -295\n178 -294\n154 -300\n110 -300\n346 -299\n209 -294\n1394 -295...
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\nAlex decided to go on a touristi...
[{"type": "stdin_stdout", "input": "30 30\n81 86 81 91 90 100 98 89 96 97 88 99 68 23 82 107 94 80 99 67 70 90 81 74 91 100 92 89 74 98\n16 26\n20 3\n23 16\n17 27\n30 22\n18 23\n14 30\n25 4\n3 8\n18 9\n29 26\n27 21\n26 6\n10 7\n28 5\n1 30\n28 30\n12 15\n17 25\n26 15\n30 2\n5 15\n14 20\n10 4\n24 16\n8 7\n11 30\n19 8\n21...
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 will fancy any number as l...
[{"type": "stdin_stdout", "input": "1000000000 -1000\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "1000100000 -1000\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "1000000000 1000\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "1001000001 1000\n", "output": "18\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\nCreatnx has n mirrors, numbered ...
[{"type": "stdin_stdout", "input": "100\n60 79 48 35 18 24 87 1 44 65 60 78 11 43 71 79 90 6 94 49 22 91 58 93 55 21 22 31 7 15 17 65 76 9 100 89 50 96 14 38 27 87 29 93 54 12 99 35 27 51 36 44 6 26 91 1 53 8 49 63 18 4 31 55 95 15 77 1 16 98 75 26 26 43 2 11 18 70 3 65 11 74 64 69 26 54 9 51 25 82 98 12 90 75 19 23 78...
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\nIt's a walking tour day in SIS.W...
[{"type": "stdin_stdout", "input": "16\n4\nPPPP\n4\nAPPP\n4\nPAPP\n4\nAAPP\n4\nPPAP\n4\nAPAP\n4\nPAAP\n4\nAAAP\n4\nPPPA\n4\nAPPA\n4\nPAPA\n4\nAAPA\n4\nPPAA\n4\nAPAA\n4\nPAAA\n4\nAAAA\n", "output": "0\n3\n2\n2\n1\n1\n1\n1\n0\n2\n1\n1\n0\n1\n0\n0\n"}, {"type": "stdin_stdout", "input": "1\n100\nPAPPPAPAAPAAPAAPPAAAPPAPPAP...
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 USA Construction Operation (...
[{"type": "stdin_stdout", "input": "3\n4 4\n0 0 2 2\n2 1\n100 2\n1 14\n0\n", "output": "2\n101\n0\n"}, {"type": "stdin_stdout", "input": "3\n4 5\n0 0 0 2\n2 2\n110 2\n1 14\n0\n", "output": "1\n112\n0\n"}, {"type": "stdin_stdout", "input": "3\n4 4\n0 0 2 2\n2 1\n100 4\n1 23\n1\n", "output": "2\n101\n1\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\nDreamoon is a big fan of the Cod...
[{"type": "stdin_stdout", "input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n80 60 40 20\n", "output": "5\n101\n2\n2\n60\n"}, {"type": "stdin_stdout", "input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n61 60 40 20\n", "output": "5\n101\n2\n2\n61\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\nOrac is studying number theory, ...
[{"type": "stdin_stdout", "input": "5\n497347 19283\n2568 1000000000\n499979 123987\n93 19\n13 5\n", "output": "536584\n2000002568\n1247930\n132\n34\n"}, {"type": "stdin_stdout", "input": "5\n497347 19283\n2568 1000000000\n499979 202537\n93 19\n13 5\n", "output": "536584\n2000002568\n1405030\n132\n34\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\nAshish has an array a of size n....
[{"type": "stdin_stdout", "input": "10 4\n91239 51189 50977 96098 56330 55725 6448 7351 60071 93359\n", "output": "50977\n"}, {"type": "stdin_stdout", "input": "10 4\n91239 51189 50977 96098 56330 55725 6448 7351 82063 93359\n", "output": "50977\n"}, {"type": "stdin_stdout", "input": "10 4\n30551 51189 50977 96098 5633...
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 consist...
[{"type": "stdin_stdout", "input": "100\n74 88 64 8 9 27 63 64 79 97 92 38 26 1 8 4 2 64 53 62 24 82 76 40 48 58 40 59 3 56 35 37 0 30 93 71 14 97 49 37 96 59 56 55 70 88 77 99 51 55 71 25 10 31 26 50 61 18 35 55 49 33 86 25 65 74 137 99 5 27 2 9 67 29 76 68 66 22 68 59 63 16 62 25 35 57 63 35 41 68 86 22 91 67 61 3 92...
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\nMeka-Naruto plays a computer gam...
[{"type": "stdin_stdout", "input": "6\n879274 712902 672766 383030\n997653 839911 351405 69197\n31160 917403 281506 245835\n234837 489356 452352 448472\n382561 916024 805514 657373\n287796 831046 710305 568719\n", "output": "879274\n997653\n31160\n234837\n382561\n287796\n"}, {"type": "stdin_stdout", "input": "6\n879274...
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 loves lucky numbers very m...
[{"type": "stdin_stdout", "input": "44447774444474477747774774477777474774744744477444447777477477744747477774744444744777777777747777477447744774744444747477744744\n77777474477477747774777777474474477444474777477747747777477747747744474474747774747747444777474444744744444477477777747744747477\n", "output": "37\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\nA pair of positive integers (a,b...
[{"type": "stdin_stdout", "input": "9\n3 4\n2 100\n4 3\n50 3\n12 4\n69 420\n12345 6789\n123456 789\n12345678 9\n", "output": "\n1\n0\n2\n3\n5\n141\n53384\n160909\n36\n"}, {"type": "stdin_stdout", "input": "9\n3 6\n1 101\n11 6\n50 3\n12 4\n69 420\n12345 6789\n123456 789\n29238676 9\n", "output": "1\n0\n7\n3\n5\n141\n533...
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. Eac...
[{"type": "stdin_stdout", "input": "5 5 2\n2 0 2\n1 0 3 4\n2 2 4\n1 0 1 3\n2 4 2\n", "output": "\n2 4\n4 10\n1 3\n"}, {"type": "stdin_stdout", "input": "5 5 2\n2 0 2\n1 0 1 4\n2 2 4\n1 0 1 3\n2 4 2\n", "output": "2 4\n4 10\n1 3\n"}, {"type": "stdin_stdout", "input": "5 10 2\n2 0 2\n1 0 3 4\n2 2 4\n1 0 1 3\n2 4 2\n", "o...
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 learn as soon as possible the...
[{"type": "stdin_stdout", "input": "100\n13 71 16 92 25 53 97 63 70 83 51 16 51 84 5 10 54 89 18 95 48 29 82 27 84 68 7 4 65 99 95 37 26 24 24 39 3 44 74 7 75 32 27 24 73 48 72 15 46 75 91 94 19 44 77 23 94 88 51 84 72 95 75 55 80 47 58 13 87 88 25 2 89 81 72 36 7 42 16 59 32 75 58 61 44 96 36 48 88 49 53 91 13 1 37 87...
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've got a positive integer se...
[{"type": "stdin_stdout", "input": "23\n26988535 53977070 107954140 161931210 323862420 215908280 431816560 647724840 269885350 242896815 755678980 485793630 863633120 404828025 539770700 134942675 593747770 377839490 917610190 809656050 620736305 971587260 458805095\n", "output": "7"}, {"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\nYaroslav likes algorithms. We'll...
[{"type": "stdin_stdout", "input": "10\n448\n727\n1418\n278\n870\n913\n2072\n300\n36\n1312\n", "output": "0??<>1\n1??<>2\n2??<>3\n3??<>4\n4??<>5\n5??<>6\n6??<>7\n7??<>8\n8??<>9\n9??>>??0\n??<>1\n?0>>0?\n?1>>1?\n?2>>2?\n?3>>3?\n?4>>4?\n?5>>5?\n?6>>6?\n?7>>7?\n?8>>8?\n?9>>9?\n?>>??\n>>?\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\nOnce Bob got to a sale of old TV...
[{"type": "stdin_stdout", "input": "99 17\n-993 -1745 -959 -989 -991 -995 -976 -997 -990 -1000 -996 -994 -999 -354 -1000 -983 -979 -1000 -989 -968 -994 -992 -962 -1593 -999 -983 -991 -979 -995 -993 -973 -999 -995 -995 -999 -993 -995 -992 -947 -1000 -999 -998 -982 -988 -757 -993 -426 -988 -980 -990 -979 -976 -995 -999 -...
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 employees working in...
[{"type": "stdin_stdout", "input": "2 10\n2 2\n1 2 1\n3 1 1\n3 2 1\n3 1 1\n2 2\n3 1 2\n3 1 1\n3 2 1\n3 1 2\n", "output": "NO\nYES\nNO\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "2 10\n2 2\n1 2 1\n3 1 1\n3 1 1\n3 1 1\n2 2\n3 1 2\n3 1 1\n3 2 1\n3 1 2\n", "output": "NO\nNO\nNO\nYES\nNO\nYES\nYES\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\nEvery year a race takes place on...
[{"type": "stdin_stdout", "input": "76\n342 684 1027 1369 1711 2054 2396 2738 3081 3423 3765 4108 4450 4792 5135 5477 5819 6162 6504 6846 7189 7531 7873 8216 8558 8900 9243 9585 9927 10270 10612 10954 11297 11639 11981 12324 12666 13009 13351 13693 14036 14378 14720 15063 15405 15747 16090 16432 16774 17117 17459 17801...
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 loves geometric progres...
[{"type": "stdin_stdout", "input": "18 10\n10000000 100000000 1000000000 -10000000 -100000000 -1000000000 -10000000 -100000000 -1000000000 -10000000 -100000000 -1000000000 10000000 100000000 1000000000 10000000 100000000 1000000000\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "18 10\n10000000 100000000 1000...
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 protection of a popular prog...
[{"type": "stdin_stdout", "input": "12345\n", "output": "71232\n"}, {"type": "stdin_stdout", "input": "91537\n", "output": "27651\n"}, {"type": "stdin_stdout", "input": "13542\n", "output": "84443\n"}, {"type": "stdin_stdout", "input": "32036\n", "output": "82432\n"}, {"type": "stdin_stdout", "input": "71232\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\nMaria participates in a bicycle ...
[{"type": "stdin_stdout", "input": "24\n-10000 -10000\n-10000 9998\n9998 9998\n9998 -10000\n-6364 -10000\n-6364 6362\n6362 6362\n6362 -6364\n-2728 -6364\n-2728 2726\n2726 2726\n2726 -910\n908 -910\n908 908\n-910 908\n-910 -4546\n4544 -4546\n4544 4544\n-4546 4544\n-4546 -8182\n8180 -8182\n8180 8180\n-8182 8180\n-8182 -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\nAfter finishing eating her bun, ...
[{"type": "stdin_stdout", "input": "1000000 1000000\n", "output": "200000000000\n"}, {"type": "stdin_stdout", "input": "1000010 1000000\n", "output": "200002000000\n"}, {"type": "stdin_stdout", "input": "1000000 1892547\n", "output": "378509400000\n"}, {"type": "stdin_stdout", "input": "1000000 999999\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\nSanta Claus likes palindromes ve...
[{"type": "stdin_stdout", "input": "10 20\njvyxocgomfmrtllgmagp 13\ngvtjnyaofrswcnnifzfq 17\nqisxpseggpjfoijmqnel -5\nlenqmjiofjpggespxsiq 14\nqfzfinncwsrfoaynjtvg 14\ncaayidazlylxyisihdhx 14\npgamglltrmfmogcoxyvj 11\nxhdhisiyxlylzadiyaac 2\ntbirihfpjgbbtclpxwhv 19\nvhwxplctbbgjpfhiribt 10\n", "output": "109\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\nA tree is an undirected connecte...
[{"type": "stdin_stdout", "input": "15 1\n12 9\n13 7\n1 3\n10 4\n9 2\n2 15\n11 4\n2 14\n10 8\n6 7\n12 5\n8 7\n3 10\n10 2\n", "output": "346\n"}, {"type": "stdin_stdout", "input": "15 1\n12 9\n13 7\n1 3\n10 4\n9 2\n2 15\n11 4\n2 14\n10 8\n6 8\n12 5\n8 7\n3 10\n10 2\n", "output": "336\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\nAlthough Inzane successfully fou...
[{"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000\n10 3\n7 4\n2 6\n9 2\n5 10\n1 8\n7 8\n7 2\n10 6\n", "output": "-999999998\n"}, {"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -10000...
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\nKaren has just arrived at school...
[{"type": "stdin_stdout", "input": "19\n716981305 764655030 1148561420 914539062 853464027 317088317 653721289 239862203 605157354 943428394 261437390 821695238 312192823 432992892 547139308 121208111 1614663126 223751525 1084180198\n", "output": "399181927\n"}, {"type": "stdin_stdout", "input": "19\n469776209 76465503...
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\nDr. Evil is interested in math a...
[{"type": "stdin_stdout", "input": "1 1 1\n1107891008\n15017817\n1 1 821220804\n", "output": "1092873191\n1914093995\n"}, {"type": "stdin_stdout", "input": "1 1 1\n937982044\n179683049\n1 1 821220804\n", "output": "758298995\n1579519799\n"}, {"type": "stdin_stdout", "input": "1 1 1\n937982044\n320909280\n1 1 821220804\...
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 s consist...
[{"type": "stdin_stdout", "input": "gfliflgfhhdkceacdljgkegmdlhcgkcmlelmbbbmdddgdeeljjhgbbffmemmmjhebgkhadkdajabcjkcgbkgbaeacdedlkklfech\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "hceflkkldedcaeabgkbgckjcbajadkdahkgbehjmmmemffbbghjjleedgdddmbbbmlelmckgchldmgekgjldcaeckdhhfglfilfg\n", "output": "17\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 an array of n inte...
[{"type": "stdin_stdout", "input": "85\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 72 67 68 69 70 71 72 73 74 119 76 77 78 79 80 81 82 83 84 1\n", "output": "84\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\nPetya loves hockey very much. On...
[{"type": "stdin_stdout", "input": "100\nqn\nBE\nyN\nep\nPq\nXz\nLM\nEZ\ndb\nMn\nbn\nFe\nqA\nzc\nyq\npC\nyA\nWk\nYq\nrs\noD\nvD\nzW\nxZ\nbl\nur\nkf\ndf\nLS\nUW\nMy\nhR\nsh\nNh\nog\nCW\nor\nzo\nrO\nao\nXH\nDq\nKa\nlL\nYQ\nOh\nRZ\nAx\nta\nko\nDn\nNg\nNy\nDB\nYD\njO\nAp\nFT\noB\nNc\nwB\nHO\neW\nAc\nDr\nMt\nDf\nbF\nFP\nRa\...
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\nAkash singh is a student of Math...
[{"type": "stdin_stdout", "input": "4000\n740948\n2\n551\n1152761423221685\n618927954312\n3411\n874277931986\n286024865090\n613893446066184\n6378\n291359840\n6361542097\n7260\n657541200146071777\n335998182660\n8012509478351201\n406\n8984143988\n8778383\n107349\n510\n968348499255\n3374380880681989\n22828907815861\n425\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\nIt has been truly said that love...
[{"type": "stdin_stdout", "input": "10\n538 44358 10096 27262 6813 27707 34468 11993 10965 14760 \n1338 2767 2817 2255 2014 1757 795 1296 592 1197", "output": "558433\n"}, {"type": "stdin_stdout", "input": "10\n538 44757 10096 27262 6813 27707 34468 11993 1889 14760 \n1338 2767 2817 2255 2014 1757 1101 1296 592 2199", ...
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\nAn infinite army of ants is marc...
[{"type": "stdin_stdout", "input": "2\n8 -1 26\n5 -1 0\n\nRLMOAE", "output": "28\n"}, {"type": "stdin_stdout", "input": "2\n1 1 14\n6 -1 1\n\nEAOMLS", "output": "15\n"}, {"type": "stdin_stdout", "input": "2\n1 1 15\n13 0 0\n\nEAOMMS", "output": "16\n"}, {"type": "stdin_stdout", "input": "2\n1 0 -1\n24 1 -1\n\nSQNALD", ...
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\nOz and nakul have N robots, and ...
[{"type": "stdin_stdout", "input": "2\n1\n11\n2\n19 6\n\nSAMPLE", "output": "11\n108\n"}, {"type": "stdin_stdout", "input": "2\n1\n10\n2\n10 3\n\nELPMAS", "output": "10\n27\n"}, {"type": "stdin_stdout", "input": "2\n1\n1\n2\n10 14\n\nRAMPLE", "output": "1\n130\n"}, {"type": "stdin_stdout", "input": "2\n1\n6\n2\n15 13\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 ATM machine of State Bank of...
[{"type": "stdin_stdout", "input": "2\n3\n102\n1024\n123477\n3\n102\n1323\n123477\n\nSAMPLE", "output": "NO\nYES\n"}, {"type": "stdin_stdout", "input": "2\n3\n102\n1024\n123477\n3\n102\n2323\n123477\n\nSAMPLE", "output": "NO\nYES\n"}, {"type": "stdin_stdout", "input": "2\n3\n102\n996\n123477\n3\n102\n1034\n123477\n\nSA...
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 sequence A_1...
[{"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 0000000000 1000000000 1000000000 1000000000", "output": "5000000000\n"}, {"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000001000 1000000000 1000000000 0000000000 1000000000 1000000000 100...
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 points in a D-dimens...
[{"type": "stdin_stdout", "input": "-1 15\n-8 2 8 -1\n-18 2 1 2\n-2 10 22 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1 15\n-8 2 8 -1\n-18 2 2 2\n-2 10 22 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1 15\n-8 2 0 -1\n-18 2 2 2\n-2 10 22 -1", "output": "0\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\nThere is a square in the xy-plan...
[{"type": "stdin_stdout", "input": "1 -46 -103 12", "output": "-161 -92 -57 -150\n"}, {"type": "stdin_stdout", "input": "31 -41 -59 26", "output": "-126 -64 -36 -131"}, {"type": "stdin_stdout", "input": "1 -41 -59 26", "output": "-126 -34 -66 -101\n"}, {"type": "stdin_stdout", "input": "1 -46 -59 26", "output": "-131 -...
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 Japan, people make offerings ...
[{"type": "stdin_stdout", "input": "9\nG W W G P W P G G", "output": "Three"}, {"type": "stdin_stdout", "input": "8\nO Y W G Y W Y Y", "output": "Four\n"}, {"type": "stdin_stdout", "input": "8\nO Y W F Y W Y Y", "output": "Four\n"}, {"type": "stdin_stdout", "input": "8\nQ Y W G Y W Y Y", "output": "Four\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\nYou are given two positive integ...
[{"type": "stdin_stdout", "input": "123456789012345678901234567890\n54295952540662239241952312402", "output": "GREATER\n"}, {"type": "stdin_stdout", "input": "123456789012345678901234567890\n67478580391614097833417622355", "output": "GREATER\n"}, {"type": "stdin_stdout", "input": "123456789012345678901234567890\n127408...
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 reverses a...
[{"type": "stdin_stdout", "input": "w32njmda", "output": "admjn23w\n"}, {"type": "stdin_stdout", "input": "admjn23w", "output": "w32njmda\n"}, {"type": "stdin_stdout", "input": "acmjn23w", "output": "w32njmca\n"}, {"type": "stdin_stdout", "input": "3cmjn2aw", "output": "wa2njmc3\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\nExample\n\nInput\n\n1+2*3+4\n11\...
[{"type": "stdin_stdout", "input": "4+1*3+0\n104", "output": "I\n"}, {"type": "stdin_stdout", "input": "4+1*3+0\n102", "output": "I\n"}, {"type": "stdin_stdout", "input": "0+3*1+4\n104", "output": "I\n"}, {"type": "stdin_stdout", "input": "0+3*1+4\n129", "output": "I\n"}, {"type": "stdin_stdout", "input": "3*1+0*4\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\nF: Multiplication is fun --Multi...
[{"type": "stdin_stdout", "input": "3 3.9884088227062082\n4.1091643442474926\n2.4255254960412556\n3.5822804934056625\n5.345178229082616\n3.4110023092801276\n4.814519106855367", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 2.7392730443507527\n3.4955293017360702\n2.1596061630199546\n2.4656347357978543\n4.322234...
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 likes numbers that are ...
[{"type": "stdin_stdout", "input": "1000000000000000000000000000000000\n", "output": "33\n"}, {"type": "stdin_stdout", "input": "1000010000000000000000000000000000\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "1000010000000001000000000000000000\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "10000...
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 problemset consi...
[{"type": "stdin_stdout", "input": "9\n4 6 9 12 100 150 200 400 800\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n4 6 9 12 100 150 200 400 612\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n4 2 9 12 100 150 200 400 612\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n1 2 5 11 12 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 rainy gloomy evening when al...
[{"type": "stdin_stdout", "input": "20\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "010\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "011\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "001\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "12\n", "output": "4\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\nYou are given an undirected unwe...
[{"type": "stdin_stdout", "input": "12\n8 7\n2 3\n3 4\n4 5\n5 2\n6 7\n7 8\n8 6\n1 0\n2 1\n1 2\n3 3\n1 2\n2 3\n1 3\n3 2\n2 3\n3 1\n4 4\n1 2\n2 3\n3 4\n4 1\n4 4\n1 2\n2 3\n3 1\n4 1\n6 9\n1 4\n1 5\n1 6\n2 4\n2 5\n2 6\n3 4\n3 5\n3 6\n100000 0\n1000 5\n55 56\n56 57\n57 58\n58 59\n59 55\n11 11\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\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\nReading books is one of Sasha's ...
[{"type": "stdin_stdout", "input": "tttdddssstttssstttdddddddddttttttdddsssdddtttsssdddsssssstttddddddtttdddssstttsssttttttdddtttsssssstttssssssssstttsssssstttssstttdddddddddsssdddssssssdddssstttsssdddssstttdddttttttdddddddddsssssstttdddtttssssssdddddddddttttttdddtttsssdddssstttsssdddssssssdddsssdddddddddtttssstttsssss...
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 given in two edi...
[{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 10 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 21 125 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\nAmugae has a hotel consisting of...
[{"type": "stdin_stdout", "input": "100\nLLLLLLLLLL0L2L48LL6L7L7L0L3L0L63LL3L4L9L2L7L6L3L8L2L5L9L0L3L3L9L3L3L3L5L2L2L2L1L8L5L7L9L2L05L0LL6L2L\n", "output": "1111111111\n"}, {"type": "stdin_stdout", "input": "100\nRRLLLLLLRR1R7R3L2R0L52RR2R4L1L7L6R4R0R4L5L4L5R2R8L7R0R6R4R8L6L8L4R5R7R3L9R7L64RR8L0R6R4R9L0R9R7R7R0L\n", "o...
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\nSanta has n candies and he wants...
[{"type": "stdin_stdout", "input": "5\n5 3\n19 4\n12 7\n10 2\n100001 44619\n", "output": "4\n18\n10\n10\n100001\n"}, {"type": "stdin_stdout", "input": "5\n5 3\n12 4\n12 7\n10 2\n100001 44619\n", "output": "4\n12\n10\n10\n100001\n"}, {"type": "stdin_stdout", "input": "5\n10 2\n1 11\n5 11\n11 1\n110001 90586\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\nLet LCM(x, y) be the minimum pos...
[{"type": "stdin_stdout", "input": "69\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\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 n barrels lined up in a...
[{"type": "stdin_stdout", "input": "2\n4 1\n19 5 2 5\n3 2\n0 0 1\n", "output": "24\n1\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n5 16 5 5\n3 2\n0 0 1\n", "output": "21\n1\n"}, {"type": "stdin_stdout", "input": "2\n4 3\n10 1 1 2\n3 2\n0 1 1\n", "output": "14\n2\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n5 16 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\nNezzar has a binary string s of ...
[{"type": "stdin_stdout", "input": "4\n5 2\n00000\n00111\n1 5\n1 3\n2 1\n00\n01\n1 2\n10 6\n1111111111\n0110001110\n1 10\n5 9\n7 10\n1 7\n3 5\n6 10\n5 2\n10000\n11000\n2 5\n1 3\n", "output": "\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\n5 2\n00000\n00111\n1 5\n1 3\n2 1\n00\n01\n1 2\n10 6\n1111111111\n0...
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 tree with n node...
[{"type": "stdin_stdout", "input": "2\n4\n0 1\n0 2\n2 3\n2\n1 0\n", "output": "\n1 2 1 1 1 \n0 0 1 \n"}, {"type": "stdin_stdout", "input": "2\n4\n0 1\n1 2\n2 3\n2\n1 0\n", "output": "3 0 1 1 1\n0 0 1\n"}, {"type": "stdin_stdout", "input": "2\n4\n0 1\n1 2\n1 3\n2\n1 0\n", "output": "3 0 2 1 0\n0 0 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\nOne popular website developed an...
[{"type": "stdin_stdout", "input": "10\nbcbccaacab\n40\n37 c\n21 a\n18 a\n5 b\n1 a\n8 c\n9 a\n38 c\n10 b\n12 c\n18 a\n23 a\n20 c\n7 b\n33 c\n4 c\n22 c\n28 c\n9 a\n12 a\n22 a\n1 b\n6 a\n31 c\n19 b\n19 a\n15 a\n6 c\n11 c\n18 b\n19 c\n24 c\n13 a\n16 c\n2 c\n12 b\n8 a\n14 c\n18 b\n19 c\n", "output": "cbcaabbccaaabbcccacabb...
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 square matrix A wi...
[{"type": "stdin_stdout", "input": "100\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "89\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "91\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "76\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "80\n", "output": "13\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\nConsider the following equation:...
[{"type": "stdin_stdout", "input": "14\n", "output": " 373391776\n"}, {"type": "stdin_stdout", "input": "38\n", "output": " 90046024\n"}, {"type": "stdin_stdout", "input": "25\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 is a straight snowy road, ...
[{"type": "stdin_stdout", "input": "17\n.......RRRRR.....\n", "output": "8 13\n"}, {"type": "stdin_stdout", "input": "17\n.....RRRRR.......\n", "output": "6 11\n"}, {"type": "stdin_stdout", "input": "17\n......RRRRR......\n", "output": "7 12\n"}, {"type": "stdin_stdout", "input": "13\n....LLLLLL...\n", "output": "10 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\nValera is a lazy student. He has...
[{"type": "stdin_stdout", "input": "233 100 1\n2 2 1 1 1 2 2 2 2 1 1 2 2 2 1 2 2 1 1 1 2 2 1 1 1 1 2 1 2 2 1 1 2 2 1 2 2 1 2 1 2 1 2 2 2 1 1 1 1 2 1 2 1 1 2 1 1 2 2 1 2 1 2 1 1 1 1 1 1 1 1 1 2 1 2 2 2 1 1 2 2 1 1 1 1 2 1 1 2 1 2 2 2 1 1 1 2 2 2 1 1 1 1 2 1 2 1 1 1 1 2 2 2 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 2 2 1 2 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\nYou will receive 5 points for so...
[{"type": "stdin_stdout", "input": "LEHLLLLLLHAFGEGLLHAFDLHHMLLLLDGGEHGGHLLLLLLLLDFLCBLLEFLLCBLLCGLEDLGGLECLDGLEHLLLGELLLEGLLLLGDLLLDALD\n", "output": "47\n"}, {"type": "stdin_stdout", "input": "LEHLLLLLLHAFGEGLLHAFDLHHMLLKLDGGEHGGHLLLLLLLLDFLCBLLEFLLCBLLCGLEDLGGLECLDGLEHLLLGELLLEGLLLLGDLLLCALD\n", "output": "45\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\nNot so long ago company R2 bough...
[{"type": "stdin_stdout", "input": "100 99 1 2\n2 1 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 2 2 2 2 1 1 1 1 1 2 1 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 1 2 2 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 2 1 1 0 1 1 2 2 2 1 1 1 1 2 2 2 2 1 1 2 2 2\n", "output": "Incorrect\n"}, {"type": "stdin_stdout", "input": "100 99 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\nVasya thinks that lucky tickets ...
[{"type": "stdin_stdout", "input": "10\n146767769 71795210 50866429 35232438 22664883 56785812 91050433 75677099 84393937 43832346\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n146767769 71795210 50866429 35232438 22664883 56785812 91050433 75677099 18053121 43832346\n", "output": "4\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\nVasya had two arrays consisting ...
[{"type": "stdin_stdout", "input": "5 5\n260683318 260683321 260683319 260683318 260683319\n207210837 207210840 207210838 207210837 207210838\n83257083 83257086 83257084 83257083 83257084\n142444898 142444901 142444899 142444898 142444899\n129630806 129630809 129630807 129630806 129630807\n", "output": "YES\n260683322\...
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\nMarina loves strings of the same...
[{"type": "stdin_stdout", "input": "100 85\njknccpmanwhxqnxivdgguahjcuyhdrazmbfwoptatlgytakxsfvdzzcsglhmswfxafxyregdbeiwpawrjgwcqrkbhmrfcscgoszf\nhknccpmanwhxjnxivdggeahjcuyhdrazmbfwoqtatlgytdkxsfvdztcsglhmssfxsfxyrngdbeiwpawrjgwcqrkbhmrfcsckoskf\n", "output": "aaaaaaabaaaaaaaaaaaaabaaaaaaaabaaaaaaaabaaaaabaaaaaaaaaaaa...
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": "69 1701\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzy\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax"}, {"type": "stdin_stdout", "input": "69 465\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzy\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 girl Taylor has a beautiful ...
[{"type": "stdin_stdout", "input": "105311\n", "output": "105322\n"}, {"type": "stdin_stdout", "input": "99988\n", "output": "100016"}, {"type": "stdin_stdout", "input": "99996\n", "output": "100024"}, {"type": "stdin_stdout", "input": "99999\n", "output": "100010"}, {"type": "stdin_stdout", "input": "19779\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\nTreeland is a country in which t...
[{"type": "stdin_stdout", "input": "35 15\n6 12 32 18 11 10 29 9 30 27 31 14 8 24 28 25 19 15 21 3 4 1 33 22 23 17 16 13 7 2\n1 2\n20 3\n1 4\n20 5\n20 6\n1 7\n13 8\n4 9\n1 10\n1 11\n1 12\n1 13\n18 14\n10 15\n1 16\n16 17\n1 18\n1 19\n1 20\n20 21\n1 22\n27 23\n25 24\n1 25\n20 26\n20 27\n18 28\n4 29\n13 30\n4 31\n1 32\n20...
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 an interactive problem. ...
[{"type": "stdin_stdout", "input": "3\n-1 0 1\n4 7 0\n-1 -1 4\n2 0 8\n0 5 2", "output": "2\n1 3\n1\n2\n2\n1 2\n1\n3\n3\n1 2 3\n3\n1 2 3\n3\n1 2 3\n3\n1 2 3\n3\n1 2 3\n3\n1 2 3\n3\n1 2 3\n3\n1 2 3\n-1\n2 0 0\n"}, {"type": "stdin_stdout", "input": "3\n-1 0 1\n4 7 0\n-1 -2 4\n2 0 8\n0 5 2", "output": "2\n1 3\n1\n2\n2\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\nIn the army, it isn't easy to fo...
[{"type": "stdin_stdout", "input": "50 2\nYES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES\n", "output": "Aa Ab Ac Ad Ae Af Ag Ah Ai Aj Ak Al Am An Ao Ap Aq Ar As At Au Av A...
code_stdio