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\nIn the official contest this pro...
[{"type": "stdin_stdout", "input": "20\n1306340891 192811911 592111899 609607891 585084800 601258511 223103775 164258550 858003275 230837577 971499807 312977833 344314550 397998873 558637732 216574673 913028292 1360238301 464376621 61315042\n", "output": "384683838\n"}, {"type": "stdin_stdout", "input": "20\n713900269 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAyrat has number n, represented ...
[{"type": "stdin_stdout", "input": "67\n98929 19079 160079 181891 17599 91807 19079 98929 182233 92647 77477 98929 98639 182233 181891 182233 160079 98929 19079 98639 114941 98929 161341 91807 160079 22777 132361 92647 98929 77477 182233 103913 160079 77477 55711 77477 77477 182233 114941 91807 98929 19079 104393 18223...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPaul is at the orchestra. The st...
[{"type": "stdin_stdout", "input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"type": "stdin_stdout", "input": "14 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "3411\n"}, {"type": "stdin_stdout", "input": "10 10 10 1\n1 10\n10 8\n7 4\n7 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\nPari has a friend who loves pali...
[{"type": "stdin_stdout", "input": "11635543554796045289140983157483950524203250955411464324183518580611424141988904394156045071683009945\n", "output": "11635543554796045289140983157483950524203250955411464324183518580611424141988904394156045071683009945549900386170540651493409889141424116085815381423464114559052302425...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 king stands on the stan...
[{"type": "stdin_stdout", "input": "e2\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "a3\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "d7\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "h7\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "d6\n", "output": "8\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGrigoriy, like the hero of one f...
[{"type": "stdin_stdout", "input": "uhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuh\n", "output": "1293\n"}, {"type": "stdin_stdout", "input": "dqcpcobpcobnznamznamzlykxkxlxlylzmaobnaobpbnanbpcoaobnboaoboanzlymzmykylymylzlylymanboanaocqdqesfrfs\n", "output": "1236\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\nPolandBall lives in a forest wit...
[{"type": "stdin_stdout", "input": "6 5\n1 4\n2 3\n3 4\n4 5\n5 6\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6 5\n1 4\n2 0\n3 4\n4 5\n5 6\n", "output": "1"}, {"type": "stdin_stdout", "input": "5 4\n1 2\n1 3\n1 4\n3 5\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 4\n1 3\n1 4\n4 2\n5 2\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\nMoriarty has trapped n people in...
[{"type": "stdin_stdout", "input": "13 11\n0 1 1 0 1 0 0 0 1 0 0 1 1\n6 2 8 9 11 12 13\n3 1 3 11\n1 12\n1 7\n3 6 10 13\n3 1 3 8\n2 7 9\n1 4\n1 2\n2 5 10\n3 4 5 6\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "13 11\n0 1 1 0 0 0 0 0 1 0 0 1 1\n6 2 8 9 11 12 13\n3 1 3 11\n1 12\n1 7\n3 6 10 13\n3 1 3 8\n2 7 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\nMost C/C++ programmers know abou...
[{"type": "stdin_stdout", "input": "5\n#define iiXEqDYeyVmIYsOaO fj/x-9-6/x*x+ 1/ 7*2-x -x+9+235*23*Ww+x-2*K+2-x/70\n#define XVgLzhoTUxoBr ( x+x/x/x*6-x)* x+K/24206-2 /5/8-x-7/Ww/K-x+6 \n#define QdfRBaJk 470551685-( 54-x)-30\n#define gEJcAGnF x+x-x+(x/x+9)/x-41-1/fj/1157561+x/x -x/26/x+K*x\n#define lO 7-1*(x*58 )-K*fj...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOkabe needs bananas for one of h...
[{"type": "stdin_stdout", "input": "1000 10000\n", "output": "74133360011484445"}, {"type": "stdin_stdout", "input": "1581 6030\n", "output": "40628923515290265\n"}, {"type": "stdin_stdout", "input": "1061 8096\n", "output": "44286779591578800\n"}, {"type": "stdin_stdout", "input": "1581 5974\n", "output": "39507636740...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan has an array consisting of ...
[{"type": "stdin_stdout", "input": "10\n71550121 446173607 640274071 402690754 802030518 598196518 796619138 96204862 983359971 799843967\n", "output": "71550121 446173607 640274071 802030518 983359971\n402690754 598196518 796619138 799843967\n96204862\n"}, {"type": "stdin_stdout", "input": "10\n71550121 446173607 8477...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 strings s1, s2, ...
[{"type": "stdin_stdout", "input": "2\n011\n100\n63\n1 1\n3 3\n4 4\n5 5\n6 6\n7 7\n8 8\n9 9\n10 10\n11 11\n12 12\n13 13\n14 14\n15 15\n16 16\n17 17\n18 18\n19 19\n20 20\n21 21\n22 22\n23 23\n24 24\n25 25\n26 26\n27 27\n28 28\n29 29\n30 30\n31 31\n32 32\n2 2\n34 34\n35 35\n36 36\n37 37\n38 38\n39 39\n40 40\n41 41\n42 42...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\"QAQ\" is a word to denote an e...
[{"type": "stdin_stdout", "input": "QQAQQAKQFAQLQAAWAMQAZQAJQAAQQOACQQAAAYANAQAQQAQAAQQAOBQQJQAQAQAQQQAAAAABQQQAVNZAQQQQAMQQAFAAEAQAQHQT\n", "output": "10420\n"}, {"type": "stdin_stdout", "input": "AQEGQHQQKQAQQPQKAQQQAAAAQQQAQEQAAQAAQAQFSLAAQQAQOQQAVQAAAPQQAWAQAQAFQAXAQQQQTRLOQAQQJQNQXQQQQSQVDQQQ\n", "output": "12488\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 [directed graph]...
[{"type": "stdin_stdout", "input": "500 50\n396 340\n47 341\n422 140\n492 209\n263 248\n461 300\n124 495\n33 6\n93 384\n389 182\n130 297\n217 329\n131 136\n355 94\n388 275\n115 368\n279 462\n126 285\n185 287\n223 221\n207 167\n203 127\n39 245\n394 444\n166 99\n399 328\n3 276\n142 325\n284 153\n65 3\n102 5\n459 168\n156...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a of leng...
[{"type": "stdin_stdout", "input": "9\n347223417 807654168 573530036 826123287 366028010 257025851 15406743 784063803 132844347\n", "output": "932879531\n"}, {"type": "stdin_stdout", "input": "9\n347223417 807654168 573530036 826123287 366028010 257025851 15406743 784063803 138878790\n", "output": "655212093\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\nEach student eagerly awaits the ...
[{"type": "stdin_stdout", "input": "100 100 100 100\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "101 100 100 100\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "100 0 100 100\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "100 100 100 0\n", "output": "-1\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven an array A of size N. Give...
[{"type": "stdin_stdout", "input": "1000\n384 887 778 916 794 336 387 493 650 422 363 28 691 60 764 927 541 427 173 737 212 369 568 430 783 531 863 124 68 136 930 803 23 59 70 310 394 457 12 43 230 374 422 920 785 538 199 325 316 371 414 527 92 981 957 874 863 171 997 466 306 926 85 328 337 506 847 730 314 858 125 896 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Deepu loves positive thin...
[{"type": "stdin_stdout", "input": "10\n19 10 17 20 13 2 3 20 30 75\n10\n1\n1\n1\n2\n2\n2\n40\n30\n10\n10", "output": "11 4 10 12 7 1 1 12 22 65\n"}, {"type": "stdin_stdout", "input": "10\n19 10 17 20 13 2 3 20 30 75\n10\n1\n1\n1\n2\n2\n2\n40\n30\n20\n10", "output": "12 4 10 13 7 1 1 13 22 65\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\nAn intergallactic war is on. Ali...
[{"type": "stdin_stdout", "input": "3 3 3\n0 0 0\n1 0 1\n0 1 1\n1 2\n2 2\n3 3\n\nSAMPLE", "output": "4\n4\n1\n"}, {"type": "stdin_stdout", "input": "3 3 3\n0 0 0\n1 0 1\n0 1 1\n1 1\n2 2\n3 3\n\nSAMPLE", "output": "4\n4\n1\n"}, {"type": "stdin_stdout", "input": "3 3 3\n0 0 0\n1 0 1\n1 1 1\n1 2\n2 2\n3 3\n\nSAMPLE", "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\nGiven are N integers A_1,\\ldots...
[{"type": "stdin_stdout", "input": "16 1\n1000000001 100000100 10000100 1000001 100000 10001 1000 000 18 1", "output": "1000000001\n"}, {"type": "stdin_stdout", "input": "10 10\n1000000000 100000000 10000000 1100010 100000 10000 1000 100 10 1", "output": "123991513\n"}, {"type": "stdin_stdout", "input": "10 10\n1000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Hitachi string is a concatenat...
[{"type": "stdin_stdout", "input": "hihi", "output": "Yes"}, {"type": "stdin_stdout", "input": "hhhi", "output": "No\n"}, {"type": "stdin_stdout", "input": "hhhj", "output": "No\n"}, {"type": "stdin_stdout", "input": "jhhh", "output": "No\n"}, {"type": "stdin_stdout", "input": "hjhh", "output": "No\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\nTakahashi has a water bottle wit...
[{"type": "stdin_stdout", "input": "12 30 10", "output": "89.8938968259\n"}, {"type": "stdin_stdout", "input": "15 21 10", "output": "89.8267706578\n"}, {"type": "stdin_stdout", "input": "1 16 18", "output": "-75.9637565321\n"}, {"type": "stdin_stdout", "input": "34 21 10", "output": "89.9235751027\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\nThere is a grid with H rows and ...
[{"type": "stdin_stdout", "input": "3 3\n.#.\n..#\n#..", "output": "10"}, {"type": "stdin_stdout", "input": "3 4\n.#.\n..#\n#..", "output": "16"}, {"type": "stdin_stdout", "input": "3 4\n.#.\n..#\n#./", "output": "27"}, {"type": "stdin_stdout", "input": "3 3\n/#.\n..#\n#..", "output": "18"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the city of Nevermore, there ...
[{"type": "stdin_stdout", "input": "10 0 2 4\n3\n-1 3\n10 2\n2 4", "output": "1191.415926535898\n"}, {"type": "stdin_stdout", "input": "1 1 2 13\n3\n3 1\n5 -1\n-1 7", "output": "1300.000000000000\n"}, {"type": "stdin_stdout", "input": "0 1 2 17\n3\n3 2\n8 -1\n-1 4", "output": "1800.000000000000\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo deer, AtCoDeer and TopCoDeer...
[{"type": "stdin_stdout", "input": "H 14", "output": "D\n"}, {"type": "stdin_stdout", "input": "H 15", "output": "D\n"}, {"type": "stdin_stdout", "input": "H 23", "output": "D\n"}, {"type": "stdin_stdout", "input": "H 17", "output": "D\n"}, {"type": "stdin_stdout", "input": "H 13", "output": "D\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N towns located in a l...
[{"type": "stdin_stdout", "input": "10 100\n7 10 4 5 9 3 6 8 1 1", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 100\n7 10 4 5 9 3 6 8 2 1", "output": "2"}, {"type": "stdin_stdout", "input": "5 10\n21 30 40 10 20", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 10\n21 30 40 10 31", "output": "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\nCreate a program that reads poke...
[{"type": "stdin_stdout", "input": "1,2,4,3,1\n3,3,1,3,12\n12,13,11,12,12\n7,6,7,6,7\n3,3,2,3,3\n6,7,8,9,10\n11,13,11,1,13\n11,12,13,1,1", "output": "one pair\nthree card\nthree card\nfull house\nfour card\nstraight\ntwo pair\none pair\n"}, {"type": "stdin_stdout", "input": "1,2,3,4,1\n2,3,1,3,12\n12,13,11,12,12\n7,6,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\nI bought food at the store to ma...
[{"type": "stdin_stdout", "input": "4\nsandwich 30 120\nelppa 50 200\ncheese 20 40\ncake 100 100\n9\nonigiri 80 300\nonigiri 80 300\nanpan 70 280\nmikan 50 80\nkanzume 101 500\nchocolate 50 350\niookce 30 132\npurin 40 400\ncracker 40 154\n0", "output": "cake\nelppa\nsandwich\ncheese\nkanzume\npurin\nchocolate\nonigiri...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 working on the developme...
[{"type": "stdin_stdout", "input": "5 3\n1 5 2\n3 31 5\n6 2 3\n5 5 5\n4 8 3\n0\n1 2 3\n2\n2 2 3 1\n4 3 1 2", "output": "3\n4\n2\n5\n1\n"}, {"type": "stdin_stdout", "input": "5 3\n1 0 2\n3 8 5\n1 2 -1\n9 5 5\n4 8 0\n0\n1 2 3\n1\n2 2 3 1\n4 3 1 2", "output": "4\n5\n2\n3\n1\n"}, {"type": "stdin_stdout", "input": "5 3\n1 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\nA text editor is a useful softwa...
[{"type": "stdin_stdout", "input": "3\nA sample input\n9\nforward word\ndelete char\nforward word\ndelete char\nforward word\ndelete char\nbackward word\nbackward word\nforward word\nHallow, Word.\n7\nforward char\ndelete word\ninsert \"ello, \"\nforward word\nbackward char\nbackward char\ninsert \"l\"\n\n3\nforward vo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 appointed director of a ...
[{"type": "stdin_stdout", "input": "4\n1 2 10\n2 3 10\n3 3 10\n1 3 10\n6\n1 20 1000\n5 25 10000\n2 30 8781\n22 300 5500\n10 117 9000\n7 7 2175\n8\n32 251 2396\n132 281 1659\n222 235 5641\n162 217 1883\n22 158 7195\n194 198 9190\n119 274 1469\n122 334 13708\n0", "output": "30\n21175\n35734\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour friend recently came up wit...
[{"type": "stdin_stdout", "input": "5\n1 2 3 6 4 5 7 13 7\nR R R R R R G G G\n1 2 2 3 4 4 4 4 5\nR R R R R Q R R R\n1 3 3 4 4 4 5 5 5\nR R B R R R R R R\n1 1 1 3 4 5 6 6 10\nR R B G G G R R S\n2 2 2 3 3 3 1 1 2\nR G B R G B R G B", "output": "0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 2 3 6 4 5 7 13 7\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs many of you know, we have two...
[{"type": "stdin_stdout", "input": "4 3\nmeiji 10 1877\ntaisho 6 1917\nrhowa 62 1987\nheisei 22 2010\n2046\n1917\n1988\n1 1\nuniversalbentury 218 2168\n2010\n0 0", "output": "Unknown\ntaisho 6\nUnknown\nuniversalbentury 60\n"}, {"type": "stdin_stdout", "input": "4 3\nmeiji 10 1877\nasisho 6 3102\nsiowa 62 1987\nieisei ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 pass\n\nMr. D, a univers...
[{"type": "stdin_stdout", "input": "3 3 3 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 2 2\n1 3\n0\n3 3 2 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 2 2\n1 3\n0\n12 4 3 2\n1 2 3 1 1\n1 3 8 1 1\n4 11 3 2 2\n5 6 7 2 2\n1 6\n0\n3 3 3 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 1 2\n1 3\n2\n2 6 1 2\n1 2 2\n3 3 2 2\n1 2 3 1 1\n1 3 8 1 1\n2 3 3 1 2\n1 3\n2\n2 6 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\nC --Misawa's rooted tree\n\nProb...
[{"type": "stdin_stdout", "input": "((()[1]())[2]())[5](((()[2]())[6](()[3]()))[8]()(\n(()[4]())[3](((()[2]())[1]())[8](()[4]')))", "output": "(()[6]())[8](((()[4]())[7]())[16]())\n"}, {"type": "stdin_stdout", "input": "((()[8]())[2]())[5](((()[3]())[6](()[3]()))[2]())\n(()[4]())[2](((()[2]())[1]())[8](()[3]())(", "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\nNotes\n\nTemplate in C\n\nConstr...
[{"type": "stdin_stdout", "input": "1 1 + 5 11 - *", "output": "-12\n"}, {"type": "stdin_stdout", "input": "0 0 + 6 21 - +", "output": "-15\n"}, {"type": "stdin_stdout", "input": "1 12 + 3 8 - *", "output": "-65\n"}, {"type": "stdin_stdout", "input": "1 0 + 6 21 - +", "output": "-14\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which reads a li...
[{"type": "stdin_stdout", "input": "92 101 -1\n16 30 -1\n0 2 -1\n-1 -1 -1", "output": "A\nD\nF\n"}, {"type": "stdin_stdout", "input": "150 64 -2\n16 30 -1\n1 0 -1\n-1 -1 -1", "output": "A\nD\nF\n"}, {"type": "stdin_stdout", "input": "116 100 -1\n16 50 -1\n1 1 0\n-1 -1 -1", "output": "A\nB\nF\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\nJohn Smith knows that his son, T...
[{"type": "stdin_stdout", "input": "18\n68 32 84 6\n44 53 11 21\n61 34 77 82\n19 36 47 58\n47 73 31 96\n17 50 82 16\n57 90 64 8\n14 37 45 69\n48 1 18 58\n42 34 96 14\n56 82 33 77\n40 66 30 53\n33 31 44 95\n0 90 24 8\n7 85 39 1\n76 77 93 35\n98 9 62 13\n24 84 60 51\n", "output": "8\n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two bus stops denoted ...
[{"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n2 2\n", "output": "Yes\n 2000000000 2000000001"}, {"type": "stdin_stdout", "input": "2 10\n4 5\n2 2\n", "output": "Yes\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\nToday is tuesday, that means the...
[{"type": "stdin_stdout", "input": "15 34 2\n1 8\n2 8\n3 8\n4 8\n5 8\n6 8\n7 8\n9 8\n10 8\n11 8\n12 8\n13 8\n14 8\n15 8\n1 9\n3 9\n5 9\n7 9\n11 9\n13 9\n15 9\n1 5\n13 5\n3 11\n7 11\n15 11\n2 10\n4 10\n6 10\n12 10\n14 10\n2 6\n12 6\n4 14\n", "output": "CYCLES\n5\n14 4 10 2 8\n5\n12 6 10 2 8\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\nGiven two integers n and x, cons...
[{"type": "stdin_stdout", "input": "16 210\n", "output": "32767\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...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMarcin is a coach in his univers...
[{"type": "stdin_stdout", "input": "10\n206158430208 206162624513 68719476737 137506062337 206162624513 4194305 68719476737 206225539072 137443147777 109376694609\n202243898 470292528 170057449 290025540 127995253 514454151 607963029 768676450 611202521 68834463\n", "output": "2704208829\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\nRecently you have bought a snow ...
[{"type": "stdin_stdout", "input": "6\nLRU\nDURLDRUDRULRDURDDL\nLRUDDLRUDRUL\nLLLLRRRR\nURDUR\nLLL\n", "output": "2\nLR\n14\nLLLUUUURRRDDDD\n12\nLLLUUURRRDDD\n2\nLR\n2\nUD\n0\n\n"}, {"type": "stdin_stdout", "input": "6\nLRU\nDURLDRUDRULRDURDDL\nLRUDDLRUDRUL\nLLLLRRRR\nURDUR\nLLL\n", "output": "2\nLR\n14\nLLLUUUURRRDDDD...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "11\nb\naaaaaaaaaaa\ncba\nabcabcabcabcabcabcabc\nbvdhsdvlbelrivbhxbhie\ny\nabacabadabacaba\nabacabadabacaba\nabacabadabacaba\nbaabaabdaa\nabbab\nbabaabaabcbabaaa\nt\nz\nu\nt\nkiihgfedcba\nabccefghijk\nabcdefghijk\nkjihgfdecba\nbba\nabaabbbb\n", "output": "-1\n15\n-1\n1\n2\n-1\n-1\n-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\nIt is Professor R's last class o...
[{"type": "stdin_stdout", "input": "70 11 17929\n10313 427 268935 211 197219 148 357 179290 97 358580 475 343 175 221 286864 429 304793 179290 189 363 221 340651 376509 453 251006 141 304793 358580 235 107574 141 358580 167 181 101469 335 286864 171 107574 105 449 358580 286864 161 286864 349 89645 197219 395 358580 23...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKaavi, the mysterious fortune te...
[{"type": "stdin_stdout", "input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294\n"}, {"type": "stdin_stdout", "input": "cb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya very much likes pla...
[{"type": "stdin_stdout", "input": "1110110101111111001111111110111011100001110111011001011111111111011010011111?111111?011111110001010110011111010111100111?111101010011101010?011111101010111111111101111010111?1111111100110110001111101111100100110011101111011110111000111?011110?111110?1011010111101111101111010100111110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 called reg...
[{"type": "stdin_stdout", "input": "12\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "12\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(?)?\n(??)\n(??)\n(??)\n(??)\n(??)\n", "output": "YES\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are playing a game similar t...
[{"type": "stdin_stdout", "input": "1\n10 10\n-1690085822 -916138523 -582832806 -399654630 -299751944 -269053050 -220763772 115612869 134734706 330611632\n-836519191 -611761365 -306272 8975969 469083185 681128970 789056642 862703103 881641726 895240878\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n10 10\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAquaMoon has n friends. They sta...
[{"type": "stdin_stdout", "input": "10\n10\n6 2 1 1 1 10 10 2 10 5\n8\n1 3 1 1 4 5 4 4\n9\n14 6 9 9 2 8 7 2 2\n10\n9 4 3 3 5 4 3 10 4 5\n9\n7 5 1 7 5 5 5 5 6\n8\n8 8 4 4 7 6 2 8\n10\n6 8 1 6 8 8 5 6 8 4\n10\n5 5 5 8 3 4 3 3 10 10\n8\n1 1 3 6 6 7 1 2\n8\n4 1 3 5 3 1 3 3\n", "output": "NO\nYES\nYES\nYES\nYES\nYES\nYES\nY...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 input co...
[{"type": "stdin_stdout", "input": "10 165056\n", "output": "391 431\n"}, {"type": "stdin_stdout", "input": "10 595169\n", "output": "619 770\n"}, {"type": "stdin_stdout", "input": "10 156555\n", "output": "468 325\n"}, {"type": "stdin_stdout", "input": "10 140634\n", "output": "323 383"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you very well know, this year...
[{"type": "stdin_stdout", "input": "999999190\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "999999940\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "816761542\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "999887464\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "99999999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSeveral ages ago Berland was a k...
[{"type": "stdin_stdout", "input": "1000 1100 1000\n", "output": "3196901\n"}, {"type": "stdin_stdout", "input": "1000 0100 1000\n", "output": "1197901\n"}, {"type": "stdin_stdout", "input": "1000 1000 1000\n", "output": "2997001"}, {"type": "stdin_stdout", "input": "998 999 1001\n", "output": "2993002\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou're given a string of lower-c...
[{"type": "stdin_stdout", "input": "ipsrjylhpkjvlzncfixipstwcicxqygqcfrawpzzvckoveyqhathglblhpkjvlzncfixipfajaqobtzvthmhgbuawowoknirclxg\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbffffffffffffffffffffffgffffffffffffff\n", "output": "61\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasily the bear has a favorite r...
[{"type": "stdin_stdout", "input": "-1000000000 -1000000000\n", "output": "-2000000000 0 0 -2000000000 "}, {"type": "stdin_stdout", "input": "-1000000000 -999999999\n", "output": "-1999999999 0 0 -1999999999 "}, {"type": "stdin_stdout", "input": "-999999999 -1000000000\n", "output": "-1999999999 0 0 -1999999999 "}, {"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 permutation p is an ordered gr...
[{"type": "stdin_stdout", "input": "7563 3781\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49 52 51 54 53 56 55 58 57 60 59 62 61 64 63 66 65 68 67 70 69 72 71 74 73 76 75 78 77 80 79 82 81 84 83 86 85 88 87 90 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\nKsenia has ordinary pan scales a...
[{"type": "stdin_stdout", "input": "CKQHRUZMISGE|FBVWPXDLTJYN\nOA\n", "output": "CKQHRUZMISGEO|FBVWPXDLTJYNA\n"}, {"type": "stdin_stdout", "input": "V|CMOEUTAXBFWSK\nDLRZJGIYNQHP\n", "output": "VDLRZJGIYNQHP|CMOEUTAXBFWSK\n"}, {"type": "stdin_stdout", "input": "QWHNMALDGKTJ|\nPBRYVXZUESCOIF\n", "output": "QWHNMALDGKTJP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub isn't well prepared on geo...
[{"type": "stdin_stdout", "input": "10 10\n3 4 2 6 1 9 0 0 8 7\n5 7\n2 6\n0 1\n5 11\n3 4\n2 5\n2 10\n4 6\n3 6\n3 7\n", "output": "0 1 1 0 0 1 0 1 0 1 "}, {"type": "stdin_stdout", "input": "10 10\n4 4 2 6 1 9 0 0 8 7\n5 7\n2 6\n0 1\n5 11\n3 4\n2 5\n2 10\n4 6\n3 6\n3 7\n", "output": "0 1 1 0 0 1 0 1 0 1 "}, {"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\nYou have k pieces of laundry, ea...
[{"type": "stdin_stdout", "input": "10000 1000 1000 1000 1010 1000 1000\n", "output": "12100\n"}, {"type": "stdin_stdout", "input": "10000 1000 1000 1000 1010 1001 1000\n", "output": "12101\n"}, {"type": "stdin_stdout", "input": "10000 1000 1000 1000 1000 1000 1000\n", "output": "12000"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 city with n horizontal...
[{"type": "stdin_stdout", "input": "20 20\n<>>>>>>>><>>><>><<<>\nvv^^vv^^^^v^vv^v^^^^\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "20 20\n><<><<<<<<<>>><>>><<\n^^^^^^^^vvvv^vv^vvvv\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "20 20\n><><><><><><><><><><\n^v^v^v^v^v^v^v^v^v^v\n", "output": "Y...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a new professor of grap...
[{"type": "stdin_stdout", "input": "10 22\nazbrll oen\ngh vdyayei\njphveblohx vfglv\nmfyxib jepnvhcuwo\nrpikazqj uam\nl rx\nokjenof qpnyi\nj tixqrno\nod itozmfct\nikkdxmirx ev\nqexftojc p\nkdazb zjs\nmbk ykvqjrxaxu\nhbcwhouzq pwt\nmirpsz zfaegpl\nuhkkvcj rlvwj\nef iqnnwtolrc\npjzfcpmeag ecdayth\nsa qcthz\ncbfhfxi qrnbv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 flying in the airpla...
[{"type": "stdin_stdout", "input": "5\n\n3 3\n1 1 1\n0 0\n0 1\n\n3 3\n1 1 1\n1 0\n2 1\n\n3 3\n1 1 1\n1 0\n0 1\n\n3 3\n1 1 1\n0 0\n1 0\n\n3 3\n1 1 1\n0 0\n1 1\n", "output": "YYY\nYYN\nYYY\nYYY\nYYY\n"}, {"type": "stdin_stdout", "input": "5\n\n3 3\n1 1 1\n0 0\n0 1\n\n3 3\n1 1 1\n1 0\n2 1\n\n3 3\n1 1 1\n1 0\n0 1\n\n3 3\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\nBerlanders like to eat cones aft...
[{"type": "stdin_stdout", "input": "10 10\n971 -2437\n-3336 3332\n-7503 -8713\n-9337 -9607\n-927 -9162\n-4375 -3790\n-913 -257\n-5916 5783\n5131 -7304\n9993 -9999\n-2774 8057\n8670 -7936\n8388 3302\n8718 -4865\n3329 -3334\n5088 -1539\n5050 8130\n4710 -2803\n8124 -4062\n-10000 9997\n", "output": "YES\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\nYou are given a string s and sho...
[{"type": "stdin_stdout", "input": "tcpyttzcpo\n10\n2 3 6\n2 4 1\n2 6 9\n7 10 5\n2 3 5\n4 10 6\n3 4 5\n7 9 4\n9 10 7\n2 10 8\n", "output": "ttcyopztcp\n"}, {"type": "stdin_stdout", "input": "tcpyzttcpo\n10\n2 3 6\n4 4 1\n2 6 9\n2 10 5\n2 3 5\n4 5 11\n3 4 5\n7 9 4\n9 10 7\n1 10 8\n", "output": "pccozptytt\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\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\nRecently Anton found a box with ...
[{"type": "stdin_stdout", "input": "4759823 3520376 4743363 4743363\n", "output": "1214827648\n"}, {"type": "stdin_stdout", "input": "5000000 5000000 5000000 5000000\n", "output": "1280000000\n"}, {"type": "stdin_stdout", "input": "4288078 3520376 4743363 4743363\n", "output": "1097747968\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\nNothing is eternal in the world,...
[{"type": "stdin_stdout", "input": "!!!!!!!!!!!!!!!!!!Y!!!!!!!!!!!!!!!!!!B!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!G!!R!!!!!!!!!!!!\n", "output": "24 24 24 24\n"}, {"type": "stdin_stdout", "input": "!Y!!!Y!!G!!!G!!B!!R!!!!B!!!!!Y!!G!R!!!!!!!!!!!!B!!!!GY!B!!!!!YR!G!!!!!!B!Y!B!!!!!!R!G!!!!!!!G!R!!!!B\n", "output": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe marmots need to prepare k pr...
[{"type": "stdin_stdout", "input": "13 13\n93 19 58 34 96 7 35 46 60 5 36 40 41\n57 3 42 68 26 85 25 45 50 21 60 23 79\n", "output": "1154\n"}, {"type": "stdin_stdout", "input": "13 13\n93 19 58 34 96 7 35 46 60 5 66 40 41\n57 3 42 68 26 85 25 45 50 21 60 23 79\n", "output": "1184\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\nWe often go to supermarkets to b...
[{"type": "stdin_stdout", "input": "50 37\n78 49\n96 4\n86 118\n28 4\n19 2\n79 43\n79 92\n95 35\n33 60\n54 84\n90 25\n2 19\n53 21\n86 52\n72 25\n6 8\n41 46\n3 68\n42 89\n33 48\n57 43\n99 45\n1 126\n38 62\n11 50\n55 84\n1 97\n12 67\n51 96\n51 7\n1 100\n79 61\n66 54\n97 93\n52 75\n80 41\n98 73\n29 28\n73 108\n24 73\n3 25...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves hockey very much. On...
[{"type": "stdin_stdout", "input": "100\nqn\nBE\nyN\nep\nPq\nXz\nLM\nEZ\ndb\nMn\nbn\nFe\nqA\nzc\nyq\npC\nyA\nWk\nYq\nrs\noD\nvD\nzW\nxZ\nbl\nur\nkf\ndf\nLS\nUW\nMy\nhR\nsh\nNh\nog\nCW\nor\nzo\nrO\nao\nXH\nDq\nKa\nlL\nYQ\nOh\nRZ\nAx\nta\nko\nDn\nNg\nNy\nDB\nYD\njO\nAp\nFT\noB\nNc\nwB\nHO\neW\nAc\nDr\nMt\nDf\nbF\nFP\nRa\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two squares, one w...
[{"type": "stdin_stdout", "input": "-17 -91 -17 -27 -81 -27 -81 -91\n-48 -21 -12 -57 -48 -93 -84 -57\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-100 -100 -100 -99 -99 -99 -99 -100\n-10 -10 -9 -9 -10 -8 -11 -9\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-100 -100 -100 100 100 100 100 -100\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\nSteve Jobs' ghost has come down ...
[{"type": "stdin_stdout", "input": "next\n2\nnextpermutation\nnextelement\n\nSAMPLE", "output": "nextelement\n"}, {"type": "stdin_stdout", "input": "next\n2\nnextpermutation\nnextelement\n\nSAMPEL", "output": "nextelement\n"}, {"type": "stdin_stdout", "input": "next\n3\nnextpermutation\nnexteldment\n\nSAMPLE", "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\nGiven is an integer N. Find the ...
[{"type": "stdin_stdout", "input": "1568902019 2", "output": "31\n"}, {"type": "stdin_stdout", "input": "4000772700 2", "output": "32\n"}, {"type": "stdin_stdout", "input": "279134799 3", "output": "18\n"}, {"type": "stdin_stdout", "input": "314159265 4", "output": "15\n"}, {"type": "stdin_stdout", "input": "550505180 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 locked treasure boxes,...
[{"type": "stdin_stdout", "input": "4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n41097 1\n2\n86918 1\n3", "output": "69942\n"}, {"type": "stdin_stdout", "input": "4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3", "output": "69942"}, {"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\nThe development of algae in a po...
[{"type": "stdin_stdout", "input": "28 -2 -1", "output": "-26\n-726\n-20326\n-569126\n-15935526\n-446194726\n-12493452326\n-349816665126\n-9794866623526\n-274256265458726\n"}, {"type": "stdin_stdout", "input": "17 -2 -1", "output": "-15\n-253\n-4299\n-73081\n-1242375\n-21120373\n-359046339\n-6103787761\n-103764391935\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\nAs AtCoder Beginner Contest 100 ...
[{"type": "stdin_stdout", "input": "10\n2184 2126 1721 1800 1480 2528 3360 1945 1280 1776", "output": "32\n"}, {"type": "stdin_stdout", "input": "10\n2184 2126 1721 1800 1480 2850 3360 1945 1280 1776", "output": "28\n"}, {"type": "stdin_stdout", "input": "10\n2184 2126 1721 1800 1480 2850 1620 1945 1280 1776", "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\nAs a token of his gratitude, Tak...
[{"type": "stdin_stdout", "input": "314159265 358979323846264338", "output": "31"}, {"type": "stdin_stdout", "input": "15043200 358979323846264338", "output": "35\n"}, {"type": "stdin_stdout", "input": "12899738 158337027091717102", "output": "34\n"}, {"type": "stdin_stdout", "input": "12899738 686618920047839292", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi loves numbers divisibl...
[{"type": "stdin_stdout", "input": "101", "output": "64\n"}, {"type": "stdin_stdout", "input": "111", "output": "64\n"}, {"type": "stdin_stdout", "input": "110", "output": "64\n"}, {"type": "stdin_stdout", "input": "121", "output": "64\n"}, {"type": "stdin_stdout", "input": "104", "output": "64\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke loves flags.\n\nSnuke is p...
[{"type": "stdin_stdout", "input": "22\n93 6440\n78 6647\n1028 11\n8306 9689\n798 99\n801 521\n188 206\n6079 971\n4559 209\n50 94\n92 6270\n5403 560\n803 83\n1855 99\n42 504\n75 484\n629 11\n92 122\n3359 37\n28 16\n648 14\n11 269", "output": "17\n"}, {"type": "stdin_stdout", "input": "22\n93 6440\n78 6647\n889 11\n8306...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCODE FESTIVAL 2016 is going to b...
[{"type": "stdin_stdout", "input": "EDOC6102LAVITSEF", "output": "16\n"}, {"type": "stdin_stdout", "input": "1DO2LAVI6REGE0TC", "output": "15\n"}, {"type": "stdin_stdout", "input": "VT0EGER6ICAL2OD0", "output": "10\n"}, {"type": "stdin_stdout", "input": "VV1EFFR7ICAK2OD0", "output": "11\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTaro is very good at 8 puzzles a...
[{"type": "stdin_stdout", "input": "2\n1 0 3\n4 5 6 7 8\n9 0 11\n10\n0\n0 2 3\n4 5 8 7 8\n9 10 11\n0\n0\n3 10 9\n11 7 6 5 5\n3 0 1\n0\n-1", "output": "2\nNA\nNA\n"}, {"type": "stdin_stdout", "input": "2\n1 0 3\n4 5 6 7 8\n9 0 11\n10\n0\n1 2 3\n4 5 6 7 8\n9 10 11\n0\n0\n11 10 5\n3 11 6 5 4\n5 2 1\n0\n-1", "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\nOf the real numbers, those with ...
[{"type": "stdin_stdout", "input": "3.2(145)", "output": "32113/9990\n"}, {"type": "stdin_stdout", "input": "3.3(145)", "output": "16556/4995\n"}, {"type": "stdin_stdout", "input": "5.21(43)", "output": "25811/4950\n"}, {"type": "stdin_stdout", "input": "3.3(155)", "output": "16561/4995\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe ICPC committee would like to...
[{"type": "stdin_stdout", "input": "3 2\n2 1 2\n-1\n3 3 8 8\n3 2\n4 1 5 0 9\n3 2 5 9\n5 2 4 5 7 12\n3 3\n0 1 4\n3 2 5 9\n2 2 4\n3 3\n2 1 1\n3 1 2 9\n2 2 4\n0 0", "output": "8\n5\n0\n1\n"}, {"type": "stdin_stdout", "input": "3 2\n2 1 2\n-1\n3 3 8 8\n3 2\n4 1 5 0 9\n3 2 5 9\n5 2 4 5 7 12\n3 3\n0 1 4\n3 2 5 9\n2 2 4\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\nIt was the last day of the summe...
[{"type": "stdin_stdout", "input": "6 6\n######\n#_|A%#\n#C#_|#\n#^BBa#\n#B&A##\n######\n2\n######\n#)|*.#\n#.#.|#\n#*.**#\n#...##\n$#####\n######\n#*|*.#\n#*#.|#\n#..+*#\n#..*##\n######", "output": "10\n"}, {"type": "stdin_stdout", "input": "6 6\n######\n#_|A%#\n#C#_|#\n#^BBa#\n#B&A##\n######\n2\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\nThere are N towers in the town w...
[{"type": "stdin_stdout", "input": "7\n0 1\n0 2\n2 3\n0 4\n0 5\n0 6", "output": "2071\n"}, {"type": "stdin_stdout", "input": "7\n0 1\n0 2\n1 3\n0 4\n1 5\n0 6", "output": "1303\n"}, {"type": "stdin_stdout", "input": "7\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6", "output": "4683\n"}, {"type": "stdin_stdout", "input": "7\n0 1\n0 2\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\n$ M $ students will b...
[{"type": "stdin_stdout", "input": "2 0\n-1 -1 0 3", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 0\n-1 2 -1 3", "output": "0\n"}, {"type": "stdin_stdout", "input": "11 2\n1 4 10 6", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 2\n0 2 4 10", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 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\nSearch trees are data structures...
[{"type": "stdin_stdout", "input": "8\ninsert 30\ninsert 113\ninsert 18\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint", "output": " 1 17 18 20 25 30 113\n 30 18 1 17 20 25 113\n"}, {"type": "stdin_stdout", "input": "8\ninsert 30\ninsert 166\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 19\nprint", "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\nPrint all combinations which can...
[{"type": "stdin_stdout", "input": "10 5", "output": "31: 0 1 2 3 4\n47: 0 1 2 3 5\n55: 0 1 2 4 5\n59: 0 1 3 4 5\n61: 0 2 3 4 5\n62: 1 2 3 4 5\n79: 0 1 2 3 6\n87: 0 1 2 4 6\n91: 0 1 3 4 6\n93: 0 2 3 4 6\n94: 1 2 3 4 6\n103: 0 1 2 5 6\n107: 0 1 3 5 6\n109: 0 2 3 5 6\n110: 1 2 3 5 6\n115: 0 1 4 5 6\n117: 0 2 4 5 6\n118: ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you might remember, the colle...
[{"type": "stdin_stdout", "input": "5 6 5\n23\n30\n37\n57\n90\n21 \n23 \n35 \n57 \n90 \n92 \n21 \n23 \n30 \n57 \n174", "output": "5\n21\n23\n30\n57\n90\n"}, {"type": "stdin_stdout", "input": "5 6 5\n23\n30\n42\n57\n90\n21 \n23 \n35 \n13 \n36 \n143 \n21 \n23 \n30 \n57 \n90", "output": "5\n21\n23\n30\n57\n90\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\nLittle boy Gerald studies at sch...
[{"type": "stdin_stdout", "input": "68 74\n51 54\n3 22\n12 24\n3 27\n32 42\n36 55\n60 64\n1 4\n4 23\n11 64\n54 62\n50 56\n21 34\n27 63\n15 54\n28 61\n13 57\n39 53\n12 32\n32 40\n33 67\n55 61\n33 67\n30 37\n15 49\n27 45\n21 41\n8 42\n24 63\n40 48\n28 41\n30 67\n0 4\n7 15\n27 59\n60 62\n25 65\n30 31\n38 67\n24 43\n14 64\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider some set of distinct ch...
[{"type": "stdin_stdout", "input": "1000000000 2 2\n1 500000000\n", "output": "933660593\n"}, {"type": "stdin_stdout", "input": "1000000000 2 2\n2 500000000\n", "output": "811805447\n"}, {"type": "stdin_stdout", "input": "1000000000 2 3\n1 500000000\n", "output": "947751250\n"}, {"type": "stdin_stdout", "input": "10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou're given an array a of lengt...
[{"type": "stdin_stdout", "input": "55\n13460 19498 67155 65091 83100 3449 65685 3094 89646 74121 34194 3875 23968 91713 89408 43745 66157 60904 60652 29654 6801 59743 78890 39765 23098 93723 14710 104238 27668 24433 7005 98614 74610 76246 51126 48500 33811 61674 79966 94097 97541 54630 3490 61580 44231 66349 5007 9621...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 2 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 53 62 53 0 1 1 1 1 1 1 1 1 1 1\naaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNastya came to her informatics l...
[{"type": "stdin_stdout", "input": "4 9\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "6 6\n1 1 1 1 2 3\n1 1 1 2 3 1\n1 1 2 3 1 1\n1 3 2 1 1 1\n3 2 1 1 1 1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a consist...
[{"type": "stdin_stdout", "input": "4\n9999991 9999883 9999659 9999433\n", "output": "3 4\n"}, {"type": "stdin_stdout", "input": "4\n9999991 5101198 9999659 9999433\n", "output": "2 4\n"}, {"type": "stdin_stdout", "input": "3\n10000000 9999999 9999997\n", "output": "2 3\n"}, {"type": "stdin_stdout", "input": "3\n100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 mayor of the Central Town wa...
[{"type": "stdin_stdout", "input": "40 100000\n8644 429\n97881 2766\n98955 25663\n8679 187\n54897 23213\n64306 4647\n46280 23471\n31464 3\n35532 2\n95998 1352\n28824 3\n99405 3856\n47271 13832\n66959 7\n50599 11\n70318 293\n84159 236\n10893 1914\n54437 15065\n4468 3\n91940 32106\n87980 50\n81589 378\n8783 23\n11417 690...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 n different binary ...
[{"type": "stdin_stdout", "input": "4\n4\n0001\n1000\n0011\n0111\n3\n010\n101\n0\n2\n00000\n00001\n4\n01\n001\n0001\n00001\n", "output": "1\n3\n-1\n0\n\n2\n1 2\n"}, {"type": "stdin_stdout", "input": "4\n4\n0001\n1000\n0011\n0111\n3\n010\n111\n0\n2\n00000\n00001\n4\n01\n001\n0001\n00001\n", "output": "1\n3\n-1\n0\n\n2\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\nINTERCAL is the oldest of esoter...
[{"type": "stdin_stdout", "input": "aMCT]:0hDJ*Up5g_l:O&>>%gjQkZkb(mi&;\\7dL\"nWOGz/;,6h*@Q0R53MS2<}F~+Ms\\\"cF-lgF0>C&y7)72\\.T\"8*#VO=|^OtYs\n", "output": "122\n212\n240\n152\n112\n94\n80\n246\n244\n208\n254\n170\n156\n98\n198\n236\n196\n218\n106\n142\n232\n0\n216\n190\n144\n204\n180\n124\n132\n144\n50\n94\n32\n50\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a of leng...
[{"type": "stdin_stdout", "input": "3 8\n7 0 3 15 7 1 5 2\n4 3 7\n2 1\n3 2\n4 1 6\n2 3\n1 5 16\n4 8 8\n3 0\n", "output": "31\n22\n1\n"}, {"type": "stdin_stdout", "input": "3 8\n7 0 8 8 7 1 5 2\n4 3 7\n2 1\n3 2\n4 1 6\n2 3\n1 5 16\n4 8 8\n3 0\n", "output": "29\n22\n1\n"}, {"type": "stdin_stdout", "input": "3 8\n4 0 8 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\nWhile exploring the old caves, r...
[{"type": "stdin_stdout", "input": "5 5\n4\nacxxay\nasuuswzxyzwvxvwcbuvtxw\nasxyabczbusyscuatbuzczx\nazvwtyvxcsbcwuyvbzyubz\naayxsvzbyvzbsaxccwxwzbcuwcuy\n0\ncctzttazzwytuxzttxwbvzbsvy\ncbwzsbsb\nca\nucwzvwv\nuatxuabttcxcysvuzywwxa\n1\nbvyyusbcuwactubtasbcbbcvwsawt\nwwbyzza\nwacsuvyaxvvvx\nwawccbzxcybzwbavcs\nwvbycwsxc...
code_stdio