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\nSmall, but very brave, mouse Bra...
[{"type": "stdin_stdout", "input": "5 5\nW G B W G\nG B W G B\nB W G B W\nW G B W G\nG B W G B\n", "output": "#Black&White"}, {"type": "stdin_stdout", "input": "5 5\nW G B Y M\nG B Y M C\nB Y M C W\nY M C W G\nM C W G B\n", "output": "#Color"}, {"type": "stdin_stdout", "input": "3 2\nW W\nW W\nB B\n", "output": "#Black...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSonya decided that having her ow...
[{"type": "stdin_stdout", "input": "100 10\n-489 -476 -445 -432 -430 -421 -420 -418 -412 -411 -404 -383 -356 -300 -295 -293 -287 -276 -265 -263 -258 -251 -249 -246 -220 -219 -205 -186 -166 -157 -143 -137 -136 -130 -103 -86 -80 -69 -67 -55 -43 -41 -40 -26 -19 -9 16 29 41 42 54 76 84 97 98 99 101 115 134 151 157 167 169 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an array of integers o...
[{"type": "stdin_stdout", "input": "100\n45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 grizzly bear who desi...
[{"type": "stdin_stdout", "input": "100\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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$, cons...
[{"type": "stdin_stdout", "input": "25\nbbaaaaabaaaabbabaaaababaa\n", "output": "YES\nba\n"}, {"type": "stdin_stdout", "input": "10\ncodeforces\n", "output": "YES\nco\n"}, {"type": "stdin_stdout", "input": "9\naabbccaab\n", "output": "YES\nab\n"}, {"type": "stdin_stdout", "input": "9\naaaabbbbb\n", "output": "YES\nab\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus loves lucky numbers. ...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "40744\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "40743\n"}, {"type": "stdin_stdout", "input": "999999998\n", "output": "40742\n"}, {"type": "stdin_stdout", "input": "999999997\n", "output": "40741\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\nIahub and his friend Floyd have ...
[{"type": "stdin_stdout", "input": "1 1 1000000000 2000000000\n", "output": "1000000001"}, {"type": "stdin_stdout", "input": "555 777 666013 1000000000\n", "output": "257229"}, {"type": "stdin_stdout", "input": "165 255 69696 1000000000\n", "output": "356482"}, {"type": "stdin_stdout", "input": "23 46 123321 900000000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 came to the exhibition and o...
[{"type": "stdin_stdout", "input": "50 1000000000\n824428839 821375880 831521735 868908015 86990853 248293447 886713846 425716910 443947914 504402098 40124673 774093026 271211165 873482658 592754073 490097471 947930201 69692739 145291746 418475785 80274059 696889747 854947829 231642778 141525047 57563878 92067934 38750...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 security guard friend recen...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "4000\n"}, {"type": "stdin_stdout", "input": "999000\n", "output": "3998\n"}, {"type": "stdin_stdout", "input": "999001\n", "output": "4000\n"}, {"type": "stdin_stdout", "input": "999999\n", "output": "4000\n"}, {"type": "stdin_stdout", "input": "933206\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\nLike any unknown mathematician, ...
[{"type": "stdin_stdout", "input": "86565 229134 356183 486713\n", "output": "1559833368660730\n"}, {"type": "stdin_stdout", "input": "90528 225462 336895 417903\n", "output": "1043176084391535\n"}, {"type": "stdin_stdout", "input": "178561 294901 405737 476436\n", "output": "911664147520700\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\n You are given <var>Q</var> tupl...
[{"type": "stdin_stdout", "input": "31940 139378099479290043 26943708742238 1000000000\n", "output": "997629525\n"}, {"type": "stdin_stdout", "input": "1 999999999999999999 999999999999999999 998244353\n", "output": "716070897\n"}, {"type": "stdin_stdout", "input": "345 493299812499659259 1418510335032035 998244353\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\nRecently, you bought a brand new...
[{"type": "stdin_stdout", "input": "7 1000000000\n1 10001 10011 20011 20021 40021 40031\n", "output": "999999969\n"}, {"type": "stdin_stdout", "input": "7 1000000000\n3 10001 10011 20011 20021 40021 40031\n", "output": "999999969\n"}, {"type": "stdin_stdout", "input": "6 981231233\n1 6 15 30 130 1875\n", "output": "981...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence $b_1, b...
[{"type": "stdin_stdout", "input": "50\n2\n2 1\n2\n1 2\n2\n1 2\n2\n2 1\n2\n1 3\n2\n2 1\n2\n1 2\n2\n2 1\n2\n3 1\n2\n1 2\n2\n1 2\n2\n2 1\n2\n1 3\n2\n1 2\n2\n3 1\n2\n1 2\n2\n1 3\n2\n1 3\n2\n2 1\n2\n1 3\n2\n1 2\n2\n1 3\n2\n1 3\n2\n3 1\n2\n2 1\n2\n1 2\n2\n1 2\n2\n1 3\n2\n2 1\n2\n2 1\n2\n3 1\n2\n1 2\n2\n3 1\n2\n3 1\n2\n1 3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you may know, MemSQL has Amer...
[{"type": "stdin_stdout", "input": "100\nSFFSSFFFFFFSSFFFSSFSFFFFFSSFFFSFFFFFFSFSSSFSFSFFFFSFSSFFFFFFFFSFFFFFSFFFFFSSFFFSFFSFSFFFFSFFSFFFFFFF\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100\nSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\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\nCalculate the number of ways to ...
[{"type": "stdin_stdout", "input": "200000 100000\n", "output": "668585001\n"}, {"type": "stdin_stdout", "input": "200000 199998\n", "output": "508670650\n"}, {"type": "stdin_stdout", "input": "200000 3393\n", "output": "259194802\n"}, {"type": "stdin_stdout", "input": "200000 100\n", "output": "431967939\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\nVasiliy lives at point (a, b) of...
[{"type": "stdin_stdout", "input": "66 -82\n43\n27 -21 70\n-64 46 58\n-7 -20 41\n-42 60 57\n-93 -7 95\n26 -61 26\n-10 -72 25\n-78 -18 55\n-62 -64 69\n-33 95 50\n24 59 45\n4 72 37\n66 57 61\n16 -60 5\n17 -78 36\n-75 56 59\n-60 98 77\n-94 37 28\n76 6 63\n99 -35 75\n69 -40 1\n9 -48 56\n-94 -11 19\n69 1 63\n43 42 80\n-28 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nXenia the mathematician has a se...
[{"type": "stdin_stdout", "input": "15\n2 1 2 1 3 6 1 2 1 6 1 3 4 6 4\n", "output": "1 2 4\n1 2 4\n1 3 6\n1 3 6\n1 2 6\n"}, {"type": "stdin_stdout", "input": "24\n1 1 1 1 1 1 1 1 1 2 2 2 3 3 3 3 3 3 4 4 4 6 6 6\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12\n3 6 1 1 3 6 1 1 2 6 2 6\n", "output": "1 3 6\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 a string s consist...
[{"type": "stdin_stdout", "input": "gfliflgfhhdkceacdljgkegmdlhcgkcmlelmbbbmdddgdeeljjhgbbffmemmmkhebgkhadkdajabcjkcgbkgbaeacdedlkklfech\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "bcaccacaaabaacaabaaabcbbcbcaacacbcbaaaacccacbbcbaabcbacaacbabacacacaccbbccbcbacbbbbccccabcabaaab\n", "output": "8\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\nCodehorses has just hosted the s...
[{"type": "stdin_stdout", "input": "43\nL\nXXXL\nM\nXS\nL\nXXL\nS\nL\nM\nXXXL\nXXS\nS\nXS\nS\nXS\nXL\nXXL\nXXL\nXS\nXXS\nXXL\nL\nXXXL\nL\nL\nXXL\nXXL\nM\nXXXS\nM\nXXL\nXXXS\nXXXL\nXXS\nL\nL\nXS\nL\nXS\nXS\nL\nXXL\nM\nXXXL\nXXL\nXXL\nXL\nL\nXS\nM\nXL\nXXXS\nXXXS\nS\nXXL\nXXXL\nXXL\nXS\nXXS\nL\nS\nXXXS\nXL\nL\nXL\nXXXS\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 stones on the table ...
[{"type": "stdin_stdout", "input": "50\nGRBGGRBRGRBGGBBBBBGGGBBBBRBRGBRRBRGBBBRBBRRGBGGGRB\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "50\nRBGGBGGRBGRBBBGBBGRBBBGGGRBBBGBBBGRGGBGGBRBGBGRRGG\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "50\nGGGBBRGGGGGRRGGRBGGRGBBRBRRBGRGBBBGBRBGRGBBGRGGBRB\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\nBear Limak likes watching sports...
[{"type": "stdin_stdout", "input": "90\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\n", "output": "90\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\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 30 1\n2 1 2 1 2 3 3 1 2 2 3 2 1 3 1 3 1 2 2 3 2 1 3 1 1 2 3 2 2 1 1 3 3 2 2 2 3 2 3 3 3 3 1 1 3 1 1 3 1 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\nUser ainta has a stack of n red ...
[{"type": "stdin_stdout", "input": "50\nBRRRBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n", "output": "1125899906842609\n"}, {"type": "stdin_stdout", "input": "50\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n", "output": "1125899906842623\n"}, {"type": "stdin_stdout", "input": "50\nRRBBBBBBBBBBBBBBBBRBRRBBBR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 waking up at hh:mm, Andrew...
[{"type": "stdin_stdout", "input": "00 00\n100000 100 100 100\n", "output": "100000.0000\n"}, {"type": "stdin_stdout", "input": "20 55\n100000 100 100 100\n", "output": "80000.0000\n"}, {"type": "stdin_stdout", "input": "23 59\n100000 100 100 100\n", "output": "80000.0000\n"}, {"type": "stdin_stdout", "input": "14 33\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\nKolya got string s for his birth...
[{"type": "stdin_stdout", "input": "jhfwjyyzwrjiyrrgveiqkoltivghgkontrqragikttxxuwszjwqhwxindyrdqhucnbwgwrppgqmsasrzohezjlfmkzsqptwpratprcrxyxecnlsaiqrvimihmhjfgzwdtvmfhgbuonpsblphyoxzclkrwbwrkasahiirzqlfjdoomlosltldbpomyyhmdwfchzxnmwlh\n200\n", "output": "400\n"}, {"type": "stdin_stdout", "input": "nemtbujbscvkgxnbqbo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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$ slimes in a row. E...
[{"type": "stdin_stdout", "input": "10\n-20 0 3 -5 -18 15 -3 -9 -7 9\n", "output": "89"}, {"type": "stdin_stdout", "input": "9\n2 4 -4 15 1 11 15 -7 -20\n", "output": "79"}, {"type": "stdin_stdout", "input": "8\n-1 5 -19 4 -12 20 1 -12\n", "output": "74"}, {"type": "stdin_stdout", "input": "1\n-1000000000\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 Fair Nut lives in $n$ story ...
[{"type": "stdin_stdout", "input": "100\n47 79 39 24 51 37 29 54 96 100 48 80 32 98 27 88 73 36 79 11 33 78 87 94 27 55 21 1 24 6 83 27 7 66 27 91 12 35 43 17 57 46 78 19 20 61 29 89 6 73 51 82 48 14 33 81 37 51 34 64 57 19 1 96 49 81 34 27 84 49 72 56 47 37 50 23 58 53 78 82 25 66 13 10 61 3 73 96 64 59 38 48 12 61 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\nAfter learning about polynomial ...
[{"type": "stdin_stdout", "input": "111\n001101111000100111111000010101011110011000010101010001001011000111100111111101000110000011110110100111000100101\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n1010100001\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "4\n1010\n", "output": "3\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 Lesha loves listening to ...
[{"type": "stdin_stdout", "input": "100000 99999 4\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000 1 10000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10028 13 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000 99999 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call a string adorable if ...
[{"type": "stdin_stdout", "input": "aaaaaaabbbbbbcder\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaa\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "bcbccccccca\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "abacabadde\n", "output": "No\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a set of points $x...
[{"type": "stdin_stdout", "input": "100 13\n11 28 21 7 6 23 26 31 26 32 34 17 19 1 13 1 28 30 28 8 23 36 17 20 5 37 32 23 14 1 20 23 3 39 20 14 2 12 15 3 1 27 7 25 15 39 10 6 8 37 6 22 7 29 6 17 17 9 16 3 39 23 2 34 20 12 28 29 32 2 38 27 36 27 29 18 7 14 27 25 33 18 29 40 22 9 9 6 21 7 23 35 33 26 31 31 39 36 27 27\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a fraction $\\frac{a}{b...
[{"type": "stdin_stdout", "input": "99999 100000 8\n", "output": "-1"}, {"type": "stdin_stdout", "input": "44102 73848 2\n", "output": "132"}, {"type": "stdin_stdout", "input": "69168 84860 4\n", "output": "107"}, {"type": "stdin_stdout", "input": "13805 15538 3\n", "output": "164"}, {"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\nRecently Ivan noticed an array a...
[{"type": "stdin_stdout", "input": "50 20\n1 44 48 43\n1 15 24 9\n2 39 44 25\n1 36 48 35\n1 4 30 27\n1 31 44 15\n2 19 38 22\n2 18 43 24\n1 25 35 10\n2 38 43 5\n2 10 22 21\n2 5 19 30\n1 17 35 26\n1 17 31 10\n2 9 21 1\n2 29 34 10\n2 25 44 21\n2 13 33 13\n2 34 38 9\n2 23 43 4\n", "output": "-1\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZane the wizard is going to perf...
[{"type": "stdin_stdout", "input": "203948 2 14\n203948 203946\n39 38\n4959 3030\n1 203947\n2929 9292\n203944 203948\n203947 203944\n203944 203922\n203922 203948\n2495 20495\n29419 5959\n12949 12\n49 29292\n1 94\n1 203\n", "output": "203948"}, {"type": "stdin_stdout", "input": "203948 2 14\n203948 203947\n39 38\n4959 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\nDue to the increase in the numbe...
[{"type": "stdin_stdout", "input": "37 80 100\n31\n901706521 USB\n555265160 PS/2\n547038505 PS/2\n644436873 PS/2\n105558073 USB\n915082057 PS/2\n913113815 USB\n953413471 PS/2\n252912707 PS/2\n830344497 USB\n781593007 USB\n610659875 PS/2\n177755858 PS/2\n496444729 PS/2\n617569418 USB\n304908147 PS/2\n188649950 PS/2\n705...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKyoya Ootori is selling photoboo...
[{"type": "stdin_stdout", "input": "xulsyfkuizjauadjjopu\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "cskgsxywlvfeicoueglr\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "gggggggggggggggggggg\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "qdqdddqddqqddqddqdqd\n", "output": "526\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\nKing of Berland Berl IV has rece...
[{"type": "stdin_stdout", "input": "30 50\n56 <= 26\n47 >= 42\n18 > 7\n51 < 28\n36 >= 5\n58 = 58\n49 > 24\n2 <= 31\n24 < 37\n7 >= 2\n7 <= 33\n14 < 16\n11 <= 35\n33 > 7\n55 < 31\n46 >= 41\n55 > 5\n18 >= 60\n12 > 59\n10 <= 30\n25 >= 23\n40 > 3\n49 >= 45\n20 > 6\n60 < 53\n21 >= 5\n11 <= 50\n12 < 33\n1 <= 10\n44 > 29\n48 >...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFafa owns a company that works o...
[{"type": "stdin_stdout", "input": "100000\n", "output": "35\n"}, {"type": "stdin_stdout", "input": "83160\n", "output": "127\n"}, {"type": "stdin_stdout", "input": "99999\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "65536\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "40320\n", "output": "95\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\nSuppose you have a special $x$-$...
[{"type": "stdin_stdout", "input": "01985222473\n", "output": "-1 35 -1 33 -1 -1 -1 31 -1 29 \n35 53 24 17 20 17 18 15 13 13 \n-1 24 -1 18 -1 18 -1 19 -1 14 \n33 17 18 51 14 19 23 13 21 15 \n-1 20 -1 14 -1 21 -1 22 -1 22 \n-1 17 18 19 21 -1 17 17 20 19 \n-1 18 -1 23 -1 17 -1 12 -1 17 \n31 15 19 13 22 17 12 49 16 15 \n-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Little Elephant loves chess ...
[{"type": "stdin_stdout", "input": "WBWBWBWB\nBWBWBWBW\nBWBWBWBW\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nBWBWBWBW\nWBWBWBWB\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "BWBWBWBW\nWBWBWBWB\nBWBWBWBW\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "BWBWBWBW...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a dream Marco met an elderly ...
[{"type": "stdin_stdout", "input": "36\n1007 27189 42294 81567 108756 133931 149036 161120 200393 231610 234631 270883 302100 307135 343387 344394 362520 383667 421933 463220 486381 526661 546801 571976 595137 615277 616284 629375 661599 674690 680732 714970 744173 785460 787474 823726\n", "output": "71\n1007 1007 2718...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe capital of Berland has n mul...
[{"type": "stdin_stdout", "input": "100\n9 9 72 55 14 8 55 58 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 34 48 96 79 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 98 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has a number a, which he ...
[{"type": "stdin_stdout", "input": "1 536870912\n", "output": "YES\n30\n1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 \n"}, {"type": "stdin_stdout", "input": "5440 27853056\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\nThe start of the new academic ye...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "1 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "1 1000000000 1000000000\n", "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\nEvery Codeforces user has rating...
[{"type": "stdin_stdout", "input": "50\n67 1\n89 2\n83 1\n-26 1\n88 2\n-22 2\n-98 2\n-83 1\n58 2\n26 2\n-37 1\n-43 2\n29 1\n65 2\n-70 1\n81 2\n36 1\n52 2\n93 2\n-12 2\n-12 1\n5 2\n91 1\n3 1\n-27 1\n18 1\n-60 1\n-15 1\n17 1\n-33 1\n-74 2\n5 2\n-62 2\n72 1\n-22 1\n-58 1\n-9 1\n57 1\n-18 2\n-11 2\n-68 2\n74 2\n-20 2\n21 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n-----Input-----\n\nThe only line...
[{"type": "stdin_stdout", "input": "A221033\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "A223635\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "A232726\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "A102210\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "A231010\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\nOnce again Tavas started eating ...
[{"type": "stdin_stdout", "input": "777777777\n", "output": "1022\n"}, {"type": "stdin_stdout", "input": "444444444\n", "output": "511\n"}, {"type": "stdin_stdout", "input": "477477447\n", "output": "728\n"}, {"type": "stdin_stdout", "input": "777744747\n", "output": "996\n"}, {"type": "stdin_stdout", "input": "4447747...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. Chanek is currently particip...
[{"type": "stdin_stdout", "input": "6 1\n1 10 10 5 20 100\n1000000 1 10 10 100 1000000\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "6 1\n1 10 10 20 5 100\n1000000 1 10 100 10 1000000\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "5 1\n2 5 11 12 13\n1 2 100 100 100\n", "output": "40\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\nSergey is testing a next-generat...
[{"type": "stdin_stdout", "input": "100\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\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\nRecenlty Luba got a credit card ...
[{"type": "stdin_stdout", "input": "20 23036\n-1 1 -1 -1 -1 -1 1 -1 -1 0 0 1 1 0 0 1 0 0 -1 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "16 76798\n-1 11 -7 -4 0 -11 -12 3 0 -7 6 -4 8 6 5 -10\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "20 23079\n0 1 1 -1 1 0 -1 -1 0 0 1 -1 1 1 1 0 0 1 0 1\n",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integer sequen...
[{"type": "stdin_stdout", "input": "1989 1986\n84234 80908 59749 63761 63761 49034 63761 64697 84234 84234 64697 64697 49034 80908 80908 63761 66200 59749 59749 80908 84234 63761 80908 80908 66200 92283 84234 63761 80908 63761 92283 59749 49034 78052 53613 49034 92283 80908 53613 59749 49034 49034 59749 80908 66200 809...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 len...
[{"type": "stdin_stdout", "input": "97\n7 8 5 4 7 4 10 3 8 10 2 10 9 9 8 1 9 1 8 8 5 6 4 8 7 1 9 10 6 3 9 5 8 3 3 8 9 8 4 2 10 8 5 4 1 10 8 4 2 3 2 10 6 1 4 5 1 2 9 5 4 9 1 5 5 8 10 1 10 6 5 8 8 8 5 4 5 7 8 8 6 2 7 10 4 2 1 6 5 9 1 8 6 7 5 2 3 4 1 10 4 5 4 3 10 8 9 9 9 8 6 5 8 7 8 10 4 4 7 5 8 8 1 10 6 9 5 9 8 4 9 1 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn mathematics, the Pythagorean ...
[{"type": "stdin_stdout", "input": "10000\n", "output": "12471\n"}, {"type": "stdin_stdout", "input": "9999\n", "output": "12467\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "881\n"}, {"type": "stdin_stdout", "input": "586\n", "output": "472\n"}, {"type": "stdin_stdout", "input": "362\n", "output": "258\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have $n \\times n$ square gr...
[{"type": "stdin_stdout", "input": "250 1000000000\n", "output": "770503193\n"}, {"type": "stdin_stdout", "input": "244 315404017\n", "output": "868949606\n"}, {"type": "stdin_stdout", "input": "218 325181815\n", "output": "230476135\n"}, {"type": "stdin_stdout", "input": "246 629926913\n", "output": "283598434\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\nSeryozha conducts a course dedic...
[{"type": "stdin_stdout", "input": "3000 3000 4 10\n623629309 917769297 890844966 987654319\n", "output": "215591588260257\n"}, {"type": "stdin_stdout", "input": "3000 3000 10 4\n122375063 551934841 132649021 999999937\n", "output": "218197599525055\n"}, {"type": "stdin_stdout", "input": "3000 3000 1000 1000\n794639486...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMad scientist Mike is busy carry...
[{"type": "stdin_stdout", "input": "1000000 1000000 1000000\n", "output": "500000 500000 500000\n"}, {"type": "stdin_stdout", "input": "688348 726472 442198\n", "output": "486311 240161 202037\n"}, {"type": "stdin_stdout", "input": "602752 645534 784262\n", "output": "232012 413522 370740\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\nIn Berland it is the holiday of ...
[{"type": "stdin_stdout", "input": "70\n644488 5444 150441 714420 602059 335330 510670 196555 546346 740011 509449 850947 692874 524857 750434 952985 223744 374727 896124 753037 367352 679050 560202 172728 569291 778616 332116 286927 843598 372698 244906 498046 900681 709791 420904 724593 864493 813094 791377 39998 296...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFlatland has recently introduced...
[{"type": "stdin_stdout", "input": "38\n96 416\n24 104\n6 26\n12 52\n210 910\n150 650\n54 234\n174 754\n114 494\n18 78\n90 390\n36 156\n222 962\n186 806\n126 546\n78 338\n108 468\n180 780\n120 520\n84 364\n66 286\n138 598\n30 130\n228 988\n72 312\n144 624\n198 858\n60 260\n48 208\n102 442\n42 182\n162 702\n132 572\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\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\nSergei B., the young coach of Po...
[{"type": "stdin_stdout", "input": "100\nfAfhfNNNhfffAfNffNANhffNffffffNfffffhNfffNfffNfffNfNNNffNfffNfhNNNffffNfNfffAffNffNffNNfhfffNhNffNNN\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "95\nEmuBuEBmmEBBElBlElmmBEmmmEmmEuBEEmummmEmBBBBEWBBBmEEBmmummBBmmlluBBmElmEBEmBmBBmBmuLmEBBmlEBmBu\n", "output": "39\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\nPasha has many hamsters and he m...
[{"type": "stdin_stdout", "input": "200\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "100\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCalculate the minimum number of ...
[{"type": "stdin_stdout", "input": "smaxpqplaqqbxuqxalqmbmmgubbpspxhawbxsuqhhegpmmpebqmqpbbeplwaepxmsahuepuhuhwxeqmmlgqubuaxehwuwasgxpqmugbmuawuhwqlswllssueglbxepbmwgs\n1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "fcfccfcfccfcfcffcffffffcfccfccfcffccccfcffffccfccfcffcfcccccffcfffcccffcfccfffffcccfccffffff...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOur old friend Alexey has finall...
[{"type": "stdin_stdout", "input": "71\n1 99\n11 69\n86 92\n7 49\n31 70\n42 53\n48 81\n86 96\n36 91\n19 38\n39 91\n41 64\n87 93\n83 97\n40 41\n3 32\n15 18\n58 65\n22 32\n1 71\n58 86\n64 77\n15 69\n4 34\n42 89\n9 66\n15 18\n58 65\n59 96\n39 89\n19 38\n6 63\n26 73\n29 47\n55 88\n5 78\n41 74\n48 81\n20 71\n59 96\n42 49\n4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAyoub had an array $a$ of intege...
[{"type": "stdin_stdout", "input": "120881 536336525 585696606\n", "output": "915864703\n"}, {"type": "stdin_stdout", "input": "121382 445163929 988375913\n", "output": "594431176\n"}, {"type": "stdin_stdout", "input": "126028 622192701 881885560\n", "output": "842053672\n"}, {"type": "stdin_stdout", "input": "142972 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\nThe bear decided to store some r...
[{"type": "stdin_stdout", "input": "100 9\n66 71 37 41 23 38 77 11 74 13 51 26 93 56 81 17 12 70 85 37 54 100 14 99 12 83 44 16 99 65 13 48 92 32 69 33 100 57 58 88 25 45 44 85 5 41 82 15 37 18 21 45 3 68 33 9 52 64 8 73 32 41 87 99 26 26 47 24 79 93 9 44 11 34 85 26 14 61 49 38 25 65 49 81 29 82 28 23 2 64 38 13 77 68...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInnokentiy likes tea very much a...
[{"type": "stdin_stdout", "input": "11 2 3 8\n", "output": "BBGBBGBBGBB\n"}, {"type": "stdin_stdout", "input": "11 2 4 7\n", "output": "BBGBBGBBGBG\n"}, {"type": "stdin_stdout", "input": "11 2 5 6\n", "output": "BBGBGBGBGBG\n"}, {"type": "stdin_stdout", "input": "11 2 6 5\n", "output": "GGBGBGBGBGB\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\nVitaly is a very weird man. He's...
[{"type": "stdin_stdout", "input": "3 6 1000000\n", "output": "786609214\n"}, {"type": "stdin_stdout", "input": "8 9 1000000\n", "output": "573697309\n"}, {"type": "stdin_stdout", "input": "1 2 1000000\n", "output": "786609214\n"}, {"type": "stdin_stdout", "input": "4 9 104671\n", "output": "329390901\n"}, {"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\nVasily the Programmer loves roma...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "1001\n"}, {"type": "stdin_stdout", "input": "1000 2\n", "output": "1999\n"}, {"type": "stdin_stdout", "input": "1000 3\n", "output": "1499\n"}, {"type": "stdin_stdout", "input": "1000 4\n", "output": "1333\n"}, {"type": "stdin_stdout", "input": "999 2\n", "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\nA sequence $a_1, a_2, \\dots, a_...
[{"type": "stdin_stdout", "input": "6\n-999999998 -999999999 -1000000000 -999999995 -999999997 -999999995\n", "output": "-1"}, {"type": "stdin_stdout", "input": "6\n-999999998 -999999999 -1000000000 -999999996 -999999997 -999999996\n", "output": "6"}, {"type": "stdin_stdout", "input": "6\n-1000000000 -500000000 -1 0 50...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Chris is bored during his...
[{"type": "stdin_stdout", "input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA family consisting of father be...
[{"type": "stdin_stdout", "input": "100 99 98 97\n", "output": "196\n195\n98\n"}, {"type": "stdin_stdout", "input": "100 50 19 10\n", "output": "100\n50\n19\n"}, {"type": "stdin_stdout", "input": "100 50 19 25\n", "output": "100\n51\n25\n"}, {"type": "stdin_stdout", "input": "100 50 19 30\n", "output": "100\n61\n30\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 some beautiful girls i...
[{"type": "stdin_stdout", "input": "64 118\n361 547 410 294 448 377 482 490 13 116 346 50 251 330 443 128 543 580 370 489 337 509 414 291 228 71 245 308 319 314 154 39 317 288 145 248 547 152 262 278 89 108 522 238 128 575 112 469 86 230 310 492 127 270 475 25 179 72 345 444 17 332 544 338\n", "output": "3"}, {"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\nSome time ago Lesha found an ent...
[{"type": "stdin_stdout", "input": "abbcdddeaaffdfouurtytwoo\n", "output": "18 abbcd...tw\n17 bbcdd...tw\n16 bcddd...tw\n15 cddde...tw\n14 dddea...tw\n13 ddeaa...tw\n12 deaad...tw\n11 eaadf...tw\n10 aadfortytw\n9 adfortytw\n8 dfortytw\n9 fdfortytw\n8 dfortytw\n7 fortytw\n6 ortytw\n5 rtytw\n6 urtytw\n5 rtytw\n4 tytw\n3 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChilly Willy loves playing with ...
[{"type": "stdin_stdout", "input": "123\n", "output": "100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110"}, {"type": "stdin_stdout", "input": "122\n", "output": "100000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nComrade Dujikov is busy choosing...
[{"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000 1 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 1 10000\n", "output": "10000\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\nValera the horse lives on a plan...
[{"type": "stdin_stdout", "input": "37 -100\n", "output": "400\n"}, {"type": "stdin_stdout", "input": "100 100\n", "output": "397\n"}, {"type": "stdin_stdout", "input": "-96 -96\n", "output": "383\n"}, {"type": "stdin_stdout", "input": "99 100\n", "output": "398\n"}, {"type": "stdin_stdout", "input": "16 -32\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you probably know, Anton goes...
[{"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\nGiven is a positive integer N. C...
[{"type": "stdin_stdout", "input": "1000000000000\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "200560490130\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "755827200000\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "366735600000\n", "output": "10\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\nLet S be the concatenation of 10...
[{"type": "stdin_stdout", "input": "62089\n1101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 workers in a company...
[{"type": "stdin_stdout", "input": "10 6\n3 0 0 0 0 0 0 1 0 0\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "9 1\n0 1 1 1 1 1 6 7 8\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "9 1\n0 1 1 1 1 5 6 7 8\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "9 1\n0 0 0 2 5 5 5 5 5\n", "output": "3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter playing Neo in the legenda...
[{"type": "stdin_stdout", "input": "100\n0010110000001111110111101011100111101000110011011100100011110001101110000001000010100001011011110001\n", "output": "2\n001011000000111111011110101110011110100011001101110010001111000110111000000100001010000101101111000 1"}, {"type": "stdin_stdout", "input": "100\n011011001101111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, all the kids in Ber...
[{"type": "stdin_stdout", "input": "76 41\n359 359 366 370 376 375 368 361 369 373 367 363 364 377 363 378 373 371 370 370 360 367 369 359 365 373 379 379 375 361 372 377 369 368 373 362 375 379 365 378 370 370 377 364 373 379 365 362 360 366 375 364 372 376 375 379 362 377 369 370 359 379 365 359 372 376 373 371 364 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 desperately need to build so...
[{"type": "stdin_stdout", "input": "d\n100\nq 0\nj 0\nl 1\nn 1\nv 0\nx 1\nj 1\np 1\nb 1\nv 1\nu 1\ng 0\nk 1\nu 1\nc 1\nj 0\nd 1\nc 0\nv 1\nv 0\nu 1\nq 0\nf 0\ni 0\nn 1\nd 1\nh 1\ni 1\nj 1\ns 0\ni 0\nx 0\nb 0\nc 1\np 0\np 1\no 1\nc 1\nn 1\nf 0\no 0\nx 0\nu 0\ni 0\ng 0\ni 1\nl 0\np 0\nl 1\nl 1\nn 0\nq 1\nn 1\ng 1\nd 0\nb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nManao works on a sports TV. He's...
[{"type": "stdin_stdout", "input": "30\n44 17\n44 17\n44 17\n17 44\n44 17\n44 17\n17 44\n17 44\n17 44\n44 17\n44 17\n44 17\n44 17\n44 17\n17 44\n17 44\n17 44\n44 17\n44 17\n17 44\n44 17\n44 17\n44 17\n17 44\n17 44\n44 17\n17 44\n44 17\n44 17\n44 17\n", "output": "418\n"}, {"type": "stdin_stdout", "input": "30\n67 21\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera loves his garden, where n...
[{"type": "stdin_stdout", "input": "24 1524\n16 934\n23 1940\n21 1447\n20 417\n24 1340\n22 1932\n13 775\n19 2918\n12 2355\n9 593\n11 2676\n3 1857\n16 868\n13 426\n18 1679\n22 991\n9 2728\n10 2497\n16 1221\n9 772\n23 2522\n24 982\n12 1431\n18 757\n", "output": "25893\n"}, {"type": "stdin_stdout", "input": "12 2856\n9 27...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSome time ago Leonid have known ...
[{"type": "stdin_stdout", "input": "142\n34 88 88 88 88 88 131 53 88 130 131 88 88 130 88 131 53 130 130 34 88 88 131 130 53 88 88 34 131 130 88 131 130 34 130 53 53 34 53 34 130 34 88 88 130 88 131 130 34 53 88 34 53 88 130 53 34 53 88 131 130 34 88 88 130 88 130 130 131 131 130 53 131 130 131 130 53 34 131 34 88 53 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\nPolycarpus loves hamburgers very...
[{"type": "stdin_stdout", "input": "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n100 100 100\n100 100 100\n1000000000000\n", "output": "100000001\n"}, {"type": "stdin_stdout", "input": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 he knew every Who down in Wh...
[{"type": "stdin_stdout", "input": "336 336\nHHHHHHHHHS..S..HH..H.S.H..HHH.H.H.H.S.H.S.S.H.S..SS..H.SS.H.HH.HH..HH.H...H.H.H.HSS..H...HH..HH.H..H.S.S....S.H.HH..HS..S.S.S.H.H.S..S.H.HH.HH..HH.HH.HS.HH.HSSHHHHHHHHH.H.HH..HHH.H.H.S..H.HH.S.H..HH.HS.HH.S.H.H.H..H.HH.HS.HHHHH.HH.S.SSS.S.S.HH.HS.H.S.HH.H.HH.H.S.HH.HS.HH..HH...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Γ— m table. Each ...
[{"type": "stdin_stdout", "input": "5 50\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 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\nMany students live in a dormitor...
[{"type": "stdin_stdout", "input": "0 89296 32018 98206 22395\n15733 0 69391 74253 50419\n80450 89589 0 20583 51716\n38629 93129 67730 0 69703\n44054 83018 21382 64478 0\n", "output": "874574\n"}, {"type": "stdin_stdout", "input": "0 14675 94714 27735 99544\n45584 0 43621 94734 66110\n72838 45781 0 47389 99394\n75870 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe subsequence is a sequence th...
[{"type": "stdin_stdout", "input": "10\n291\n292\n293\n294\n295\n296\n297\n298\n299\n300\n", "output": "13377777777777777733333333333333333333337\n133777777777777777733333333333333333333337\n1337777777777777777733333333333333333333337\n13377777777777777777733333333333333333333337\n13377777777777777777773333333333333333...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "4442231232741003009964183199713851566466079882929007253443848371978048610682180431295671905105980116\n", "output": "444223123274100300996418319971385156646607988292900725344384837197804861068218043129567190510598011661108950150917659213408128601684087917384834435270092928897066466515...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Artem found a grasshopper...
[{"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 1\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 1 1 1 100\n", "output": "FINITE\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\nVanya loves playing. He even has...
[{"type": "stdin_stdout", "input": "123 222\n44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, at the \"Russian Code C...
[{"type": "stdin_stdout", "input": "11 5\n", "output": "55\n1 2\n1 3\n1 4\n1 5\n1 6\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6\n3 7\n3 8\n4 5\n4 6\n4 7\n4 8\n4 9\n5 6\n5 7\n5 8\n5 9\n5 10\n6 7\n6 8\n6 9\n6 10\n6 11\n7 8\n7 9\n7 10\n7 11\n7 1\n8 9\n8 10\n8 11\n8 1\n8 2\n9 10\n9 11\n9 1\n9 2\n9 3\n10 11\n10 1\n10 2\n10 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\nSmallR is an archer. SmallR is t...
[{"type": "stdin_stdout", "input": "268 470 444 885\n", "output": "0.725614009325"}, {"type": "stdin_stdout", "input": "632 916 713 821\n", "output": "0.719292895126"}, {"type": "stdin_stdout", "input": "269 656 918 992\n", "output": "0.428937461623"}, {"type": "stdin_stdout", "input": "435 852 973 978\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\nUnfortunately, Vasya can only su...
[{"type": "stdin_stdout", "input": "81\n11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 47 48 49 51 52 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 78 79 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99\n", "output": "1\n11 "}, {"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\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "32\n3 1 3\n2 2 1\n3 1 3\n2 2 2\n3 1 3\n2 2 3\n3 1 3\n2 3 1\n3 1 3\n2 3 2\n3 1 3\n2 3 3\n3 1 3\n3 1 1\n3 1 3\n3 1 2\n3 1 3\n3 1 3\n3 1 3\n3 2 1\n3 1 3\n3 2 2\n3 1 3\n3 2 3\n3 1 3\n3 3 1\n3 1 3\n3 3 2\n3 1 3\n3 3 3\n3 2 1\n1 1 1\n3 2 1\n1 1 2\n3 2 1\n1 1 3\n3 2 1\n1 2 1\n3 2 1\n1 2 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\nXXI Berland Annual Fair is comin...
[{"type": "stdin_stdout", "input": "78 74\n20194 1621 21498 13827 31277 19791 6583 13579 11160 20419 26490 160 3450 12925 9073 10381 27009 27968 10209 6478 18504 15371 32608 14197 12075 13723 12612 19020 28762 11057 12891 31164 16684 13717 19933 25453 2742 4955 6814 2863 10397 15461 20616 10905 2600 20137 4681 9199 270...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIlya is working for the company ...
[{"type": "stdin_stdout", "input": "129341234876124184 1 2\n1 3 3\n1 1 2\n1 2 3\n3 1 1\n3 1 3\n3 2 3\n", "output": "64670617438062091 64670617438062093\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 2 1\n3 1 2\n2 3 3\n1 2 3\n2 2 3\n1 1 3\n2 3 2\n", "output": "1000000000000000000 0\n"}, {"type": "stdin_stdo...
code_stdio