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\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "12\nparapapapaaa\n", "output": "YES\n1 2\n"}, {"type": "stdin_stdout", "input": "12\nparap`papaaa\n", "output": "YES\n1 2\n"}, {"type": "stdin_stdout", "input": "12\nparaq`papaaa\n", "output": "YES\n1 2\n"}, {"type": "stdin_stdout", "input": "12\noaraq`papaaa\n", "output": "YES\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\nYou are playing a computer card ...
[{"type": "stdin_stdout", "input": "5\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 100\n1 1\n1 1\n", "output": "211\n"}, {"type": "stdin_stdout", "input": "5\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 2\n1 1\n1 1\n3\n1 100\n1 1\n1 1\n", "output": "212\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\nThis problem differs from the pr...
[{"type": "stdin_stdout", "input": "100\n463 6421 2912 1546 3999 5175 4357 2259 7380 6081 1148 7857 3532 4168 5643 8819 2568 6681 975 9216 4590 5217 6215 7422 6631 1651 39 4268 8290 2022 3175 8281 1552 980 9314 234 934 5133 6712 1880 2766 5042 5004 5455 6038 6010 6022 1553 4015 4544 3985 4033 223 7682 6302 2121 4832 39...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is playing with some stone...
[{"type": "stdin_stdout", "input": "64\n0 0 0\n0 0 1\n0 0 2\n0 0 3\n0 1 0\n0 1 1\n0 1 2\n0 1 3\n0 2 0\n0 2 1\n0 2 2\n0 2 3\n0 3 0\n0 3 1\n0 3 2\n0 3 3\n1 0 0\n1 0 1\n1 0 2\n1 0 3\n1 1 0\n1 1 1\n1 1 2\n1 1 3\n1 2 0\n1 2 1\n1 2 2\n1 2 3\n1 3 0\n1 3 1\n1 3 2\n1 3 3\n2 0 0\n2 0 1\n2 0 2\n2 0 3\n2 1 0\n2 1 1\n2 1 2\n2 1 3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPiet is one of the most known vi...
[{"type": "stdin_stdout", "input": "16 50000000\n33333885555555555199311111111\n33333885555555555199377777774\n33333965555555555166377777774\n99111112222222222166377777774\n55555555555555543423877777774\n55555555555555543423977777774\n55555555555555577777077777774\n55555555555555577777077777774\n55555555555555511111177...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 arrays of inte...
[{"type": "stdin_stdout", "input": "5\n4 5\n10 1 8 4\n1 2 3 4 5\n1 1\n3\n3\n1 1\n3\n1\n5 3\n1000 2 2 2 3\n3 1 5\n5 5\n1 2 3 4 5\n1 4 3 4 15\n", "output": "YES\n1 1\nYES\n1 3\nNO\nYES\n1 3\nYES\n1 1\n"}, {"type": "stdin_stdout", "input": "5\n4 5\n10 1 8 4\n1 2 3 4 5\n1 1\n3\n3\n1 1\n3\n1\n5 3\n1000 2 2 2 3\n3 1 5\n5 5\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\nValeric and Valerko missed the l...
[{"type": "stdin_stdout", "input": "1000 1 1000\n", "output": "999000\n"}, {"type": "stdin_stdout", "input": "1286 123 1043\n", "output": "9862\n"}, {"type": "stdin_stdout", "input": "1286 187 1043\n", "output": "6130\n"}, {"type": "stdin_stdout", "input": "1705 812 917\n", "output": "1009\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\nThe black king is standing on a ...
[{"type": "stdin_stdout", "input": "30 14 39 19\n31\n35 8 11\n37 11 12\n32 13 13\n30 5 6\n46 13 13\n37 14 14\n31 13 13\n43 13 19\n45 15 19\n46 13 13\n32 17 32\n41 14 19\n30 14 14\n43 13 17\n34 16 18\n44 11 19\n38 13 13\n40 12 20\n37 17 18\n45 16 18\n34 10 14\n36 9 10\n36 15 19\n33 15 19\n42 13 19\n33 14 15\n35 15 19\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\nManao works on a sports TV. He's...
[{"type": "stdin_stdout", "input": "30\n67 21\n85 39\n85 87\n21 39\n66 85\n10 95\n10 21\n87 85\n82 21\n67 21\n95 10\n21 39\n82 21\n21 66\n66 39\n95 30\n67 85\n66 82\n85 82\n21 66\n10 39\n67 10\n21 85\n10 82\n85 95\n10 85\n21 39\n85 39\n39 10\n95 67\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "30\n44 17\n4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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<image>\n\nInput\n\nThe first li...
[{"type": "stdin_stdout", "input": "MDJivQRiOIVRcCdkSuUlNbMEOkIVJRMTAnHbkVaOmOblLfignh\n25\n", "output": "MDJIVQRIOIVRCCDKSUULNBMEOKIVJRMTANHBKVAOMOBLLFIGNH"}, {"type": "stdin_stdout", "input": "aaaaAaaaaaaAAaaAaaAaAaaaAaaaaaAAaaAAAAAaaAaAAAAaAA\n6\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\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\nIn the rush of modern life, peop...
[{"type": "stdin_stdout", "input": "20 20\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n"}, {"type": "stdin_stdout", "input": "20 20\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nXenia the beginner mathematician...
[{"type": "stdin_stdout", "input": "2+2+1+1+1+3+1+1+3+3+2+3+1+3+1+1+3+1+1+2+2+2+2+1+2+1+2+1+1+1+3+1+3+2+3+2+3+3+1+1+1+2+3+2+1+3+1+3+2+2\n", "output": "1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+3+3+3+3+3+3+3+3+3+3+3+3+3+3\n"}, {"type": "stdin_stdout", "input": "2+3+3+1+2+2+2+1+1+2+1+3+2+2+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\nLevko loves array a1, a2, ... , ...
[{"type": "stdin_stdout", "input": "97 29\n2 78 82 356152\n2 14 29 430177\n1 59 84 3680\n1 49 89 -2247\n1 92 96 3701\n2 54 89 377271\n1 62 70 -507\n2 94 97 431563\n1 46 55 -9257\n1 51 83 1627\n1 10 20 6633\n1 17 34 -9263\n2 66 92 383251\n1 12 82 3884\n1 78 96 -5379\n2 13 35 424798\n1 68 91 2939\n2 80 84 214725\n1 61 85...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 bear decided to store some r...
[{"type": "stdin_stdout", "input": "100 9\n66 71 37 41 23 38 77 11 74 13 51 26 93 56 81 17 12 70 85 37 54 100 14 99 12 83 44 16 99 65 13 48 92 32 69 33 100 57 58 88 25 45 44 85 5 41 82 15 37 18 21 45 3 68 33 9 52 64 8 73 32 41 87 99 26 26 47 24 79 93 9 44 11 34 85 26 14 61 49 38 25 65 49 81 29 82 28 23 2 64 38 13 77 68...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Chris is participating in...
[{"type": "stdin_stdout", "input": "10 30\n10 4\n3 8\n3 2\n10 1\n3 5\n3 4\n5 1\n8 2\n8 4\n3 10\n7 9\n3 6\n9 5\n5 10\n7 6\n7 5\n9 1\n2 7\n9 10\n1 4\n9 11\n6 2\n2 1\n7 1\n6 4\n4 5\n2 9\n10 8\n7 8\n5 2\n", "output": "5 9 11\n9 7 6\n2 7 5\n6 2 9\n8 2 5\n3 8 7\n2 3 5\n4 3 6\n8 4 6\n10 4 5\n3 10 5\n9 10 8\n10 1 5\n9 1 4\n2 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\nThere are five people playing a ...
[{"type": "stdin_stdout", "input": "100 100 100 100 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "180 100 100 100 100\n", "output": "116\n"}, {"type": "stdin_stdout", "input": "203 100 101 000 101\n", "output": "101\n"}, {"type": "stdin_stdout", "input": "100 000 100 100 100\n", "output": "80\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNew Year is coming, and Jaehyun ...
[{"type": "stdin_stdout", "input": "50 60\n86 57 45 93 17 12 40 10 47 80 18 80 3 9 6 55 13 99 5 76 4 70 100 55 27 91 71 3 106 93 41 74 80 56 90 50 58 13 71 9 47 52 26 73 72 21 15 81 88 28\n40 32 5 16 49 23 3 17 14 10 1 15 1 21 28 22 13 45 12 25 44 48 46 32 36 43 11 8 49 7 7 35 10 14 39 4 42 10 30 27 1 17 31 15 6 41 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\nIn this problem you will meet th...
[{"type": "stdin_stdout", "input": "100\n*****************************)**********************************************************************\n", "output": "yes\n"}, {"type": "stdin_stdout", "input": "100\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\nYou are given a sequence of n in...
[{"type": "stdin_stdout", "input": "20\n-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0\n", "output": "113.875000000000043\n"}, {"type": "stdin_stdout", "input": "10\n-405 -230 252 -393 -390 -259 97 163 81 -129\n", "output": "702.333333333333712\n"}, {"type": "stdin_stdout", "input": "10\n-405 -230...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is working on a new pro...
[{"type": "stdin_stdout", "input": "+qlHEc2AuYy\nqlHE02AuYy:YYRwDc edNZgpE nGfOguRWnMYpTpGUVM aXDKGWo1GL1tHv9\n0Upwze6PcQNBcUovrqmIcPsG3hvy:yYuA2cEHlq oaNiKV49p[KatlVAx\nqlHEc2AuYy:zuCO6Opey L eu7lTwysaSk00zjpv zrDfbt8l ufHph\n+pErDMxgVgh\nsiLF1I:yYu@1cEHlq mmQbZtd8Ui7y 2vcax6yZBMhVdRD6Ahlq7MNCw\nqlHEc2AuYy:lz MFUNJ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWet Shark asked Rat Kwesh to gen...
[{"type": "stdin_stdout", "input": "1.0 200.44854766953543 1.0\n", "output": "y^x^z\n"}, {"type": "stdin_stdout", "input": "0.3 1.3846300094261417 0.6\n", "output": "y^z^x\n"}, {"type": "stdin_stdout", "input": "1.9430536186545981 0.5 0.8\n", "output": "x^z^y\n"}, {"type": "stdin_stdout", "input": "1.0235346849529432 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\nBearland has n cities, numbered ...
[{"type": "stdin_stdout", "input": "1001 1577\n698 459 326 404\n", "output": "698 326 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 late autumn evening n robots ...
[{"type": "stdin_stdout", "input": "4 6\n5 1000000000 1790978867 12\n", "output": "1790978867\n"}, {"type": "stdin_stdout", "input": "4 9\n5 1000000000 1766326397 19\n", "output": "1766326397\n"}, {"type": "stdin_stdout", "input": "4 9\n5 1000000000 1204240164 12\n", "output": "1204240164\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\nYou are given a permutation of t...
[{"type": "stdin_stdout", "input": "83 8\n54 3 52 12 61 36 65 62 69 49 47 77 31 15 21 14 73 29 6 26 37 17 81 75 43 30 58 76 16 8 11 5 27 35 7 66 50 67 2 39 45 28 60 71 38 82 53 1 42 13 44 72 22 4 9 25 19 57 10 70 18 68 32 34 20 80 23 79 24 63 64 51 59 41 74 48 40 33 46 83 55 56 78\n48 80\n1 8\n71 54\n15 59\n72 46\n36 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZS the Coder has drawn an undire...
[{"type": "stdin_stdout", "input": "7 9 999999999 0 3\n0 1 0\n1 2 0\n2 3 0\n0 4 1\n4 1 0\n1 5 499999999\n5 2 499999999\n2 6 1\n6 3 1\n", "output": "YES\n0 1 1\n1 2 999999996\n2 3 999999997\n0 4 1\n4 1 1000000000000000000\n1 5 499999999\n5 2 499999999\n2 6 1\n6 3 1\n"}, {"type": "stdin_stdout", "input": "7 9 999999999 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya is currently at a car rent...
[{"type": "stdin_stdout", "input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 209 362 128 157 336 162 77 90 96\n", "output": "1\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\nProgrammers' kids solve this rid...
[{"type": "stdin_stdout", "input": "1215860145\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1778707511\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "2062310696\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1438557036\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1805239711\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArpa is taking a geometry exam. ...
[{"type": "stdin_stdout", "input": "-947393823 -495674431 211535284 -877153626 -522763219 -778236665\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "-211700879 -495674431 211535284 -877153626 -522763219 -778236665\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-706921242 -758563024 -588592101 -4434...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDisclaimer: there are lots of un...
[{"type": "stdin_stdout", "input": "228\n1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 63 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 127 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 63 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 255 1 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\nYou are given an undirected grap...
[{"type": "stdin_stdout", "input": "12 58\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 10\n1 11\n1 12\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n2 11\n2 12\n3 4\n3 5\n3 6\n3 7\n3 8\n3 9\n3 10\n3 11\n3 12\n4 5\n4 6\n4 8\n4 11\n4 12\n5 6\n5 7\n5 8\n5 9\n5 10\n5 11\n6 7\n6 8\n6 9\n6 10\n6 11\n6 12\n7 8\n7 9\n7 10\n7 11\n7 12\n8 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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-gram is an ordered pair (i.e...
[{"type": "stdin_stdout", "input": "100\nURXCAIZFIBNJTPCZHBQIBCILLPXZCFGMKKZMNPLCYGAVJVIBMCZEBSJWPSCPQDYCTTKPOKIJRSKIZPDGCHVOUTMPNECYORSFZFNC\n", "output": "IB\n"}, {"type": "stdin_stdout", "input": "100\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\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\nAllen and Bessie are playing a s...
[{"type": "stdin_stdout", "input": "2 2\n0 1 2 3\n2 5\n0 4\n", "output": "1.5000000000\n2.2500000000\n3.2500000000\n"}, {"type": "stdin_stdout", "input": "2 2\n0 2 0 3\n2 0\n0 13\n", "output": "1.25\n1.25\n4.5\n"}, {"type": "stdin_stdout", "input": "2 2\n0 1 2 2\n2 2\n0 2\n", "output": "1.25\n1.25\n1.75\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\nThe bloodiest battle of World Wa...
[{"type": "stdin_stdout", "input": "36\n1 1 0 13 7 4 8 5\n-1 1 7 12 12 2 7 -1\n12 3 3 5 11 1 1 1\n11 1 2 1 0 11 0 3\n14 -1 4 22 16 5 -1 10\n1 0 10 0 11 10 0 1\n24 0 10 6 5 5 0 0\n13 0 20 5 0 1 7 6\n7 11 16 3 14 10 3 3\n3 6 1 10 4 11 3 1\n2 0 1 8 3 3 12 3\n7 8 0 18 4 -1 1 2\n5 2 4 2 5 5 7 0\n1 0 2 8 1 7 20 4\n2 5 11 1 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\nProfessor Sharma gives the follo...
[{"type": "stdin_stdout", "input": "8\n4 39\n7 12\n7 14\n7 38\n18 24\n14 12\n65 75\n27 26", "output": "Case 1: 94\nCase 2: 38\nCase 3: 57\nCase 4: 106\nCase 5: 25\nCase 6: 28\nCase 7: 6\nCase 8: 52\n"}, {"type": "stdin_stdout", "input": "8\n4 39\n7 12\n7 14\n7 38\n18 24\n14 12\n65 75\n31 26", "output": "Case 1: 94\nCas...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPowerShell had N natural numbers...
[{"type": "stdin_stdout", "input": "78 78\n-645462 -187679 693035 927066 431506 16023 -173045 698159 -334799 -687770 -747462 789670 726416 385513 579977 -156856 22209 378002 930156 353000 67263 -758921 572468 562437 125912 -422101 -513624 43409 25348 -214377 808094 -88292 566843 910587 -731480 -509056 901506 -374951 -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\nFind the number of integers betw...
[{"type": "stdin_stdout", "input": "9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3", "output": "117879300"}, {"type": "stdin_stdout", "input": "9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n2", "output": "40...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi went to an all-you-can...
[{"type": "stdin_stdout", "input": "4\n2 3 4 1\n13 10 9 24\n34 9 15", "output": "80\n"}, {"type": "stdin_stdout", "input": "4\n2 3 4 1\n14 10 1 70\n8 6 16", "output": "117\n"}, {"type": "stdin_stdout", "input": "4\n2 3 4 1\n13 5 9 24\n34 15 15", "output": "81\n"}, {"type": "stdin_stdout", "input": "4\n2 3 4 1\n13 5 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\nThere are N integers a_1, a_2, ....
[{"type": "stdin_stdout", "input": "1 1431379180228", "output": "1431379180228\n"}, {"type": "stdin_stdout", "input": "1 1472895801034", "output": "1472895801034\n"}, {"type": "stdin_stdout", "input": "1 1365467213485", "output": "1365467213485\n"}, {"type": "stdin_stdout", "input": "1 2203800626104", "output": "220380...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "11 7 5\n10227698 1631672198 623690081 433933447 476190629 262703497 147009374 971407775 628894325 210342416 520756664", "output": "423705749\n"}, {"type": "stdin_stdout", "input": "11 7 5\n10227698 1631672198 623690081 802524328 476190629 262703497 147009374 971407775 628894325 21034...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJoisino is planning to open a sh...
[{"type": "stdin_stdout", "input": "3\n1 1 1 1 1 1 0 0 1 1\n0 1 0 1 1 0 1 0 1 0\n1 0 1 1 0 0 0 1 0 1\n-8 6 -2 -11 -12 4 14 9 -6 2 2\n-9 2 0 1 7 -5 0 -2 -6 5 5\n6 -6 9 -9 12 -5 8 0 -9 -7 -7", "output": "33\n"}, {"type": "stdin_stdout", "input": "3\n1 1 1 1 1 1 0 0 0 0\n0 1 0 1 1 1 1 0 1 0\n1 0 1 1 0 1 0 1 0 1\n-8 6 -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\nMole decided to live in an aband...
[{"type": "stdin_stdout", "input": "15 22\n2 13 33418\n14 15 55849\n7 10 15207\n4 6 64328\n6 9 148835\n15 8 46978\n8 6 53526\n1 2 10537\n14 12 57469\n8 3 61543\n6 5 32425\n4 11 20932\n3 12 38234\n8 2 45333\n11 12 77796\n3 9 71922\n12 15 25507\n2 4 25485\n11 6 1259\n2 7 33363\n5 11 97843\n3 1 40491", "output": "137638"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has decided to play a game...
[{"type": "stdin_stdout", "input": "2 22\n1 9\n5 9\n4 5\n4 9\n0 1\n0 12\n2 4", "output": "2\n2\n2\n2\n2\n2\n2\n2\n2\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "2 18\n1 9\n5 9\n4 5\n4 9\n0 1\n0 12\n2 4", "output": "2\n2\n2\n2\n2\n2\n2\n2\n2\n0\n0\n0\n0\n0\n0\n0\n0\n0\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\nWe have a string X, which has an...
[{"type": "stdin_stdout", "input": "SSTTTSST", "output": "2\n"}, {"type": "stdin_stdout", "input": "TTTTSSSS", "output": "8\n"}, {"type": "stdin_stdout", "input": "TSSTTSST", "output": "2\n"}, {"type": "stdin_stdout", "input": "TTSTSSST", "output": "4\n"}, {"type": "stdin_stdout", "input": "SSTTSTST", "output": "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\nThere is a 120 minute videotape ...
[{"type": "stdin_stdout", "input": "1 36 0\n-1 -1 -1", "output": "00:24:00\n01:12:00\n"}, {"type": "stdin_stdout", "input": "0 30 0\n-1 -1 -1", "output": "01:30:00\n04:30:00\n"}, {"type": "stdin_stdout", "input": "0 32 0\n-1 -1 -1", "output": "01:28:00\n04:24:00\n"}, {"type": "stdin_stdout", "input": "1 16 0\n-1 -1 -1"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou want to go on a trip with a ...
[{"type": "stdin_stdout", "input": "10000\n1225 3150\n861 12737\n0 -1\n5000 1050\n5000 4211\n5000 412\n5000 5000\n5000 5000\n-1 -1\n5075 1951\n9143 2494\n5000 2100\n29170\n100000 000000\n100010 110000\n100000 100000\n100000 100000\n100100 100100\n100000 111000\n100000 100000\n101000 100000\n100000 100010\n100000 100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA trick of fate caused Hatsumi a...
[{"type": "stdin_stdout", "input": "1505 13 9\n2619 11 3", "output": "1114\n"}, {"type": "stdin_stdout", "input": "2137 -1 28\n1419 -2 1", "output": "719\n"}, {"type": "stdin_stdout", "input": "2137 -1 28\n1818 -1 1", "output": "320\n"}, {"type": "stdin_stdout", "input": "2137 -1 28\n3039 -1 1", "output": "902\n"}, {"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\nA new type of mobile robot has b...
[{"type": "stdin_stdout", "input": "3 5 10\nred\n0 0 0\n5 0 0\ngreen\n0 5 6\n5 6 1\nblue\n0 40 5\n5 0 0\n3 10 5\nbtom\n0 47 32\n5 -10 -7\n10 1 0\npluto\n0 0 0\n7 0 0\n10 3 3\ngesicht\n0 25 7\n5 -7 -2\n10 -1 10\n4 100 7\nimpulse\n0 -500 0\n100 10 1\nfreedom\n0 -491 0\n100 9 2\ndestiny\n0 -472 0\n100 5 4\nstrike\n0 -482 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 coordinates (a1, a2) and (b1...
[{"type": "stdin_stdout", "input": "1226 500 1 0 107 129", "output": "14190866\n"}, {"type": "stdin_stdout", "input": "912 500 2 -1 107 239", "output": "98025026\n"}, {"type": "stdin_stdout", "input": "500 500 -1 0 107 239", "output": "68765037\n"}, {"type": "stdin_stdout", "input": "1174 500 0 0 107 298", "output": "7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKM country has N kinds of coins ...
[{"type": "stdin_stdout", "input": "3\n6 11 24", "output": "0.090909090909"}, {"type": "stdin_stdout", "input": "3\n6 11 30", "output": "0.166666666667"}, {"type": "stdin_stdout", "input": "3\n6 11 12", "output": "0.090909090909"}, {"type": "stdin_stdout", "input": "3\n119 10 26", "output": "0.848739496\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\nFor a given polygon g, print \"1...
[{"type": "stdin_stdout", "input": "4\n-1 1\n25 -3\n1 0\n-1 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n25 -3\n1 -1\n-1 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n25 -3\n1 -1\n-1 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-1 2\n25 -3\n1 -1\n-1 1", "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\nWrite a program which reads a se...
[{"type": "stdin_stdout", "input": "11\n-2 0 10 -1 4 6 -1 2 14 10 21\n0\n-1 -1 0", "output": "-2 0 10 -1 4 6 -1 2 14 10 21\n"}, {"type": "stdin_stdout", "input": "11\n-2 0 16 -1 4 6 -1 2 14 10 21\n0\n-1 -4 0", "output": "-2 0 16 -1 4 6 -1 2 14 10 21\n"}, {"type": "stdin_stdout", "input": "11\n-1 0 10 -1 4 6 0 2 14 10 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\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\nYou are given an array a of n in...
[{"type": "stdin_stdout", "input": "7 33\n21 15 12 11 20 19 12\n", "output": "57\n"}, {"type": "stdin_stdout", "input": "7 20\n21 15 12 11 20 19 12\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "7 20\n2 15 12 11 20 19 12\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "7 20\n1 15 12 11 29 20 12\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\nEach item in the game has a leve...
[{"type": "stdin_stdout", "input": "5\nhs orb 830 875 879 3\nfudflb weapon 13 854 317 1\nwwvhixixe armor 500 285 382 2\nh orb 58 57 409 2\ny weapon 734 408 297 4\n12\nwvxwgjoera physician 55 hs\nusukedr sentry 41 hs\niu physician 100 hs\ngixlx gladiator 42 fudflb\nrd sentry 95 wwvhixixe\nbaff sentry 6 wwvhixixe\nwkhxou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChouti was tired of the tedious ...
[{"type": "stdin_stdout", "input": "4 4 2\n3 1\n1 2 1000000000\n2 3 1000000000\n3 1 1000000000\n3 4 1\n", "output": "1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "4 4 2\n3 1\n1 2 1000000000\n2 3 1000000001\n3 1 1000000000\n3 4 1\n", "output": "1000000000 1000000000\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\nDuring the archaeological resear...
[{"type": "stdin_stdout", "input": "2 12\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 3 a\n+ 2 a\n- 1\n- 3\n", "output": "YES\nYES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "2 11\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 1 a\n+ 2 a\n- 1\n- 3\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\nCengiz recently learned Fibonacc...
[{"type": "stdin_stdout", "input": "10\n669924290 408119795 804030560\n663737793 250734602 29671646\n431160679 146708815 289491233\n189259304 606497663 379372476\n707829111 49504411 81710658\n54555019 65618101 626948607\n578351356 288589794 974275296\n400531973 205638174 323247740\n219131617 178762989 799964854\n825160...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 math teacher gave you the f...
[{"type": "stdin_stdout", "input": "1\n10\n132182352 630066892\n906984407 923129673\n100213482 882571434\n191064823 398771294\n243750814 1483105037\n322757488 608184251\n241900265 682732740\n197067927 815099563\n17475338 866870249\n271628366 729808874\n", "output": "508213113\n"}, {"type": "stdin_stdout", "input": "1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou're given an array a_1, …, a_...
[{"type": "stdin_stdout", "input": "10\n1\n248618\n3\n23 21 11\n6\n110 11 15 10 1 14\n4\n0 2 1 0\n2\n0 0\n2\n0 1\n2\n1 0\n2\n1 0\n3\n0 1 0\n3\n1 0 1\n", "output": "YES\nYES\nYES\nYES\nNO\nYES\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "10\n1\n248618\n3\n23 21 11\n6\n110 11 15 0 1 14\n4\n0 2 1 0\n2\n0 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 want to perform the combo on...
[{"type": "stdin_stdout", "input": "3\n4 2\nabca\n1 3\n10 5\ncodeforces\n2 8 3 2 9\n26 10\nqwertyuioplkjhgfdsazxcvbnm\n20 10 1 2 3 5 10 5 9 4\n", "output": "4 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n\n0 0 9 4 5 3 0 0 0 0 0 0 0 0 9 0 0 3 1 0 0 0 0 0 0 0 \n\n2 1 1 2 9 2 2 2 5 2 2 2 1 1 5 4 11 8 2 7 5 1 10 1 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\nPolycarp has recently created a ...
[{"type": "stdin_stdout", "input": "1\n99\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\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\nThe statement of this problem is...
[{"type": "stdin_stdout", "input": "99\n3\n5\n7\n9\n11\n13\n15\n17\n19\n21\n23\n25\n27\n29\n31\n33\n35\n37\n39\n41\n43\n45\n47\n49\n51\n53\n55\n57\n59\n105\n63\n65\n67\n69\n71\n73\n75\n77\n79\n81\n83\n85\n87\n141\n91\n93\n95\n97\n57\n101\n103\n105\n107\n109\n111\n113\n115\n117\n119\n121\n123\n125\n127\n129\n131\n133\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 an integer n. In o...
[{"type": "stdin_stdout", "input": "7\n2\n2\n2\n12\n45568\n15116544\n387420489\n", "output": "-1\n-1\n-1\n-1\n-1\n12\n36\n"}, {"type": "stdin_stdout", "input": "7\n2\n2\n2\n17\n45568\n15116544\n387420489\n", "output": "-1\n-1\n-1\n-1\n-1\n12\n36\n"}, {"type": "stdin_stdout", "input": "7\n5\n2\n4\n17\n60902\n15116544\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\nYou are given an array a of n in...
[{"type": "stdin_stdout", "input": "32\n474784688 1134668429 -592758087 -662585781 997003198 333008394 111507813 985930436 -352098852 400811080 770280786 168025633 -258151427 726678951 914413742 -544810046 496546254 -749255284 -332401894 346164819 -207260314 68209011 940966817 -284672239 -655684691 845249877 -632338846...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOri and Sein have overcome many ...
[{"type": "stdin_stdout", "input": "20 7\n18525 35038\n15816 31586\n18641 46864\n35863 38632\n13563 35915\n41614 98684\n13573 35863\n25851 35985\n41687 55831\n31583 80871\n18525 35038\n15816 31586\n18641 46864\n35863 38632\n13563 35915\n41614 98684\n13573 35863\n25851 35985\n41687 55831\n31583 80871\n", "output": "4112...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 his wife's tragic death, E...
[{"type": "stdin_stdout", "input": "7\nbabba\nabaac\ncodeforces\nzeroorez\nabcdcba\nbbbbbbb\na\n", "output": "\n1\n1\n0\n1\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "7\nabbab\nabaac\ncodeforces\nzeroorez\nabcdcba\nbbbbbbb\na\n", "output": "1\n1\n0\n1\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "7\nabbab\nabaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation β€” is a sequence of...
[{"type": "stdin_stdout", "input": "3\n5\n3 5 2 1 4\n1\n1\n4\n4 3 1 2\n", "output": "\n1 0 2 3 1 \n0 \n0 1 3 2 \n"}, {"type": "stdin_stdout", "input": "3\n5\n3 5 1 2 4\n1\n1\n4\n4 3 1 2\n", "output": "1 0 3 2 1\n0\n0 1 3 2\n"}, {"type": "stdin_stdout", "input": "3\n5\n4 5 2 1 3\n1\n1\n4\n4 3 1 2\n", "output": "1 0 2 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\nIn some country live wizards. Th...
[{"type": "stdin_stdout", "input": "66\n7 0\n5 7\n1 3\n3 2\n3 5\n0 6\n1 2\n0 7\n4 5\n4 7\n5 1\n2 0\n4 0\n0 5\n3 6\n7 2\n6 0\n5 3\n6 6\n1 7\n5 6\n2 2\n3 4\n2 0\n5 3\n4 6\n6 1\n5 3\n100000000000 0000000000000000000\n0 1\n4 1\n2 6\n5 5\n4 5\n0 3\n3 7\n3 1\n1 0\n4 4\n1000000000000000000 100000000000\n12 6\n4 2\n7 5\n1 6\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\nFlatland is inhabited by pixels ...
[{"type": "stdin_stdout", "input": "2147483630 2147483642 2147483610\n", "output": " 2147483630\n"}, {"type": "stdin_stdout", "input": "1944219055 454183506 1369298327\n", "output": " 1944219055\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\nSome days ago, I learned the con...
[{"type": "stdin_stdout", "input": "1559681\n", "output": "3794080223197672320\n"}, {"type": "stdin_stdout", "input": "1362308\n", "output": "2528276952771261580\n"}, {"type": "stdin_stdout", "input": "1165938\n", "output": "1584981275574379920\n"}, {"type": "stdin_stdout", "input": "1001000\n", "output": "100299899299...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBerland Government decided to im...
[{"type": "stdin_stdout", "input": "60\n17 34\n46 22\n50 44\n46 33\n41 21\n31 33\n48 6\n38 19\n35 60\n2 24\n49 29\n7 53\n34 1\n19 55\n32 1\n22 42\n27 28\n4 53\n6 50\n21 34\n1 10\n12 36\n54 8\n16 13\n51 43\n45 51\n54 20\n13 31\n34 33\n49 33\n51 11\n59 34\n15 5\n59 28\n30 39\n13 30\n58 4\n34 14\n3 9\n19 34\n4 18\n26 48\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\nPolycarpus is sure that his life...
[{"type": "stdin_stdout", "input": "4000 2000 2219\n", "output": " 865711019"}, {"type": "stdin_stdout", "input": "4000 1244 4000\n", "output": " 344837886"}, {"type": "stdin_stdout", "input": "4000 1244 2881\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\nPavel loves grid mazes. A grid m...
[{"type": "stdin_stdout", "input": "19 20 196\n###.....##.#..#..##.\n####............##..\n###....#..#.#....#.#\n##....###......#...#\n.####...#.....#.##..\n.###......#...#.#.#.\n...##.#...#..#..#...\n.....#.....#..#....#\n.#.....##..#........\n.##....#......#....#\n....#.......#.......\n......##..#........#\n......#.#...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou all know the Dirichlet princ...
[{"type": "stdin_stdout", "input": "10000 1 1000000000\n", "output": "Masha\n\n"}, {"type": "stdin_stdout", "input": "1010 1 1000000000\n", "output": "Masha\n\n"}, {"type": "stdin_stdout", "input": "2635 2 1000000000\n", "output": "Masha\n\n"}, {"type": "stdin_stdout", "input": "1 30 1000000000\n", "output": "Missing\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\nJzzhu have n non-negative intege...
[{"type": "stdin_stdout", "input": "55\n0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9\n", "output": "621247139\n"}, {"type": "stdin_stdout", "input": "55\n0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 2 3 4 10 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter bracket sequences Arthur t...
[{"type": "stdin_stdout", "input": "39 3\n-5 1 -13 ? 2 -12 ? 3 -11 -2 4 -10 ? 5 -9 0 6 -8 ? 7 -7 ? 8 -6 5 9 -5 ? 10 -4 ? 11 -3 ? 12 -2 10 13 -1\n", "output": "-5 1 -13 -4 2 -12 -3 3 -11 -2 4 -10 -1 5 -9 0 6 -8 1 7 -7 2 8 -6 5 9 -5 6 10 -4 7 11 -3 8 12 -2 10 13 -1\n"}, {"type": "stdin_stdout", "input": "39 3\n-5 1 -13 ?...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 array A, consisting o...
[{"type": "stdin_stdout", "input": "40 4\n600000080 -199999981 -599999907 -199999935 -199999904 -599999919 200000022 600000032 600000046 -999999980 -199999917 600000027 200000075 -999999949 -599999911 -999999969 600000017 -199999999 -999999923 -599999924 600000091 -599999973 -599999936 600000011 -199999951 600000030 -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\nPeter got a new snow blower as a...
[{"type": "stdin_stdout", "input": "29 -999961 689169\n-999960 689169\n-999927 -938525\n-999735 -989464\n-993714 -997911\n-870186 -999686\n-796253 -999950\n-139940 -1023635\n969552 -999972\n985446 -999398\n992690 -997295\n999706 -973137\n999898 -848630\n999997 -192297\n999969 773408\n999495 960350\n1685305 981671\n9983...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently, Pari and Arya did some...
[{"type": "stdin_stdout", "input": "1000 1\n839 771\n", "output": "999\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 starts his own business...
[{"type": "stdin_stdout", "input": "30\n522692116 159\n589719489 488\n662495181 961\n915956552 470\n683572975 271\n498400137 480\n327010963 181\n200704287 367\n961198611 54\n978100746 208\n345455616 986\n106372142 876\n446972337 42\n309349333 200\n93462198 543\n167946793 318\n325598940 427\n121873339 459\n174934933 598...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIlya is an experienced player in...
[{"type": "stdin_stdout", "input": "xx..\n.oo.\nx...\noox.\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "x..x\n..oo\no...\nx.xo\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "xoox\n.xx.\no..o\n..xo\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "o.xx\nxo.o\n...o\n..x.\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\nStepan likes to repeat vowel let...
[{"type": "stdin_stdout", "input": "200\nmmffggzvuuzzlkafduueqocuybiiaaeeoiioouaaurccuqoouuooooooyjjtyyxxiipnoeufyuuoyxxhhkaaeoooxapauuoppzabuuoiiuuggcciissuugejjiirruummsiifaauyypauwoofiemzaeeeeeeiioozzttyyidaaaiggizzerkooooeeepueeauupathhb\n", "output": "mmffggzvuzzlkafdueqocuybiaeeoioouaurccuqoouoyjjtyxxipnoeufyuoyx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMister B once received a gift: i...
[{"type": "stdin_stdout", "input": "1000 500 500 1000 499\n", "output": "501\n"}, {"type": "stdin_stdout", "input": "1000 999 1000 1000 998\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000 500 500 1000 475\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "1000 999 1000 1000 948\n", "output": "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\nAlex, Bob and Carl will soon par...
[{"type": "stdin_stdout", "input": "100\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\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\nPetya and Vasya arranged a game....
[{"type": "stdin_stdout", "input": "92 69\n1 76\n1 14\n1 9\n0\n1 46\n1 80\n0\n0\n1 77\n0\n1 53\n1 81\n1 61\n1 40\n0\n1 20\n1 71\n1 24\n1 54\n1 82\n1 23\n0\n1 63\n1 25\n1 38\n1 68\n0\n1 65\n0\n1 76\n1 55\n1 87\n1 1\n1 37\n1 68\n1 30\n1 17\n1 19\n0\n1 16\n1 69\n0\n1 60\n1 86\n0\n1 44\n1 32\n1 10\n1 8\n0\n0\n0\n0\n0\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\nRoy is looking for Wobbly Number...
[{"type": "stdin_stdout", "input": "6\n11 1\n3 1\n5 100\n10 3\n12 5\n8 2\n\nSAMPLE", "output": "10101010101\n101\n-1\n1313131313\n151515151515\n12121212\n"}, {"type": "stdin_stdout", "input": "6\n20 2\n4 1\n5 100\n12 3\n4 5\n5 2\n\nSAMPLE", "output": "12121212121212121212\n1010\n-1\n131313131313\n1515\n12121\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\nIn code world all genders are co...
[{"type": "stdin_stdout", "input": "2\n4\n24\n\n\nFMPLBT", "output": "10\n190455156\n"}, {"type": "stdin_stdout", "input": "2\n17\n2\n\n\nSBMPME", "output": "211799312\n2\n"}, {"type": "stdin_stdout", "input": "2\n2\n17\n\n\nSLQAND", "output": "2\n211799312\n"}, {"type": "stdin_stdout", "input": "2\n2\n24\n\n\nANDQLS",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPrint the K-th element of the fo...
[{"type": "stdin_stdout", "input": "16", "output": "14\n"}, {"type": "stdin_stdout", "input": "24", "output": "15\n"}, {"type": "stdin_stdout", "input": "32", "output": "51\n"}, {"type": "stdin_stdout", "input": "-22", "output": "2\n"}, {"type": "stdin_stdout", "input": "-27", "output": "1\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\nWe have N balance beams numbered...
[{"type": "stdin_stdout", "input": "10\n1375710043 178537096\n1332309236 80797230\n164044598 544580992\n117241210 865935868\n383133839 231371336\n378371075 681212831\n304570952 16537461\n1789737664 267238505\n844917655 218662351\n662961957 100386692", "output": "1121712759 3406064155"}, {"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\nDiverta City is a new city consi...
[{"type": "stdin_stdout", "input": "010", "output": "0 1 2 7 45 512 9925 321381 15870550 1069877351\n1 0 4 14 90 1024 19850 642762 31741100 2139754702\n2 4 0 28 180 2048 39700 1285524 63482200 4279509404\n7 14 28 0 315 3584 69475 2249667 111093850 7489141457\n45 90 180 315 0 6144 119100 3856572 190446600 12838528212\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a KEYENCE str...
[{"type": "stdin_stdout", "input": "keyofscience", "output": "YES"}, {"type": "stdin_stdout", "input": "eeyofscienck", "output": "NO\n"}, {"type": "stdin_stdout", "input": "eeyofsciencj", "output": "NO\n"}, {"type": "stdin_stdout", "input": "eeyofscienci", "output": "NO\n"}, {"type": "stdin_stdout", "input": "eeyofscje...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 N positive integer...
[{"type": "stdin_stdout", "input": "7\n1387 1446 941 602 647 -2 1411", "output": "6425\n"}, {"type": "stdin_stdout", "input": "7\n850 1446 941 602 647 -2 1411", "output": "5888\n"}, {"type": "stdin_stdout", "input": "7\n850 1446 941 413 647 -1 453", "output": "4742\n"}, {"type": "stdin_stdout", "input": "7\n850 1446 94...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation p_1,...
[{"type": "stdin_stdout", "input": "9\n1 4 1 2 3 10 2 12 14", "output": "1\n"}, {"type": "stdin_stdout", "input": "9\n1 4 0 2 3 10 2 12 14", "output": "1\n"}, {"type": "stdin_stdout", "input": "9\n1 1 0 2 3 10 2 12 14", "output": "1\n"}, {"type": "stdin_stdout", "input": "9\n1 1 1 2 3 10 2 12 14", "output": "1\n"}, {"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\nImagine a game played on a line....
[{"type": "stdin_stdout", "input": "2 1100001000 1000000000\n0 1008716701", "output": "3100001000\n"}, {"type": "stdin_stdout", "input": "2 1000000000 1000000000\n1 199586132", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "2 1000001000 1000000000\n2 199586132", "output": "2000001000\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 20XX, the Aizu Chuo Road, whi...
[{"type": "stdin_stdout", "input": "2\n17 24\n4\n17 45\n2\n17 25\n7\n-1 35\n0", "output": "250\n1500\n"}, {"type": "stdin_stdout", "input": "2\n13 25\n6\n17 14\n4\n17 25\n7\n1 10\n0", "output": "1150\n1300\n"}, {"type": "stdin_stdout", "input": "2\n17 25\n4\n17 45\n4\n17 19\n7\n19 35\n0", "output": "250\n1300\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nChairman K is a regul...
[{"type": "stdin_stdout", "input": "3\n16 2\n358\n87\n1601\n010", "output": "108\n"}, {"type": "stdin_stdout", "input": "3\n16 2\n696\n77\n1150\n010", "output": "102\n"}, {"type": "stdin_stdout", "input": "3\n12 2\n200\n87\n1514\n010", "output": "122\n"}, {"type": "stdin_stdout", "input": "3\n12 2\n491\n77\n1150\n010",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nKND is a student prog...
[{"type": "stdin_stdout", "input": "3 2 3\n2 1 1\n2 1 1\n1 3 5", "output": "6.56688917825\n0.866025403784\n0.866025403784\n12.6033176764\n"}, {"type": "stdin_stdout", "input": "3 2 2\n2 1 1\n1 1 1\n1 3 16", "output": "5.44841509844\n0.866025403784\n1.29903810568\n29.6215145047\n"}, {"type": "stdin_stdout", "input": "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\nThe King of a little Kingdom on ...
[{"type": "stdin_stdout", "input": "5\nAJMP\naB33d\nE\n86AE\nAM\n-1\nMPJE\nWaEaETC302Q\nCP\nrTurnAGumdam1isdefferentf", "output": "33Bad\nAE86\n2-\nEC302QTWaEa\nTurnAGumdam0isdefferentfr\n"}, {"type": "stdin_stdout", "input": "5\nAJMP\naB33d\nE\n86AE\nMA\n-1\nMPJE\nWaEaETC302Q\nCP\nftnereffedsi1madmuGAnruTr", "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\nExample\n\nInput\n\nACM\n\n\nOut...
[{"type": "stdin_stdout", "input": "ABM", "output": "0\n"}, {"type": "stdin_stdout", "input": "BIB", "output": "2\n"}, {"type": "stdin_stdout", "input": "1MI", "output": "1\n"}, {"type": "stdin_stdout", "input": "MCA", "output": "0\n"}, {"type": "stdin_stdout", "input": "MAC", "output": "0\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\nA rabbit is playing a role-playi...
[{"type": "stdin_stdout", "input": "1\n-2 11 -1 -2\n11011 11101 11000 00111", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n-2 17 -1 -2\n11011 11101 11000 00111", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n-2 17 -1 -2\n11011 11101 11000 00011", "output": "-1\n"}, {"type": "stdin_stdout", "input...
code_stdio