messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Monty is very fond of Fib...
[{"type": "stdin_stdout", "input": "3\n4\n4\n4\n\nELALPS", "output": "10\n10\n10\n"}, {"type": "stdin_stdout", "input": "3\n4\n11\n2\n\nSALPME", "output": "10\n35\n4\n"}, {"type": "stdin_stdout", "input": "3\n4\n4\n8\n\nELAKPT", "output": "10\n10\n24\n"}, {"type": "stdin_stdout", "input": "3\n7\n10\n2\n\nRAPLMF", "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\nTakahashi has a string S of leng...
[{"type": "stdin_stdout", "input": "20 16\n10763178948652303319", "output": "136\n"}, {"type": "stdin_stdout", "input": "20 16\n46280926482052991001", "output": "139\n"}, {"type": "stdin_stdout", "input": "20 8\n33883322005544116655", "output": "171\n"}, {"type": "stdin_stdout", "input": "20 2\n33883322005544116655", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider the following arithmeti...
[{"type": "stdin_stdout", "input": "2\n12 1 5\n42764 449743 2019", "output": "524160\n165266\n"}, {"type": "stdin_stdout", "input": "2\n12 1 5\n42764 376063 2019", "output": "524160\n455865\n"}, {"type": "stdin_stdout", "input": "2\n12 1 5\n23772 376063 2019", "output": "524160\n755257\n"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet N be a positive odd number.\...
[{"type": "stdin_stdout", "input": "5\n1.1614561119919404 1.1884479131493024 2.346315137474776 3.457070091264252 0.7256297605857085", "output": "0.0803727774076\n"}, {"type": "stdin_stdout", "input": "5\n1.1614561119919404 1.1884479131493024 2.346315137474776 4.129281462465055 0.7256297605857085", "output": "-0.1355589...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 X-layered kagami mochi (X ≥ 1...
[{"type": "stdin_stdout", "input": "7\n50\n30\n50\n100\n50\n80\n35", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n50\n40\n91\n110\n50\n34\n59", "output": "6\n"}, {"type": "stdin_stdout", "input": "7\n50\n30\n50\n100\n50\n80\n59", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n50\n40\n50\n100\n50\n80...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob are controlling a ...
[{"type": "stdin_stdout", "input": "0 148 36 100", "output": "64\n"}, {"type": "stdin_stdout", "input": "-1 148 38 83", "output": "45\n"}, {"type": "stdin_stdout", "input": "10 94 67 145", "output": "27\n"}, {"type": "stdin_stdout", "input": "1 75 25 100", "output": "50\n"}, {"type": "stdin_stdout", "input": "1 80 25 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a railroad in Takahashi...
[{"type": "stdin_stdout", "input": "20 987654321\n129662684 2\n162021979 1\n458437539 1\n258406183 2\n202863355 1\n112218745 1\n348732033 1\n323036578 1\n382398703 1\n55854389 1\n283445191 1\n151300613 1\n693338042 2\n191178308 2\n386707193 1\n204580036 1\n335134457 1\n122253639 1\n824646518 2\n902554792 2", "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\nFukushima Prefecture is also fam...
[{"type": "stdin_stdout", "input": "the cost of one peach is higher than th`t of one apple.", "output": "the cost of one apple is higher than th`t of one peach.\n"}, {"type": "stdin_stdout", "input": "the cost of ooe peach is higher than th`t of one apple.", "output": "the cost of ooe apple is higher than th`t of one p...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWater Country Water Deven has n ...
[{"type": "stdin_stdout", "input": "5 6\n0 2 0\n0 1 0\n2 3 16\n1 3 2\n3 4 5\n0 0 1\n3 3\n0 2 3\n2 0 3\n0 1 12\n0 0", "output": "7\n15\n"}, {"type": "stdin_stdout", "input": "5 6\n0 0 1\n2 2 3\n2 3 12\n0 3 0\n2 4 14\n1 3 4\n3 3\n0 2 3\n1 0 3\n0 1 1\n0 0", "output": "30\n4\n"}, {"type": "stdin_stdout", "input": "5 6\n0 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\nWe, the researchers who discover...
[{"type": "stdin_stdout", "input": "aaaabaaaabaaaabaaaab\naabaa", "output": "1576\n"}, {"type": "stdin_stdout", "input": "aaaabaaaabaa`abaaaab\naabaa", "output": "1248\n"}, {"type": "stdin_stdout", "input": "aaaabaaaabaa`ababaaa\naabaa", "output": "1446\n"}, {"type": "stdin_stdout", "input": "aaaabaaaabaaaabaaaab\naaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTake the'IOI'train\n\nA new rail...
[{"type": "stdin_stdout", "input": "12 -1\nHOOIO\nOHIQO", "output": "0\n"}, {"type": "stdin_stdout", "input": "12 -1\nHPOIO\nOHIQO", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 -1\nOIOOI\nOOINI", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 -1\nOOIOI\nOOINI", "output": "0\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\nProfessor Tsukuba invented a mys...
[{"type": "stdin_stdout", "input": "19\n 1 +x 1 +y +z 3 +z\n 3 +y -z +x +y -z -x +z 2 +z\n 2 +y\n19\n 1 +x 1 +x +z 3 +y -z +x +y -z -x +z 2 +y\n 3 +z\n 2 +z\n19\n 1 +x 1 +y +z 3 +z\n 3 +y -z +x +y -z -x +z 2 +y\n 2 +z\n18\n 1 -y\n 1 +y -z +x\n 1 +z +y +x +z +y -x -y 1 -y\n 2 +z\n3 +x +y +z\n3 +y +z -x\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\nA gene is a string consisting of...
[{"type": "stdin_stdout", "input": "-1 2 1 1\n3\ninv: at b b b\nat: [ATG] b\nb: [C]", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 -1 2 0\n0\ninv: as c c `\nta: [ATG] b\n:b [C\\", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 -1 2 0\n0\ninv: as c c `\nta: [ATG] b\n:b [C]", "output": "0\n"}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a given sequence $A = \\\\{a...
[{"type": "stdin_stdout", "input": "5\n3 -13 7 -1 -4", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n3 -13 10 0 -4", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n3 -13 10 0 -5", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n2 -13 10 0 -5", "output": "6\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\nYou are given a chessboard of si...
[{"type": "stdin_stdout", "input": "4 5\n2 1\n1 4\n5 3\n3 2\n2 4\n", "output": "11\n10\n10\n13\n4\n"}, {"type": "stdin_stdout", "input": "4 5\n2 1\n1 4\n5 3\n6 2\n2 4\n", "output": "11\n10\n10\n11\n4\n"}, {"type": "stdin_stdout", "input": "8 5\n2 1\n4 4\n4 3\n3 2\n2 4\n", "output": "37\n14\n46\n41\n6\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\nLet n be an integer. Consider al...
[{"type": "stdin_stdout", "input": "1000000\n", "output": " 549766631"}, {"type": "stdin_stdout", "input": "771623\n", "output": " 501916356"}, {"type": "stdin_stdout", "input": "623847\n", "output": " ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a long stick, consistin...
[{"type": "stdin_stdout", "input": "2 1000000000 1\n1 1001000000\n", "output": "1001000000\n"}, {"type": "stdin_stdout", "input": "2 1000000000 1\n1 1000001000\n", "output": "1000001000\n"}, {"type": "stdin_stdout", "input": "2 1000000000 1\n1 1000000000\n", "output": "1000000000"}, {"type": "stdin_stdout", "input": "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\nVasya has written some permutati...
[{"type": "stdin_stdout", "input": "10\n4\n2 4 4 5\n4\n2 -1 4 -1\n4\n4 5 5 5\n4\n2 3 4 5\n4\n2 3 4 5\n4\n-1 3 4 5\n4\n-1 3 4 5\n4\n3 3 4 5\n4\n3 5 5 5\n4\n5 4 5 5\n", "output": "1 3 2 4 \n1 2 3 4 \n-1\n1 2 3 4 \n1 2 3 4 \n1 2 3 4 \n1 2 3 4 \n2 1 3 4 \n-1\n-1\n"}, {"type": "stdin_stdout", "input": "10\n4\n2 4 4 5\n4\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\nWhile sailing on a boat, Inessa ...
[{"type": "stdin_stdout", "input": "1 1000000\n", "output": "499999999999.5000000000000\n"}, {"type": "stdin_stdout", "input": "207434 496771\n", "output": "491126.2427687842865\n"}, {"type": "stdin_stdout", "input": "91306 947926\n", "output": "4874963.9445381462574\n"}, {"type": "stdin_stdout", "input": "7882 399082\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNikolay got a string s of even l...
[{"type": "stdin_stdout", "input": "8\nbbbabbba\n", "output": "2\nabbaabba"}, {"type": "stdin_stdout", "input": "8\nbbabbbaa\n", "output": "3\nabababba"}, {"type": "stdin_stdout", "input": "8\nbbbababa\n", "output": "1\nbabababa"}, {"type": "stdin_stdout", "input": "8\nababbbba\n", "output": "1\nababbaba"}, {"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\nThis is a harder version of the ...
[{"type": "stdin_stdout", "input": "500\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 play a computer game. In thi...
[{"type": "stdin_stdout", "input": "2\n6\n2 3 11 14 1 8\n2\n3 2\n000 1\n5\n3 5 100 2 3\n2\n30 5\n90 1\n", "output": "-1\n-1\n"}, {"type": "stdin_stdout", "input": "2\n6\n1 3 11 14 1 10\n2\n3 2\n100 1\n5\n3 5 100 2 3\n2\n30 5\n11 1\n", "output": "5\n-1\n"}, {"type": "stdin_stdout", "input": "2\n6\n1 3 11 16 1 10\n2\n3 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\nGuy-Manuel and Thomas are going ...
[{"type": "stdin_stdout", "input": "8\n-440365664 -1386303283\n107345267 -994221803\n248590739 -968608613\n473576011 -880752952\n138674534 994450706\n-164464580 986382989\n-522092561 852888831\n-874210729 485546704\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "8\n-440365664 -897818514\n107345267 -994221803\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova had a pretty weird sleeping...
[{"type": "stdin_stdout", "input": "65 654 560 571\n83 511 615 263 171 146 241 511 582 216 352 632 506 538 536 217 627 213 324 579 172 241 363 584 450 144 447 536 241 523 162 21 437 291 191 111 567 502 170 570 231 493 169 360 107 114 322 160 574 611 460 558 616 361 284 58 41 345 450 560 543 520 105 416 38\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\nRidhiman challenged Ashish to fi...
[{"type": "stdin_stdout", "input": "20\n541032394951352952 204302388514120798 548305186805250399 743987576790520671 332874928746186630 60150973547887825 600093435051546090 862815570651991829 798946884837606574 383607230476788640 748981752333005915 317959714195378963 824508576221039025 547099154391774856 411018774272655...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 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\nWabbit is trying to move a box c...
[{"type": "stdin_stdout", "input": "5\n1 0 1000000000 1000000000\n1 1 1000000000 1000001100\n1 0 1001000000 1000000000\n1 1 1100010011 1001000000\n2 1 108856 18413\n", "output": "2000000001\n2000001100\n2001000001\n2101010011\n127268\n"}, {"type": "stdin_stdout", "input": "5\n1 0 1000000000 1000000000\n1 1 1001000000 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\nRidbit starts with an integer n....
[{"type": "stdin_stdout", "input": "6\n1\n2\n3\n10\n10\n18\n", "output": "0\n1\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "6\n1\n2\n3\n14\n6\n45\n", "output": "0\n1\n2\n2\n2\n3\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n3\n11\n4\n45\n", "output": "1\n1\n2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer n. Chec...
[{"type": "stdin_stdout", "input": "6\n3\n3\n4\n5\n998244353\n1368804034442\n", "output": "YES\nYES\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\n2\n3\n4\n5\n998244353\n1099511627776\n", "output": "\nNO\nYES\nNO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "6\n3\n3\n4\n5\n998244353\n109951162777...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 know, Bob's brother lives...
[{"type": "stdin_stdout", "input": "50\n7 34\n5 34\n5 11\n11 23\n42 5\n41 11\n12 41\n41 49\n1 49\n12 6\n7 15\n17 42\n20 6\n17 46\n20 19\n46 22\n49 40\n44 40\n43 46\n22 8\n17 29\n44 18\n31 18\n46 9\n7 16\n32 11\n13 41\n20 36\n34 25\n46 28\n39 34\n30 42\n11 47\n45 15\n37 17\n4 23\n35 17\n17 48\n2 17\n34 24\n1 10\n21 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\nYou have an initially empty caul...
[{"type": "stdin_stdout", "input": "100\n2\n36\n43\n19\n99\n100\n98\n9\n79\n57\n1\n78\n56\n14\n66\n93\n62\n50\n76\n33\n25\n41\n15\n61\n97\n33\n51\n97\n95\n96\n83\n53\n12\n77\n87\n85\n37\n72\n82\n70\n44\n69\n58\n52\n48\n73\n21\n24\n20\n8\n31\n32\n45\n55\n29\n13\n28\n49\n60\n54\n90\n86\n94\n10\n71\n47\n40\n74\n80\n23\n26...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSherlock Holmes found a mysterio...
[{"type": "stdin_stdout", "input": "10\njrojjyqqjtrfjf\nvuwzvmwjyfvifdfddymwfuzmvvummwdfzjzdvzuvfvjiuvyzymviyyumvziyimfzfiji\nwxzwojjzqzyqlojjbrjlbqrrwqw\nqfwppnuvbgegbqgbmeqpbguwmmqhunnquepepeewubbmnenvmwhnvhunnmsqmmgfepevupewvenmwpmgspnebv\nrxqzorkizznsiirciokscrrjqqqzkfijrrkkfrqjjifczcjcnqoisorszkjxcxvqzcfczqfcrvfrs...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 plays a computer game with...
[{"type": "stdin_stdout", "input": "101 1\n----------------------------------------------------------------------------------------------------X\n----------------------------------------------------------------------------------------------------X\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "100 10\n-X----...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a top secret mission to...
[{"type": "stdin_stdout", "input": "853332331434235 35 77\nBy\nhs\nzB\njs\nIr\nEa\nHG\nxb\nxG\nFp\nAC\nDt\nwo\nFB\nzh\nim\ntx\nyi\ngC\nkp\njz\ndc\nwE\naa\nsG\nng\ncr\npB\nCg\ncv\nxs\nDn\ndg\nyj\nCd\naC\nIi\ngH\nml\nww\nAD\nir\nti\nEr\nCj\nHt\nAe\nsn\naH\nHv\nan\nDf\nGn\nfC\nay\ngB\nlh\nup\nda\nzs\nbh\nHB\nHd\nmg\nzy\nG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou've got string s, consisting ...
[{"type": "stdin_stdout", "input": "dcijflpluxgeqlroaktzcujfaaidnrdzgogzhobhsmbwmjpschtvjmivfapddsmxfvlhhgguymgtdjxpiezbnlmnlvdnuaohqskdbcjlyfdrzicflveffvpeyzhwqqdaenbsghuvetpxvqcutjxbelbfzuqpwlfvveebnmkoryxgodpccanzwhziiiumgtwskxhrhwdkwmyreefwmoedcvaokvetcgundyiidsqkolpqkarpszrrmagrfvpnwharotashtwcnrcnhapdwrbltgkpkkml...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGreg has an array a = a1, a2, .....
[{"type": "stdin_stdout", "input": "4 3 6\n1 2 3 4\n1 2 1\n2 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "5 18 31 20 \n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 2 3 4\n1 2 2\n2 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 22 31 20\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 2 3 4\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\nNothing has changed since the la...
[{"type": "stdin_stdout", "input": "100000\n99000 100000 999 100010\n100000 100000 100000 100000\n100000 100000 100000 100000\n100000 100000 100000 100000\n", "output": "1 99000 1000\n"}, {"type": "stdin_stdout", "input": "100000\n99000 100000 999 100010\n100000 100001 100000 100000\n100000 100000 100000 100000\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\nA + B is often used as an exampl...
[{"type": "stdin_stdout", "input": "1094 350\n", "output": "1444\n"}, {"type": "stdin_stdout", "input": "1132 485\n", "output": "1617\n"}, {"type": "stdin_stdout", "input": "1062 519\n", "output": "1581\n"}, {"type": "stdin_stdout", "input": "260 1041\n", "output": "1301\n"}, {"type": "stdin_stdout", "input": "1132 306...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Kitayuta has just bought an ...
[{"type": "stdin_stdout", "input": "5 7\n1 5 1\n2 5 1\n3 5 1\n4 5 1\n1 2 2\n2 3 2\n3 4 2\n5\n1 5\n5 1\n2 5\n1 5\n1 4\n", "output": "1\n1\n1\n1\n2\n"}, {"type": "stdin_stdout", "input": "5 7\n1 5 1\n3 5 1\n3 5 1\n4 5 1\n1 2 2\n2 3 2\n3 4 2\n5\n1 5\n5 1\n2 5\n1 5\n1 4\n", "output": "1\n1\n0\n1\n2\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\nThree companies decided to order...
[{"type": "stdin_stdout", "input": "17 100 100 22 61 100\n", "output": "100\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 works as a watchman in the...
[{"type": "stdin_stdout", "input": "100000 100000 100000 100000 100000\n", "output": "10000000000"}, {"type": "stdin_stdout", "input": "100000 83958 32567 91083 110780\n", "output": "1466200000\n"}, {"type": "stdin_stdout", "input": "100010 87223 66046 27153 40823\n", "output": "1471847170\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\nVasya has n days of vacations! S...
[{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n3 0 3 0 3 0 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\nThere is the following puzzle po...
[{"type": "stdin_stdout", "input": "17 17\nFm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm\nFm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm Fm\n", "output": "YES\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\nFm->Fm\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\nJust to remind, girls in Arpa's ...
[{"type": "stdin_stdout", "input": "10 5 100\n68 55 15 94 53 100 52 68 24 3\n286803 660813 226501 1031542 215418 290774 416040 961916 910482 50278\n1 5\n7 2\n2 8\n5 3\n10 3\n", "output": "1922676\n"}, {"type": "stdin_stdout", "input": "10 5 100\n68 55 15 94 53 100 52 68 24 3\n286803 660813 226501 624597 215418 290774 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\nThere are literally dozens of sn...
[{"type": "stdin_stdout", "input": "50\nPFH\nJFV->PFH\nBVP->PFH\nPFH->BVP\nPFH->JFV\nPFH->ETQ\nPFH->LQJ\nZTO->PFH\nPFH->BVP\nPFH->RXO\nPFH->ZTO\nHWL->PFH\nPFH->HIV\nPFH->AFP\nPFH->HWL\nOBB->PFH\nHIV->PFH\nPFH->LSR\nAFP->PFH\nLQJ->PFH\nHWL->PFH\nETQ->PFH\nPFH->HWL\nLSR->PFH\nWBR->PFH\nBNZ->PFH\nHQR->PFH\nZTO->PFH\nPFH->...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSasha and Kolya decided to get d...
[{"type": "stdin_stdout", "input": "971 108\n706 706 991 706 988 997 996 997 991 996 706 706 996 706 996 984 1000 991 996 1000 724 724 997 991 997 984 997 1000 984 996 996 997 724 997 997 1000 997 724 984 997 996 988 997 706 706 997 1000 991 706 988 997 724 988 706 996 706 724 997 988 996 991 1000 1000 724 988 996 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHarry Potter is on a mission to ...
[{"type": "stdin_stdout", "input": "9\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nhr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 time the Berland Team Olymp...
[{"type": "stdin_stdout", "input": "1 1000000000 1000000000\n100000\n", "output": " 0"}, {"type": "stdin_stdout", "input": "5 3 2\n1 1 2 1 1\n", "output": " 7"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan's classes at the university...
[{"type": "stdin_stdout", "input": "100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 department of some software ...
[{"type": "stdin_stdout", "input": "15 250 200\n71 2 77 69 100 53 54 40 73 32 82 58 24 82 41\n", "output": "Yes\n11 3\n13 10 8 15 6 7 12 4 1 9 3 \n11 14 5 "}, {"type": "stdin_stdout", "input": "15 250 200\n71 2 77 69 100 53 54 40 73 32 82 85 24 82 41\n", "output": "Yes\n11 3\n13 10 8 15 6 7 4 1 9 3 11\n14 12 5\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe city of Fishtopia can be ima...
[{"type": "stdin_stdout", "input": "100 80\n", "output": "YES\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\nAnd again a misfortune fell on P...
[{"type": "stdin_stdout", "input": "94 2 1\n0 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a string S consisting of...
[{"type": "stdin_stdout", "input": "40\nferelibenterhominesidquodvomuntcredunt", "output": "ferelibenterhominesidquodvomuntcredunt\n"}, {"type": "stdin_stdout", "input": "40\nferelibenterhominesidquodvonuntcredunt", "output": "ferelibenterhominesidquodvonuntcredunt\n"}, {"type": "stdin_stdout", "input": "40\nferelibent...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a finite set of integers X, ...
[{"type": "stdin_stdout", "input": "10 8\n1000000000 1100000000 1000001010 1000000000 1000000000 0 0 -2 0 0", "output": "600007816\n"}, {"type": "stdin_stdout", "input": "10 8\n1000000000 1100000000 1000001010 1100000000 1000000000 0 0 -2 0 0", "output": "400000739\n"}, {"type": "stdin_stdout", "input": "10 5\n10000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 2028 and after a continuous g...
[{"type": "stdin_stdout", "input": "10000000007\n2\n3\n1\n3\n11", "output": "10000000011\n"}, {"type": "stdin_stdout", "input": "10000000007\n2\n3\n1\n6\n11", "output": "10000000011\n"}, {"type": "stdin_stdout", "input": "10000000007\n2\n3\n1\n2\n11", "output": "10000000011\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\nThere is a train going from Stat...
[{"type": "stdin_stdout", "input": "-1 -17", "output": "-10\n"}, {"type": "stdin_stdout", "input": "-1 -31", "output": "-17\n"}, {"type": "stdin_stdout", "input": "-11 -1", "output": "-12\n"}, {"type": "stdin_stdout", "input": "0 1003", "output": "501\n"}, {"type": "stdin_stdout", "input": "-12 -8", "output": "-16\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\nJoisino wants to evaluate the fo...
[{"type": "stdin_stdout", "input": "-1 - 182", "output": "-183\n"}, {"type": "stdin_stdout", "input": "6 - 131", "output": "-125\n"}, {"type": "stdin_stdout", "input": "5 - 118", "output": "-113\n"}, {"type": "stdin_stdout", "input": "-1 + 112", "output": "111\n"}, {"type": "stdin_stdout", "input": "-1 - 15", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program that extracts n ...
[{"type": "stdin_stdout", "input": "4 133\n-1 0\n0 0", "output": "15011\n0\n"}, {"type": "stdin_stdout", "input": "4 102\n-1 0\n0 0", "output": "7153\n0\n"}, {"type": "stdin_stdout", "input": "8 80\n2 -2\n0 0", "output": "37638\n0\n"}, {"type": "stdin_stdout", "input": "3 133\n-1 0\n0 0", "output": "1202\n0\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\nAtaru Oafoot of Aizu Gakuen Univ...
[{"type": "stdin_stdout", "input": "3 2 30 3 41 226\n9 0 18 4 20 118\n5 5 12 0 15 203\n13 4 19 2 22 197\n7 4 24 4 17 209\n0 0 0 0 0 0", "output": "172\n795\n410\n1199\n617\n"}, {"type": "stdin_stdout", "input": "3 2 30 3 41 226\n9 0 36 4 20 118\n5 5 12 0 18 203\n13 4 19 2 22 197\n1 4 42 4 17 209\n0 0 0 0 0 0", "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\nMr. Kobou found a bundle of old ...
[{"type": "stdin_stdout", "input": "5 4\n3 3 4 0 0\n4 -1 0 -2 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "4 5\n3 2 5 0 0\n4 2 -1 -1 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "4 5\n1 2 5 0 0\n4 2 -1 -1 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "4 5\n1 2 5 0 0\n4 2 -2 -1 4", "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\nEmacs is a text editor which is ...
[{"type": "stdin_stdout", "input": "hyo\nnh\nEND_OF_TEXT\ne\nd\nf\nf\nk\np\np\ne\ny\na\nk\ny\ny\nn\ny\n-", "output": "hyonhhyonhhyonh\n"}, {"type": "stdin_stdout", "input": "hyn\nnh\nEND_OF_TEXT\ne\nd\nf\nf\nk\np\np\ne\nx\na\nk\ny\ny\nn\ny\n-", "output": "hynnhhynnhhynnh\n"}, {"type": "stdin_stdout", "input": "oyh\nni\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 many blue cards and re...
[{"type": "stdin_stdout", "input": "4 3\n2 6 6 15\n2 3 5\n2 3\n4 9\n8 16 32\n4 2\n4 9 11 13\n2 7\n5 5\n2 3 5 1001 1001\n7 11 13 17 34\n10 10\n2 3 5 7 12 11 13 15 17 29\n3 11 1 22 18 22 26 30 34 38\n20 20\n314 144 903 63 137 609 44 626 75 473\n876 421 909 519 755 840 374 368 570 872\n363 650 155 265 64 26 426 391 15 421...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 earth is under an attack of ...
[{"type": "stdin_stdout", "input": "3\n...\n.@.\n...\n3\n.#\"\n.#.\n@##\n3\n.##\n#..\n@..\n5\n....@\n##...\n#....\n...#.\n##.##\n5\n#...#\n...#.\n#....\n...##\n..@..\n1\n$....\n.....\n.....\n.....\n..@..\n5\n#..#.\n$.#.#\n.#.#.\n....#\n.#@##\n5\n..##.\n..#..\n#....\n#....\n.#@..\n0", "output": "0\n4\n6\n3\n2\n0\n0\n0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe understand that reading Engli...
[{"type": "stdin_stdout", "input": "2\n-35 -35 100 100\n-49 49 1588 -2000\n4\n0 0 0 3\n0 0 3 0\n0 3 3 3\n3 0 3 3\n4\n0 3 -4 6\n3 0 6 -4\n2 3 6 6\n-1 2 -4 6\n0", "output": "Many\n1.500000 1.500000\n1.000000 1.000000\n"}, {"type": "stdin_stdout", "input": "2\n-35 -35 100 100\n-49 49 1588 -2000\n4\n0 0 0 4\n0 0 3 0\n0 3 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\nProblem statement\n\nA programmi...
[{"type": "stdin_stdout", "input": "6\n1 2 0 15 0 2\n7\n2 5 4 2 6 1 0\n1 28 1 3 5 1 0", "output": "Yes\nNo\nYes\nYes\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "6\n1 1 0 15 0 3\n7\n2 5 4 2 10 1 0\n1 28 1 3 0 1 0", "output": "Yes\nNo\nYes\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "6\n1 2 0 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\nD: Sunburn-Suntan-\n\nstory\n\nA...
[{"type": "stdin_stdout", "input": "20\n1\n-1 12", "output": "13\n"}, {"type": "stdin_stdout", "input": "20\n1\n-1 19", "output": "20\n"}, {"type": "stdin_stdout", "input": "20\n1\n0 19", "output": "19\n"}, {"type": "stdin_stdout", "input": "20\n1\n0 12", "output": "12\n"}, {"type": "stdin_stdout", "input": "20\n1\n0 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\nproblem\n\nThere is a mysterious...
[{"type": "stdin_stdout", "input": "3\nF S T", "output": "T\n"}, {"type": "stdin_stdout", "input": "3\nF R T", "output": "T\n"}, {"type": "stdin_stdout", "input": "3\nG S T", "output": "T\n"}, {"type": "stdin_stdout", "input": "3\nG R T", "output": "T\n"}, {"type": "stdin_stdout", "input": "3\nH R T", "output": "T\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA: Find the difference\n\nproble...
[{"type": "stdin_stdout", "input": "4 3\n..\"\n##.\n.##\n..#", "output": "12\n"}, {"type": "stdin_stdout", "input": "4 3\n..#\n##.\n.##\n..$", "output": "12\n"}, {"type": "stdin_stdout", "input": "4 3\n..\"\n##.\n.##\n#..", "output": "12\n"}, {"type": "stdin_stdout", "input": "4 3\n..\"\n#.#\n.##\n#..", "output": "12\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a given weighted undirected ...
[{"type": "stdin_stdout", "input": "6 5\n0 1 0\n0 2 2\n1 3 3\n1 4 13\n1 0 6", "output": "42\n"}, {"type": "stdin_stdout", "input": "6 5\n0 1 0\n0 2 2\n1 3 3\n1 1 13\n1 0 6", "output": "29\n"}, {"type": "stdin_stdout", "input": "6 5\n0 0 1\n0 2 2\n1 3 3\n1 4 11\n2 0 6", "output": "37\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\nFind the least common multiple (...
[{"type": "stdin_stdout", "input": "3\n12 39 11", "output": "1716\n"}, {"type": "stdin_stdout", "input": "4\n1 2 5 24", "output": "120\n"}, {"type": "stdin_stdout", "input": "3\n3 37 10", "output": "1110\n"}, {"type": "stdin_stdout", "input": "4\n1 2 5 44", "output": "220\n"}, {"type": "stdin_stdout", "input": "3\n9 37...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a long day, Alice and Bob ...
[{"type": "stdin_stdout", "input": "40\n5 40 6 27 39 37 17 34 3 30 28 13 12 8 11 10 31 4 1 16 38 22 29 35 33 23 7 9 24 14 18 26 19 21 15 36 2 20 32 25\n", "output": "ABABBBABABAAAAAABAAABBBBBBAAAABABBABABBB"}, {"type": "stdin_stdout", "input": "16\n14 15 3 11 5 4 7 8 1 6 10 2 12 9 13 16\n", "output": "BBBBBAAAAAAAABAB"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 set of n weights. You...
[{"type": "stdin_stdout", "input": "100\n50 50 51 50 51 51 51 51 51 50 50 50 50 50 50 51 50 51 50 51 51 50 50 51 51 51 51 51 51 50 50 51 51 51 50 50 50 51 50 51 51 51 50 51 51 50 50 50 50 50 50 51 50 50 51 51 51 50 50 50 51 50 51 50 51 51 50 51 50 51 51 51 50 51 50 50 51 50 51 51 51 51 50 51 51 51 51 50 51 51 51 51 51 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Sofia is in fourth grade....
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "63246\n"}, {"type": "stdin_stdout", "input": "1010000000\n", "output": "63561\n"}, {"type": "stdin_stdout", "input": "1550090838\n", "output": "78743\n"}, {"type": "stdin_stdout", "input": "1237445143\n", "output": "70355\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\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": "3\n240881040 214365879 987654321\n", "output": "987794593\n"}, {"type": "stdin_stdout", "input": "3\n240881040 289153064 987654321\n", "output": "383487374\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\nVus the [Cossack](https://en.wik...
[{"type": "stdin_stdout", "input": "100 100 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "000 100 000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "000 100 100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "000 110 100\n", "output": "YES\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\nAlice and Bob play a game. Initi...
[{"type": "stdin_stdout", "input": "7\n240501 42869\nXX.X.X.X.X.X...\n251441 50561\nX\n247719 194141\nXX..X.XX..\n208260 86427\n....XXX.X..\n290966 269978\n.X.\n298577 171094\nX.X.XX.X..X.XXX..X\n157525 2199\n...XX.X..X...X.XXX.XX.X..XXXX..X\n", "output": "NO\nNO\nNO\nNO\nNO\nNO\nNO\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\nGardener Alexey teaches competit...
[{"type": "stdin_stdout", "input": "11\n9969 9945 12703 11114 8159 10000 9928 9985 6747 9181 9933\n", "output": "5991155360\n"}, {"type": "stdin_stdout", "input": "11\n9969 9945 12703 9914 8159 10000 9928 9985 6747 9939 9933\n", "output": "5907768442\n"}, {"type": "stdin_stdout", "input": "11\n9969 9945 12703 9914 8159...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAdilbek was assigned to a specia...
[{"type": "stdin_stdout", "input": "50\n1000000000 1000000000\n999999999 1000000000\n999999998 1000000000\n999999997 1000000000\n999999996 1000000000\n999999995 1000000000\n999999994 1000000000\n999999900 1000000000\n1 11\n2 11\n3 11\n4 11\n5 11\n6 11\n7 11\n8 11\n9 11\n10 11\n11 11\n4 18\n4 20\n3 19\n3 18\n3 167\n3 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\n\n\nInput\n\nThe only line of th...
[{"type": "stdin_stdout", "input": "A089956\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "A089957\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "A144045\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "A278832\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "A089946\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\nVasya claims that he had a paper...
[{"type": "stdin_stdout", "input": "3\n2 3\n3 1\n3 2\n1 3\n3 3\n1 3\n", "output": "Yes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "3\n2 3\n3 1\n3 2\n1 3\n3 6\n1 3\n", "output": "Yes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "3\n2 3\n3 1\n3 2\n1 3\n3 6\n1 0\n", "output": "Yes\nYes\nNo\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\nHave you ever used the chat appl...
[{"type": "stdin_stdout", "input": "100 61 71\n11 18 0 47 33 37 91 13 8 30 73 64 50 97 62 50 2 36 68 32 64 74 32 77 81 41 23 44 40 18 45 33 21 68 57 79 107 23 21 37 99 27 30 56 75 62 75 63 1 15 79 42 18 66 21 25 2 12 89 48 75 7 57 85 80 14 82 29 66 47 29 10 1 84 79 39 33 81 135 26 80 67 52 25 38 68 57 53 38 83 83 3 86 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem MEX of a certain...
[{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRon is a happy owner of a permut...
[{"type": "stdin_stdout", "input": "2\n5 12\n3 2 1 4 5\n4 0.024816\n5 0.054959\n2 0.063211\n4 0.057224\n3 0.033510\n5 0.064656\n4 0.080912\n5 0.094426\n2 0.065718\n1 0.002728\n2 0.047829\n4 0.22982062043492948\n15 15\n3 8 5 7 9 2 4 6 1 10 11 12 13 14 15\n7 0.035821\n11 0.044624\n4 0.014940\n12 0.000655\n12 0.002577\n15...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a given an array a of le...
[{"type": "stdin_stdout", "input": "100 16\n14 94 97 89 73 165 11 78 10 30 54 57 88 57 44 6 33 40 17 26 69 100 92 67 22 59 80 67 17 29 76 69 133 7 86 45 1 98 99 25 65 102 94 91 7 24 53 40 53 91 59 32 67 24 25 157 55 46 68 53 2 15 92 5 53 37 76 40 49 94 4 8 76 12 50 2 54 86 49 95 81 5 34 28 21 47 97 73 96 56 32 78 71 38...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDiana loves playing with numbers...
[{"type": "stdin_stdout", "input": "10 0\n4 1 6 4 4 7 10 3 10 3\n", "output": "10\n1 3 3 4 4 4 6 7 10 10 \n"}, {"type": "stdin_stdout", "input": "8 0\n65 131 69 91 4 5 79 52\n", "output": "8\n52 79 5 4 91 69 131 65\n"}, {"type": "stdin_stdout", "input": "8 0\n65 131 26 91 4 5 79 52\n", "output": "8\n52 79 5 4 91 26 131...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya the Great Magician and Con...
[{"type": "stdin_stdout", "input": "100 -4900 100\n", "output": "1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 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\nVasya has got many devices that ...
[{"type": "stdin_stdout", "input": "50 50 2\n2 2 4 5 2 1 5 4 5 4 5 2 1 2 3 3 5 1 2 2 1 3 4 5 5 4 3 2 2 1 3 2 3 2 4 4 1 3 5 4 3 2 4 3 4 4 4 4 3 4\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "50 23 2\n2 1 2 2 3 2 1 2 3 3 3 1 3 1 3 2 1 3 2 2 1 1 3 2 2 1 1 3 2 1 2 3 2 2 2 2 1 3 1 2 2 3 3 1 3 3 3 1 2 3\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\nYou are given two rectangles on ...
[{"type": "stdin_stdout", "input": "988480 1151420 106\n", "output": "981327901099.81217265129089355"}, {"type": "stdin_stdout", "input": "1503946 527535 69\n", "output": "298092342476.75622430443763733"}, {"type": "stdin_stdout", "input": "988480 819219 106\n", "output": "684860009476.82913672924041748"}, {"type": "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\nYaroslav likes algorithms. We'll...
[{"type": "stdin_stdout", "input": "10\n630\n624\n110\n955\n551\n841\n1668\n377\n664\n309\n", "output": "0??<>1\n1??<>2\n2??<>3\n3??<>4\n4??<>5\n5??<>6\n6??<>7\n7??<>8\n8??<>9\n9??>>??0\n??<>1\n?0>>0?\n?1>>1?\n?2>>2?\n?3>>3?\n?4>>4?\n?5>>5?\n?6>>6?\n?7>>7?\n?8>>8?\n?9>>9?\n?>>??\n>>?\n"}, {"type": "stdin_stdout", "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\nAccording to the regulations of ...
[{"type": "stdin_stdout", "input": "100 100\n51 93 101 960 2 477 213 129 663 925 254 78 1486 274 160 481 132 156 589 372 3 57 210 298 1771 7 359 468 254 406 202 929 221 366 552 97 555 29 634 118 539 140 992 854 7 163 134 103 940 30 409 1003 564 43 555 79 107 40 23 103 643 171 310 382 770 288 18 189 570 177 29 54 855 17...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlexey, a merry Berland entrant,...
[{"type": "stdin_stdout", "input": "50\n69 6 6\n22 1 1\n23 3 3\n60 13 13\n13 3 3\n7 4 7\n6 1 1\n49 7 9\n68 8 8\n20 2 2\n34 1 1\n143 5 5\n22 1 1\n77 58 65\n10 3 3\n72 5 5\n47 1 1\n82 3 3\n92 8 8\n34 1 1\n42 9 10\n63 14 14\n10 3 3\n38 2 2\n80 6 6\n79 5 5\n53 5 5\n44 7 7\n85 2 2\n24 2 2\n57 3 3\n95 29 145\n77 6 6\n24 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\nLittle X has n distinct integers...
[{"type": "stdin_stdout", "input": "70 416035 416023\n70034 70322 345689 345965 345701 70046 345737 345713 70166 345821 70010 345749 345677 345725 69962 345869 70178 70310 345785 69998 70070 69974 70058 346001 70106 345953 70226 70154 345929 69950 70298 346049 70346 345989 70286 69986 345893 70082 70238 345797 70250 34...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDuring the lunch break all n Ber...
[{"type": "stdin_stdout", "input": "10\n419946 201769\n245945 0\n842799 113073\n836998 245945\n0 794376\n692107 836998\n113073 904403\n904403 987165\n201769 692107\n794376 842799\n", "output": "419946 794376 201769 842799 692107 113073 836998 904403 245945 987165\n"}, {"type": "stdin_stdout", "input": "10\n189071 85225...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Imperial stormtroope...
[{"type": "stdin_stdout", "input": "10 -4 -4\n2 -4\n2 0\n-4 2\n5 -4\n-3 -5\n1 4\n-4 2\n-3 5\n0 -3\n2 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 -4 -4\n1 -4\n2 0\n-4 2\n5 -4\n-3 -5\n1 4\n-4 2\n-3 5\n0 -3\n2 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 -4 -4\n1 -4\n2 0\n-4 2\n5 -4\n-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\nYou play a computer game. Your c...
[{"type": "stdin_stdout", "input": "21 21\n.....X...X.........X.\n...X...XX......X.....\n..X........X.X...XX..\n.........X....X...X..\nX...X...........XX...\n...X...X....XX...XXX.\n.X............X......\n......X.X............\n.X...X.........X.X...\n......XX......X.X....\n....X.......X.XXX....\n.X.......X..XXX.X..X.\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\nLimak is a little polar bear. In...
[{"type": "stdin_stdout", "input": "100\n9898888999899988989898898898898888889889888988989988999888989899888888889899889989898989898988989999\n", "output": "1225541\n"}, {"type": "stdin_stdout", "input": "65\n25852165999999999999942386995999999999999999999999999999999999999\n", "output": "90036\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\nBlake is a CEO of a large compan...
[{"type": "stdin_stdout", "input": "25\n12 30 47 109 81 124 80 33 38 48 29 78 96 48 96 27 80 77 102 65 80 113 31 194 35\n25 64 177 13 12 6 111 80 85 16 61 119 23 65 73 65 20 95 124 18 28 79 125 106 116\n", "output": "510\n"}, {"type": "stdin_stdout", "input": "25\n12 30 47 109 81 124 80 33 38 48 29 78 96 48 96 27 80 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\nVasiliy likes to rest after a ha...
[{"type": "stdin_stdout", "input": "12\n35345 58181 32223 84621 35905 73863 99537 30666 67771 39229 36847 29038\n23\n55052824\n82504840\n35160556\n78141700\n73401989\n86305919\n39430705\n31939373\n23501765\n4406029\n61436920\n14295390\n34275309\n28028753\n91433780\n70158847\n2396455\n66994588\n84024224\n30175981\n34941...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a permutation of i...
[{"type": "stdin_stdout", "input": "100\n39 8 87 59 49 19 6 64 81 26 90 58 30 93 51 94 91 10 37 68 14 86 75 41 15 73 76 85 13 84 34 25 54 92 23 11 99 53 80 74 22 29 20 79 7 66 62 72 28 71 12 48 18 9 78 38 43 47 5 50 77 82 52 96 97 65 55 88 16 45 69 4 61 42 60 100 24 32 57 21 89 70 27 35 98 83 56 40 46 44 1 2 3 17 31 95...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 T be arbitrary binary tree —...
[{"type": "stdin_stdout", "input": "10\n911605217 -1 -1\n801852416 -1 -1\n140035920 -1 9\n981454947 10 2\n404988051 6 3\n307545107 8 7\n278188888 4 1\n523010786 -1 -1\n441817740 -1 -1\n789680429 -1 -1\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "10\n911605217 -1 -1\n801852416 -1 -1\n260560214 -1 9\n98145494...
code_stdio