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\nOne day Vitaly was going home la...
[{"type": "stdin_stdout", "input": "100 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 0\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\n0 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 0\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\nYou are given an array $a_1, a_2...
[{"type": "stdin_stdout", "input": "3\n123456789 214365879 987654321\n", "output": "582491518\n"}, {"type": "stdin_stdout", "input": "2\n1 1000000000\n", "output": "999999988\n"}, {"type": "stdin_stdout", "input": "8\n6 4 5 8 2 9 10 7\n", "output": "2432\n"}, {"type": "stdin_stdout", "input": "8\n3 8 10 6 7 5 2 9\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\nOld timers of Summer Informatics...
[{"type": "stdin_stdout", "input": "20 4\n1\n1\n1\n1\n1\n2\n2\n2\n2\n2\n3\n3\n3\n3\n3\n4\n4\n4\n4\n4\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "16 4\n1\n1\n1\n1\n1\n2\n2\n2\n2\n2\n3\n3\n3\n3\n4\n4\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "16 6\n1\n1\n1\n2\n2\n2\n3\n3\n3\n4\n4\n4\n5\n5\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\nSome large corporation where Pol...
[{"type": "stdin_stdout", "input": "23\n5 1045\n12 703\n16 26\n23 3384\n28 4563\n30 4501\n34 1033\n35 1393\n36 4095\n37 1279\n38 1787\n39 770\n40 5362\n41 4569\n42 3148\n43 2619\n44 5409\n45 3919\n46 732\n47 1297\n48 4512\n49 3231\n50 5169\n", "output": "64551 64501\n"}, {"type": "stdin_stdout", "input": "10\n964416 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\nThe administration of the Tomsk ...
[{"type": "stdin_stdout", "input": "30 505231\n-18 16 88130\n-10 16 15693\n16 -32 660\n-27 17 19042\n30 -37 6680\n36 19 299674\n-45 21 3300\n11 27 76\n-49 -34 28649\n-1 11 31401\n25 42 20858\n-40 6 455660\n-29 43 105001\n-38 10 6042\n19 -45 65551\n20 -9 148533\n-5 -24 393442\n-43 2 8577\n-39 18 97059\n12 28 39189\n35 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\nEugeny loves listening to music....
[{"type": "stdin_stdout", "input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 10\n9 9\n1 9\n26 34 37 141 146 201 239 245 296 299\n", "output": "4\n4\n5\n6\n6\n8\n9\n9\n9\n9\n"}, {"type": "stdin_stdout", "input": "9 9\n2 5\n7 1\n8 2\n8 8\n8 8\n4 4\n6 10\n10 9\n2 9\n1 10 36 48 76 151 229 276 310\n", "output": "1\n1\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\nAt the children's day, the child...
[{"type": "stdin_stdout", "input": "247 3270\n", "output": "62\n3228 3223 3212 3243 3230 3241 3263 3227 3255 3265 3262 3239 3261 3235 3219 3236 3231 3267 3210 3233 3258 3266 3237 3232 3252 3218 3251 3222 3242 3216 3256 3238 3253 3247 3214 3259 3217 3211 3269 3215 3220 3246 3221 3225 3264 3244 3250 3257 3209 3248 3234 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\nConstanze is the smartest girl i...
[{"type": "stdin_stdout", "input": "nnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnnuuuuuuuuuunnunnu\n", "output": "281595619\n"}, {"type": "stdin_stdout", "input": "qmwknxcyrykskllhwnxlvlmckdhfpkuizzkeixxdvxlqyrspdtuccnbvpcvktzgmgvvebmdfdjsoyfhzigwvxrklbiunhzxjnayk\n", "output": "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\nTeachers of one programming summ...
[{"type": "stdin_stdout", "input": "10\nabaabbaaa\nacccccaacabc\nacbaabaaabbca\naaccca\ncbbba\naaba\nacab\nac\ncbac\nca\nbbbbc\nbacbcbcaac\nc\ncba\na\nabba\nbcabc\nabcccaa\nab\na\n", "output": "10\n1 9\n6 5\n4 10\n8 6\n7 8\n9 4\n10 3\n3 2\n2 1\n5 7\n"}, {"type": "stdin_stdout", "input": "10\nbaa\na\nba\naabab\naa\nbaab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Squidward, Spongebob and...
[{"type": "stdin_stdout", "input": "101\n1 50 170 148 214 153 132 234 181 188 180 225 226 200 197 122 181 168 87 220 223 160 235 94 257 145 199 235 102 146 119 60 109 134 209 260 210 191 180 271 236 195 155 169 166 143 246 102 208 137 278 269 156 251 198 165 111 198 151 213 256 121 276 163 179 285 104 99 139 122 188 18...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is a harder version of the ...
[{"type": "stdin_stdout", "input": "8\n-100000000 -100000000 -100000000\n100000000 100000000 100000000\n-100000000 100000000 100000000\n-100000000 -100000000 100000000\n100000000 100000000 -100000000\n100000000 -100000000 -100000000\n-100000000 100000000 -100000000\n100000000 -100000000 100000000\n", "output": "1 4\n7 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnu has created her own function...
[{"type": "stdin_stdout", "input": "100\n8650752 65536 131072 134217728 2112 8 0 0 0 0 0 1 0 0 268435456 1024 0 18890756 0 0 0 135364608 6291464 0 0 0 0 0 32 0 16384 0 0 0 0 33554560 256 0 16 0 0 536870912 536870912 0 0 128 0 0 4096 2048 0 0 0 0 268435456 64 1 0 0 262144 524288 0 8192 0 0 0 2 2 512 131072 0 0 67108864 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKuriyama Mirai has killed many m...
[{"type": "stdin_stdout", "input": "56\n43 100 44 66 65 11 26 75 96 77 5 15 75 96 11 44 11 97 75 53 33 26 32 33 90 26 68 72 5 44 53 26 33 88 68 25 84 21 25 92 1 84 21 66 94 35 76 51 11 95 67 4 61 3 34 18\n27\n1 20 38\n1 11 46\n2 42 53\n1 8 11\n2 11 42\n2 35 39\n2 37 41\n1 48 51\n1 32 51\n1 36 40\n1 31 56\n1 18 38\n2 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\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\nLittle Chris is a huge fan of li...
[{"type": "stdin_stdout", "input": "5\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n7\n3\n2 4\n1 3\n3\n2 5\n1 5\n3\n", "output": "111\n"}, {"type": "stdin_stdout", "input": "3\n1 1 1\n0 1 1\n1 0 0\n12\n3\n2 3\n3\n2 2\n2 2\n1 3\n3\n3\n1 2\n2 1\n1 1\n3\n", "output": "01001\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\nCompanies always have a lot of e...
[{"type": "stdin_stdout", "input": "111\n15 45 14 65 49 25 102 86 14 80 54 73 43 78 42 32 47 60 55 66 84 69 49 22 26 72 89 52 26 80 71 35 56 2 88 23 23 53 65 92 46 73 29 65 88 99 19 99 87 10 47 96 109 20 60 89 63 105 29 92 109 20 95 65 31 89 107 3 3 50 58 9 28 39 104 42 41 36 70 49 59 96 16 9 3 108 38 42 2 67 32 86 20 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPermutation p is an ordered set ...
[{"type": "stdin_stdout", "input": "10 4\n", "output": "10 9 8 7 1 2 3 4 5 6\n"}, {"type": "stdin_stdout", "input": "6 3\n", "output": "6 5 4 1 2 3\n"}, {"type": "stdin_stdout", "input": "5 2\n", "output": "1 5 2 4 3\n"}, {"type": "stdin_stdout", "input": "4 0\n", "output": "1 2 3 4\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\n[Image] \n\nAs some of you know,...
[{"type": "stdin_stdout", "input": "53\n1014364 40727 75774 243769 314 406417 5272684 14138 10640282 64955 2763 5667043 2121887 204672692 567643 60183 5183 11361359 2792918 199155 174809 16182540 21 392221 19434423 9140891 159733 15438 67903 3816799 616 429181 30392293 413992581 10847741 20771 16366654 1163 414283 1561...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLately, a national version of a ...
[{"type": "stdin_stdout", "input": "40\n2 12 19\n4 10 7 1 3\n2 15 17\n1 6\n3 17 8 20\n4 8 16 11 18\n2 2 7\n4 12 13 8 7\n3 6 1 15\n3 19 11 13\n1 2\n2 16 14\n5 1 17 8 9 5\n1 2\n3 15 17 12\n4 20 4 19 18\n1 10\n4 12 1 17 16\n4 5 10 8 11\n1 10\n1 13\n1 17\n2 19 18\n1 3\n2 6 20\n1 8\n2 3 14\n3 17 3 1\n2 4 3\n1 12\n1 15\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\nПамять компьютера состоит из n я...
[{"type": "stdin_stdout", "input": "24\n0 0 6 6 6 0 22 22 0 23 23 0 19 19 19 19 0 0 17 0 0 3 3 3\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "21\n0 11 11 11 11 0 7 0 12 12 12 12 12 0 19 19 19 0 1 1 1\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "24\n6 6 0 0 0 22 0 0 23 0 0 19 0 0 0 0 17 17 0 3 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle penguin Polo adores integ...
[{"type": "stdin_stdout", "input": "47 21\n3 5\n-422 -417\n60 60\n-348 -348\n-3 -3\n-364 -361\n-49 -41\n-436 -430\n-250 -244\n-33 -26\n-162 -158\n-90 -88\n-357 -352\n-339 -337\n-25 -19\n-69 -67\n-261 -260\n-292 -283\n12 18\n44 44\n-277 -275\n-301 -293\n-108 -98\n-180 -172\n-327 -318\n-314 -309\n-12 -7\n-134 -130\n33 35...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 le...
[{"type": "stdin_stdout", "input": "8\n6 15 35 77 143 221 34 26\n", "output": "3"}, {"type": "stdin_stdout", "input": "6\n10 8 75 6 7 35\n", "output": "3"}, {"type": "stdin_stdout", "input": "2\n97969 97969\n", "output": "1"}, {"type": "stdin_stdout", "input": "4\n2 3 5 7\n", "output": "-1"}, {"type": "stdin_stdout", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ people sitting in ...
[{"type": "stdin_stdout", "input": "536870912\n", "output": "1 268435458 805306372 1879048200 4026531856 8321499168 16911433792 34091303040 68451041536 137170518528 274609472512 549487380480 1099243196416 2198754828288 4397778092032 8795824619520 17591917674496 35184103784448 70368476004352 140737220444160 281474709323...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima's got a staircase that cons...
[{"type": "stdin_stdout", "input": "5\n1 2 3 6 6\n25\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\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\nCowboy Beblop is a funny little ...
[{"type": "stdin_stdout", "input": "16\n0 1000 0\n436 1013 0\n509 517 0\n1000 500 0\n1000 1000 0\n1401 1028 0\n1434 461 0\n2086 442 0\n2079 1044 0\n2506 1032 0\n2549 450 0\n3077 446 0\n3063 1067 0\n3715 1062 0\n3756 -125 0\n0 0 0\n16\n-243 700 394\n109 700 365\n129 700 -366\n763 700 -366\n725 700 397\n1131 700 409\n117...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 beginning of the new year...
[{"type": "stdin_stdout", "input": "117\n", "output": "aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabba\n"}, {"type": "stdin_stdout", "input": "109\n", "output": "aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 1 1\n3 1 1\n2 2\n3 1 2\n3 1 1\n3 1 1\n3 1 2\n", "output": "NO\nNO\nNO\nYES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "10 10\n2 9\n1 2 1\n1 3 2\n3 1 1\n3 1 1\n2 3\n3 1 1\n3 1 1\n3 1 2\n3 1 1\n", "output": "NO\nNO\nNO\nNO\nYES\nNO\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\nMislove had an array $a_1$, $a_2...
[{"type": "stdin_stdout", "input": "1000 20 20\n", "output": "1049555 514850815\n"}, {"type": "stdin_stdout", "input": "114 18 19\n", "output": "262239 25427967\n"}, {"type": "stdin_stdout", "input": "879 17 17\n", "output": "131933 56623103\n"}, {"type": "stdin_stdout", "input": "106 16 18\n", "output": "65625 1179647...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLunar New Year is approaching, a...
[{"type": "stdin_stdout", "input": "100\n28 27 23 6 23 11 25 20 28 15 29 23 20 2 8 24 8 9 30 8 8 1 11 7 6 17 17 27 26 30 12 22 17 22 9 25 4 26 9 26 10 30 13 4 16 12 23 19 10 22 12 20 3 16 10 4 29 11 15 4 5 7 29 16 3 1 7 16 26 14 28 1 15 19 30 28 5 22 14 28 13 12 11 30 3 4 7 10 22 8 4 10 22 12 17 27 23 11 18 7\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIlya is a very good-natured lion...
[{"type": "stdin_stdout", "input": "16\n978618343 473608041 799158564 800910753 461479363 520477481 780529176 678879534 118274424 720632652 639921017 582019792 143353286 537373229 944668919 758615621\n", "output": "14440495117\n"}, {"type": "stdin_stdout", "input": "16\n666766712 653140033 670637874 170909587 210382562...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPasha has recently bought a new ...
[{"type": "stdin_stdout", "input": "100 1\n5 3 1 5 6 2 4 8 3 3 1 1 2 8 2 3 8 2 5 2 6 2 3 5 2 1 2 1 2 8 4 3 3 5 1 4 2 2 2 5 8 2 2 6 2 9 2 4 1 8 1 5 5 6 6 1 2 7 3 3 4 2 4 1 2 6 6 4 9 4 3 2 3 8 2 3 1 4 1 4 1 3 5 3 5 5 2 3 4 1 1 8 1 5 6 9 4 2 5 1\n6 0 4 5 3 1 0 7 5 3 9 4 5 4 0 2 1 6 2 2 4 3 1 9 5 9 2 2 6 8 6 5 9 6 4 9 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\nLittle Robber Girl likes to scar...
[{"type": "stdin_stdout", "input": "47\n17462271 17619887 84928078 85012448 86003043 86499508 129945397 135545949 141951561 161227989 167459883 215243263 243500622 284922151 326608661 350939646 359121478 388866754 441241406 460673749 497339472 512847269 521291845 537280636 561101359 569788868 581107309 588113051 619849...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Vitaly loves different al...
[{"type": "stdin_stdout", "input": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"}, {"type": "stdin_stdout", "input": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n", "output": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n"}, {"type": "stdin_stdout", "input": "xx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Vasya had n boxes with ba...
[{"type": "stdin_stdout", "input": "48 19\n227460648 746912227 53993110 682685526 621533699 666833118 492590399 167395932 678377837 66509685 638633256 713194370 386921921 34175133 704550052 220688092 499436761 495071386 102952102 137372655 0 720974146 209203457 946682102 237312198 943872065 957150897 357568282 36700674...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInnokenty is a president of a ne...
[{"type": "stdin_stdout", "input": "10\nIJGDI KHB\nHBI CKKCG\nFHE GCAA\nEDCGH HHICE\nGFH AIHD\nHED KIK\nDCK BCFIJ\nFFIHE FDB\nJGB AKKI\nIJD CAG\n", "output": "YES\nIJG\nHBI\nFHE\nEDC\nGFH\nHED\nDCK\nFFI\nJGB\nIJD\n"}, {"type": "stdin_stdout", "input": "10\nADE GBH\nJJDGJ AAF\nJJDGJ BBKG\nADE FKH\nADE CIA\nAIE JCBJ\nAIE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel is going to publish a p...
[{"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkostka\ndmitriyh\nmaratsnowbear\nbredorjaguarturnik\ncgyforever\n", "output": "aghjlnopefikdmbcqrstuvwxyz\n"}, {"type": "stdin_stdout", "input": "1\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrew and Jerry are playing a g...
[{"type": "stdin_stdout", "input": "20\n11 37 81 56 61 2 26 27 59 69 24 7 71 76 45 54 89 17 95 20\n", "output": "0.1931218837\n"}, {"type": "stdin_stdout", "input": "19\n55 91 63 21 30 82 14 38 9 67 50 44 90 93 68 6 73 65 29\n", "output": "0.1920376960\n"}, {"type": "stdin_stdout", "input": "18\n69 88 49 91 42 56 58 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\nVasya often uses public transpor...
[{"type": "stdin_stdout", "input": "680 871 347 800\n10 100\n872 156 571 136 703 201 832 213 15 333\n465 435 870 95 660 237 694 594 423 405 27 866 325 490 255 989 128 345 278 125 708 210 771 848 961 448 871 190 745 343 532 174 103 999 874 221 252 500 886 129 185 208 137 425 800 34 696 39 198 981 91 50 545 885 194 583 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\nVlad likes to eat in cafes very ...
[{"type": "stdin_stdout", "input": "8\n200000 1 200000 1 200000 1 200000 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n100 1000 1000 1000 1000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "11\n1 1 1 1 1 1 1 1 1 1 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n20000 1 2 3 4\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWilbur is playing with a set of ...
[{"type": "stdin_stdout", "input": "40\n0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n1 0\n1 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 0\n3 0\n4 0\n5 0\n6 0\n7 0\n8 0\n9 0\n10 0\n11 0\n12 0\n13 0\n14 0\n15 0\n16 0\n17 0\n18 0\n19 0\n20 0\n0 1 2 -1 -2 3 4 -3 5 6 7 8 0 -4 -5 1 -6 -7 -8 -9 -10 -11 9 2 -12 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZibi is a competitive programmin...
[{"type": "stdin_stdout", "input": "40 39\n0 -2\n-2 3\n3 3\n3 -2\n-1 1\n2 0\n-3 2\n-2 1\n0 -3\n-1 -3\n1 -1\n-3 -1\n2 1\n0 2\n1 -3\n-2 -1\n1 2\n-1 -2\n-1 0\n3 2\n1 3\n-3 1\n-2 -3\n-3 -2\n3 0\n-1 3\n3 1\n-2 2\n0 3\n3 -1\n2 -3\n1 1\n-1 -1\n0 1\n-3 0\n1 0\n-3 3\n-3 -3\n2 2\n-1 2\n1 29\n29 2\n29 3\n29 4\n5 29\n29 6\n7 29\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 easier version of the...
[{"type": "stdin_stdout", "input": "100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKefa decided to make some money ...
[{"type": "stdin_stdout", "input": "100\n1 838 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1 605 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\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": "1 15 100 200\n283 8\n30 58 16 45 80 82 55 95 24 23 86 28 51 47 20\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 1 1000000000 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 given a convex polygon P...
[{"type": "stdin_stdout", "input": "19\n449447997 711296339\n530233434 692216537\n535464528 613140435\n535533467 100893188\n530498867 -265063956\n519107979 -271820709\n482156929 -287792333\n-303730271 -287970295\n-416935204 -263348201\n-443613873 -249980523\n-453444829 -173903413\n-462102798 -80789280\n-462064673 -1322...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "0111001100111011101000\n", "output": "0011001100001011101000\n"}, {"type": "stdin_stdout", "input": "0000000000000000\n", "output": "0000000000000000\n"}, {"type": "stdin_stdout", "input": "0100000001000001\n", "output": "0100000001000000\n"}, {"type": "stdin_stdout", "input": "00001...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOf course you have heard the fam...
[{"type": "stdin_stdout", "input": "15\n7 8 940377876\n5 26 602265950\n18 19 193066910\n23 24 754826087\n2 3 555140266\n6 25 830980693\n27 28 636793242\n20 21 809913904\n1 30 868457738\n10 17 698644057\n9 22 443624155\n13 16 941205435\n14 15 42481040\n4 29 305295425\n11 12 765921496\n", "output": "4732954493\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\nEugene likes working with arrays...
[{"type": "stdin_stdout", "input": "3\n41 -41 41\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n1 2 -3\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "2\n-1 -1\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "2\n-1 0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "2\n-1 1\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValya and Tolya are an ideal pai...
[{"type": "stdin_stdout", "input": "242\nrrrrrrrrrrrrrmmmmmmmmmmmmmgggggggggggggwwwwwwwwwwwwwyyyyyyyyyyyyyhhhhhhhhhhhhhoooooooooooooqqqqqqqqqqqqqjjjjjjjjjjjjjvvvvvvvvvvvvvlllllllllllllnnnnnnnnnnnnnfffffffffffffeeeeeeeeaaaaaaaaiiiiiiiiuuuuuuuuzzzzzzzzbbbbbbbbxxxxxxxxttttttttsscckppdd\nrmgwyhoqjvlnfrmgwyhoqjvlnfrmgwyhoqj...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 four cookies with deli...
[{"type": "stdin_stdout", "input": "45445415 46908390 31865171 30402196\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "93407609 30427494 56229544 81174201\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "76041209 81456309 25817729 23366690\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "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\nGiven are integers S and P.\nIs ...
[{"type": "stdin_stdout", "input": "1000000000000 999999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "50000000002 100000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "978530427494 321593407609\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "203939391324 871114841657\n", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S consist...
[{"type": "stdin_stdout", "input": "dreamereraserdreamererasereraseeraserdreamererasereraserdreamdreamerdreamerdreamerdreamererasedreamereraseeraserdreamereraserdreamereraseeraserdreamdreamdreamerdreamerdreamerdreamdreamerdreameraseerasedreamererasererasererasedreamereraseerasererasedreamerasereraserdreamerdreamerasedr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string consisting of...
[{"type": "stdin_stdout", "input": "AAAAAA\nAAAAAA\n30\n3 4 1 2\n3 3 4 4\n5 6 3 4\n3 3 2 3\n6 6 1 5\n2 4 4 6\n1 6 2 5\n6 6 3 4\n3 5 1 4\n4 5 3 6\n2 3 2 4\n3 4 4 4\n6 6 4 6\n3 3 2 5\n1 5 3 3\n4 6 1 2\n6 6 6 6\n3 3 3 4\n6 6 6 6\n5 6 4 4\n6 6 5 5\n2 3 1 4\n3 6 4 5\n3 5 6 6\n4 5 2 6\n5 6 6 6\n1 4 2 5\n4 5 2 5\n4 5 1 3\n2 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 given two strings s and ...
[{"type": "stdin_stdout", "input": "ccaaa?bc?baccbccccbca?cccab??aacccbaac?bccacc?accccaccbcbbcbc\ncbaaacccc\n", "output": "ccaaaabcabaccbccccbcaacccabaaaacccbaaczbccacczaccccaccbcbbcbc\n"}, {"type": "stdin_stdout", "input": "mqwstphetbfrsyxuzdww\nrutseqtsbh\n", "output": "mqwstphetbfrsyxuzdww\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecall that string $a$ is a subs...
[{"type": "stdin_stdout", "input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"type": "stdin_stdout", "input": "vvovooovovvovoovoovvvvovovvvov\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "vovoovovvoovvvvvvovo\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "vvovvovv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 devices that you want...
[{"type": "stdin_stdout", "input": "20 16807\n75250 50074\n43659 8931\n11273 27545\n50879 77924\n37710 64441\n38166 84493\n43043 7988\n22504 82328\n31730 78841\n42613 44304\n33170 17710\n97158 29561\n70934 93100\n80279 51817\n95336 99098\n7827 13513\n29268 23811\n77634 80980\n79150 36580\n58822 11968\n", "output": "0.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\nWhen Darth Vader gets bored, he ...
[{"type": "stdin_stdout", "input": "97 78153\n2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "86 95031\n1 1 2 1 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\nAfter their adventure with the m...
[{"type": "stdin_stdout", "input": "6 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n", "output": "7000000000 0\n"}, {"type": "stdin_stdout", "input": "11 1000\n- 100\n+ 100\n+ 100\n+ 100\n+ 100\n- 100\n- 100\n- 100\n- 100\n- 100\n- 100\n", "output": "700 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\nSereja loves integer sequences v...
[{"type": "stdin_stdout", "input": "102\n1830 2653 1293 4285 4679 3563 3668 4499 3507 2666 3507 1120 466 290 4280 60 4135 1120 289 1752 2101 2699 653 2811 3885 4018 4097 3142 2932 561 193 3662 3017 3487 3158 2876 3396 2806 3440 4503 1728 362 2194 2743 2946 596 1892 4785 3661 2971 3487 17 3616 2710 1189 613 915 3891 265...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSometimes it is not easy to come...
[{"type": "stdin_stdout", "input": "89653869601520065918099842252939425873261986401967787530625300860685703011479905851664663625597640495748720791302990531416409889170329328492276398890871323755880144010733994706479132908918729855565786473847956211671142121453760475332628675489221779768932083810273365664919372769368554...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's analyze a program written ...
[{"type": "stdin_stdout", "input": "9\nc111=a&b\nd=b^a\ne=c111#d\nd=d\nf=f\nf=c111$d\ng=e$f\nh=e#f\nres=g^h\n", "output": "7\naaaa=a&b\naaab=b^a\naaac=aaaa#aaab\naaad=aaaa$aaab\naaae=aaac$aaad\naaaf=aaac#aaad\nres=aaae^aaaf\n"}, {"type": "stdin_stdout", "input": "9\nc=a$b\ne=c#c\nf=c$c\nh=a$b\nx=h$h\ny=h#h\nz=x^y\ng=f^...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 consisting ...
[{"type": "stdin_stdout", "input": "13\n1 4\n2 4\n3 4\n4 5\n5 11\n11 12\n12 13\n13 6\n6 7\n7 8\n7 9\n7 10\n", "output": "4\n5\n6\n7\n8\n9\n10\n11\n0\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "11\n2 3\n3 4\n4 7\n7 8\n1 3\n3 5\n4 10\n4 11\n6 7\n7 9\n", "output": "4\n5\n0\n1\n6\n7\n8\n9\n2\n3\n"}, {"type": "stdin_st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya and Vasya are tossing a co...
[{"type": "stdin_stdout", "input": "10 10 1 1\n", "output": "45\n2 1\n3 1\n3 2\n4 1\n4 2\n4 3\n5 1\n5 2\n5 3\n5 4\n6 1\n6 2\n6 3\n6 4\n6 5\n7 1\n7 2\n7 3\n7 4\n7 5\n7 6\n8 1\n8 2\n8 3\n8 4\n8 5\n8 6\n8 7\n9 1\n9 2\n9 3\n9 4\n9 5\n9 6\n9 7\n9 8\n10 1\n10 2\n10 3\n10 4\n10 5\n10 6\n10 7\n10 8\n10 9\n"}, {"type": "stdin_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\nFor long time scientists study t...
[{"type": "stdin_stdout", "input": "127\n64 96 63 112 62 95 61 120 60 94 59 111 58 93 57 124 56 92 55 110 54 91 53 119 52 90 51 109 50 89 49 126 48 88 47 108 46 87 45 118 44 86 43 107 42 85 41 123 40 84 39 106 38 83 37 117 36 82 35 105 34 81 33 127 32 80 31 104 30 79 29 116 28 78 27 103 26 77 25 122 24 76 23 102 22 75 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 PIN code is a string that cons...
[{"type": "stdin_stdout", "input": "14\n3\n0000\n0000\n0001\n3\n0000\n0001\n0000\n3\n0001\n0000\n0000\n3\n0000\n0000\n1000\n3\n0000\n1000\n0000\n3\n1000\n0000\n0000\n3\n0000\n0001\n0001\n3\n0001\n0000\n0001\n3\n0001\n0001\n0000\n3\n0000\n1000\n1000\n3\n1000\n0000\n1000\n3\n1000\n1000\n0000\n4\n0000\n0001\n0001\n0002\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\nInternational Coding Procedures ...
[{"type": "stdin_stdout", "input": "8\n< > << >> in out fun in>>out\n6\n# let's rock\nin>>out in >> out inout>>outin bin>>out # yay!\nfun>>in>>out funin>>out out>>in <in> > <out>\nin> >> >>> >>>> >>>>>out\n# what's going on here?\n<> <> <> <> <fun> <funfun> <not so fun>\n", "output": "in>>outin>> out a>>b c>>out fun>>i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has started watching footb...
[{"type": "stdin_stdout", "input": "KASFLS\nASJBGGDLJFDDFHHTHJH\n42\n2 a 68 y\n4 h 64 r\n5 a 24 y\n6 h 20 r\n8 a 16 r\n9 a 96 y\n10 h 36 r\n12 a 44 y\n13 h 69 r\n16 a 62 r\n18 a 99 r\n20 h 12 r\n21 a 68 y\n25 h 40 y\n26 h 54 r\n28 h 91 r\n29 a 36 r\n33 a 91 y\n36 h 93 r\n37 h 60 r\n38 a 82 r\n41 a 85 y\n42 a 62 r\n46 a...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 school computer room ther...
[{"type": "stdin_stdout", "input": "10\n19999 19999 20000 20000 19999 20000 20000 20000 19999 19999\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n10 11 10 11 10 11 11\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n0 0 0 0 0 0 0 0 0 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "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\nMad scientist Mike entertains hi...
[{"type": "stdin_stdout", "input": "115\n10\n10\n10\n10\n01\n01\n10\n10\n10\n01\n01\n10\n01\n01\n10\n10\n10\n01\n10\n01\n10\n10\n01\n01\n10\n10\n10\n10\n01\n10\n01\n01\n10\n10\n10\n10\n01\n10\n10\n10\n01\n10\n01\n10\n10\n10\n10\n01\n01\n01\n10\n10\n01\n01\n01\n10\n10\n01\n10\n01\n01\n01\n01\n10\n10\n01\n10\n01\n01\n01\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call beauty of an array $b...
[{"type": "stdin_stdout", "input": "52 52\n19752 66708 73109 84463 95683 96876 98503 98812 99766 99778 99913 99975 99977 99997 99997 99997 99998 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are playing a new famous fig...
[{"type": "stdin_stdout", "input": "38 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 53 53 53 1 1 1 1 1 1 1 1 1 1 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "53\n"}, {"type": "stdin_stdout", "input": "38 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 53 53 1 1 1 1 1 1 1 1 1 1 1 1\naaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider a football tournament w...
[{"type": "stdin_stdout", "input": "30\n25 8\n25 4\n21 9\n25 1\n7 16\n23 21\n22 17\n27 29\n7 29\n20 3\n13 23\n7 13\n16 18\n25 14\n13 17\n28 15\n10 23\n25 18\n2 3\n23 13\n30 8\n13 15\n20 15\n11 29\n10 23\n5 16\n4 14\n4 30\n7 20\n11 1\n", "output": "29 29\n31 27\n29 29\n29 29\n30 28\n30 28\n29 29\n29 29\n29 29\n29 29\n31...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 have to simu...
[{"type": "stdin_stdout", "input": "4 3\n999999996 1000000000\n999999997 1000000000\n999999998 1000000000\n999999999 1000000000\n", "output": "1999999996 2999999996 3999999996 4999999996 \n"}, {"type": "stdin_stdout", "input": "10 3\n1 14\n3 2\n5 4\n6 9\n9 1\n12 22\n15 11\n18 8\n28 2\n29 4\n", "output": "15 17 21 30 -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\nGena loves sequences of numbers....
[{"type": "stdin_stdout", "input": "73\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 505 433 243 963 247 5 368 969 541 408 485 319 117 441 131 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\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 has an array $a$ consistin...
[{"type": "stdin_stdout", "input": "10 -196228170\n-181402541 328251238 624722764 682518931 783857631 969228879 547715844 -149364638 823684584 833196798\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "5 450402558\n-840167367 -231820501 586187125 -627664644 -428228185\n", "output": "14\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has just invented a new...
[{"type": "stdin_stdout", "input": "89\n11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "53\n10110111011110111110111111011111110111111110111111111\n", "output": "123456789\n"}, {"type": "stdin_stdout", "input": "31...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has the sequence consistin...
[{"type": "stdin_stdout", "input": "100 14\n8192 8192 8192 8192 8191 8192 8192 8192 8192 8192 8191 8191 8191 8192 8191 8191 8191 8192 8192 8192 8192 8192 8191 8191 8191 8192 8191 8192 8192 8192 8192 8192 8192 8191 8191 8192 8192 8191 8191 8192 8192 8192 8191 8191 8192 8191 8191 8191 8191 8191 8191 8192 8191 8191 8192 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce little Vasya read an articl...
[{"type": "stdin_stdout", "input": "hvewdvwdwudrwarwmddwnazmwauzatrmwptwwevavpmwrtruwnpwantewrnwmepdwvtmnveanunrvrtwpvhhnuhnmpptdttzmmndtvudmzhhannmmnahdpzamuvhzaavnhtnumwrwvttdetvuewaaennddwuvzvaptdzrzhtetwwzmzedrwuvrwznprhdvnavrruvvhzuwpdtmpwmzrwvermrhdamv\nuvzhwtpuputnahwwarduzddhpnwwvettprwavdmnztdnrddmarmvuevtdezn...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIgor found out discounts in a sh...
[{"type": "stdin_stdout", "input": "50 45\n80 125 152 122 85 62 123 195 157 73 8 127 47 193 70 132 131 38 98 97 185 98 68 166 114 53 144 106 141 106 191 123 44 199 35 18 84 169 46 52 129 102 155 130 63 169 116 145 154 41\n155 187 79 106 136 173 17 146 9 47 173 21 37 183 110 74 185 14 82 156 147 25 162 195 26 25 22 80 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis 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\nInaka has a disc, the circumfere...
[{"type": "stdin_stdout", "input": "30000 28\n10601 1119\n11119 20601\n9493 25771\n14351 4869\n13101 3619\n23101 13619\n29869 9351\n6119 15601\n3101 23619\n1851 22369\n11851 2369\n8619 18101\n19579 20882\n18619 28101\n16851 7369\n8101 28619\n24869 4351\n24351 14869\n27369 6851\n9869 19351\n5601 26119\n3976 21301\n21851...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nT is a complete binary tree cons...
[{"type": "stdin_stdout", "input": "1125899906842623 1\n1\nUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 problem uses a simplified TC...
[{"type": "stdin_stdout", "input": "15 8\n244.1.125.160\n39.50.68.162\n142.253.101.137\n52.239.241.147\n194.4.189.143\n200.238.160.30\n245.78.177.243\n89.249.140.19\n169.51.142.22\n123.246.20.99\n133.44.192.119\n226.240.179.30\n76.209.211.184\n98.15.6.117\n227.219.117.153\n", "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\nKsusha is a beginner coder. Toda...
[{"type": "stdin_stdout", "input": "5\n506904227 214303304 136194869 838256937 183952885\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n500000000 1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "5\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 favorite music streaming pl...
[{"type": "stdin_stdout", "input": "100\n7585 5510 1017 4329 2840 8171 5089 1873 7308 9656 6833 7578 4914 6658 4408 7122 5265 1204 9800 3150 2151 6906 6041 3973 931 7239 4421 4211 156 8655 4266 3543 9752 3117 2731 6052 8950 9391 6367 996 9973 629 9489 4912 9226 9301 5166 4889 3710 6794 618 9155 2462 1120 5499 5861 3177...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Chris the Baboo...
[{"type": "stdin_stdout", "input": "61\nOX|XX\nOX|XX\nOX|XX\nXO|XO\nXX|XO\nXX|XX\nXX|XX\nOX|XX\nXO|XO\nOX|XO\nXO|OX\nXX|XX\nXX|XX\nOX|OX\nXX|OX\nOX|XO\nOX|XO\nXO|OX\nXO|XX\nOX|XX\nOX|XX\nXO|OX\nXO|XX\nXO|XX\nOX|XX\nXX|XX\nXX|XO\nXO|XX\nXX|XX\nXO|OX\nXX|XO\nXO|XX\nXO|XO\nXO|OX\nXX|OX\nXO|OX\nOX|XX\nXX|OX\nXX|XX\nOX|XO\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 went to the store, selling $...
[{"type": "stdin_stdout", "input": "19\n10 10 8 11 6 1 6 13 8 20 8 14 9 18 18 7 5 20 6\n", "output": "21"}, {"type": "stdin_stdout", "input": "19\n3 1 16 11 12 10 3 13 12 9 1 9 8 4 19 16 19 3 3\n", "output": "6"}, {"type": "stdin_stdout", "input": "12\n6 20 12 12 1 8 15 19 5 19 5 16\n", "output": "31"}, {"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\nThis is a harder version of the ...
[{"type": "stdin_stdout", "input": "100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 vigorous detective fac...
[{"type": "stdin_stdout", "input": "20 20 17 20\n1 16 20\n2 12 13\n3 14 16\n4 13 15\n5 3 15\n6 2 11\n7 18 18\n8 5 15\n9 6 12\n10 19 19\n11 9 11\n12 14 17\n13 19 19\n14 12 20\n15 1 1\n16 11 17\n17 13 14\n18 5 17\n19 2 10\n20 19 20\n", "output": "XRRR\n"}, {"type": "stdin_stdout", "input": "100 5 99 1\n1 1 2\n2 2 3\n3 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\nA class of students wrote a mult...
[{"type": "stdin_stdout", "input": "10 10\nCBBBBBBBBB\nABBBBEBBBB\nBDBBBBBBBB\nBBBBBBBBBB\nBABBBBBEBB\nEBBBBBBBBB\nBBBCBDCBBB\nBEBBEBBBBB\nBBBBBBBBBB\nBBBDBBBABB\n840 678 490 900 683 84 256 233 468 856\n", "output": "46953"}, {"type": "stdin_stdout", "input": "6 5\nAAAAA\nAAAAB\nAAABB\nAABBB\nABBBB\nBBBBB\n999 13 877 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe capital of Berland looks lik...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 10\n946218581 843926244\n730038846 389721428\n400508549 779159281\n631299905 559948749\n352088629 132899572\n391396726 503295408\n57387601 686114055\n298922091 222110600\n523083048 28286278\n587730768 379340837\n", "output": "313885945\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\nOne way to create a task is to l...
[{"type": "stdin_stdout", "input": "100 1\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 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\nA string is called bracket seque...
[{"type": "stdin_stdout", "input": "20\n(())(()()())(())()()\n", "output": "01100111111001100000\n"}, {"type": "stdin_stdout", "input": "20\n(()()()())(()())()()\n", "output": "01111111100111100000\n"}, {"type": "stdin_stdout", "input": "20\n(())(())(())()(())()\n", "output": "01100110011000011000\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\nAs the guys fried the radio stat...
[{"type": "stdin_stdout", "input": "10 10\nittmcs 112.147.123.173\njkt 228.40.73.178\nfwckqtz 88.28.31.198\nkal 224.226.34.213\nnacuyokm 49.57.13.44\nfouynv 243.18.250.17\ns 45.248.83.247\ne 75.69.23.169\nauwoqlch 100.44.219.187\nlkldjq 46.123.169.140\ngjcylatwzi 46.123.169.140;\ndxfi 88.28.31.198;\ngv 46.123.169.140;\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Petya take part in a C...
[{"type": "stdin_stdout", "input": "26\n3 -1 71 -1 42\n85 72 48 38 -1\n-1 -1 66 24 -1\n46 -1 60 99 107\n53 106 51 -1 104\n-1 17 98 54 -1\n44 107 66 65 102\n47 40 62 34 5\n-1 10 -1 98 -1\n-1 69 47 85 75\n12 62 -1 15 -1\n48 63 72 32 99\n91 104 111 -1 -1\n92 -1 52 -1 11\n118 25 97 1 108\n-1 61 97 37 -1\n87 47 -1 -1 21\n79...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 bracket sequence is a string c...
[{"type": "stdin_stdout", "input": "10\n()()(\n)((\n)()(((()(\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2\n((((((((((((((((((((((((\n))))))))))))))))))))))))\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "9\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\nDenis, after buying flowers and ...
[{"type": "stdin_stdout", "input": "10 10\n0101111\n0000000\n1111011\n1011011\n1011011\n1111011\n0010010\n1010010\n1101111\n0000000\n", "output": "8993391761"}, {"type": "stdin_stdout", "input": "10 10\n1101001\n0110000\n0111010\n0010000\n1010000\n0111000\n1011011\n1010010\n1101011\n1111110\n", "output": "9941743758"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThree years have passes and noth...
[{"type": "stdin_stdout", "input": "250\n1 0 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 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\nRingo found a string $s$ of leng...
[{"type": "stdin_stdout", "input": "ittmcsvmoa\n", "output": "3\nL 2\nR 2\nR 19\n"}, {"type": "stdin_stdout", "input": "vdgcwgxbh\n", "output": "3\nL 2\nR 2\nR 17\n"}, {"type": "stdin_stdout", "input": "mcrpwaao\n", "output": "3\nL 2\nR 2\nR 15\n"}, {"type": "stdin_stdout", "input": "eaebyud\n", "output": "3\nL 2\nR 2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe legend of the foundation of ...
[{"type": "stdin_stdout", "input": "100\n404 523 -303 876 982 -275 498 287 255 491 -723 289 203 -796 -469 -299 -435 -869 58 577 55 600 153 -948 -11 726 129 797 -323 99 -934 -419 101 -307 -525 502 353 44 -905 371 -946 925 -538 614 -171 -867 -929 702 -429 720 94 -390 997 -803 451 379 57 -377 -545 -890 442 525 -975 -484 8...
code_stdio