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\nBeing stuck at home, Ray became ... | [{"type": "stdin_stdout", "input": "5\n20 809014\n289 -254 1 -109 -167 93 23 -37 -31 -109 204 59 296 49 132 0 -28 35 -197 -266\n20 458494\n113 218 -292 -298 179 258 -257 -20 296 76 -145 93 -282 -261 -159 -45 255 -107 171 63\n14 876161\n69 74 12 2 177 -113 103 93 38 -48 282 169 205 145\n26 731742\n76 190 -227 -81 -293 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\nWay to go! Heidi now knows how m... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "231564544\n"}, {"type": "stdin_stdout", "input": "536870910\n", "output": "134217727\n"}, {"type": "stdin_stdout", "input": "876543210\n", "output": "169836149\n"}, {"type": "stdin_stdout", "input": "987654321\n", "output": "493827160\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDreamoon is standing at the posi... | [{"type": "stdin_stdout", "input": "++++++++++\n+++??++?++\n", "output": "0.125000000000\n"}, {"type": "stdin_stdout", "input": "--+++---+-\n??????????\n", "output": "0.205078125000\n"}, {"type": "stdin_stdout", "input": "+--+++--+-\n??????????\n", "output": "0.246093750000\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\nOn February, 30th n students cam... | [{"type": "stdin_stdout", "input": "123\n114 105 49 11 115 106 92 74 101 86 39 116 5 48 87 19 40 25 22 42 111 75 84 68 57 119 46 41 23 58 90 102 3 10 78 108 2 21 122 121 120 64 85 32 34 71 4 110 36 30 18 81 52 76 47 33 54 45 29 17 100 27 70 31 89 99 61 6 9 53 20 35 0 79 112 55 96 51 16 62 72 26 44 15 80 82 8 109 14 63 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 beautiful day Vasily the bea... | [{"type": "stdin_stdout", "input": "100000 10\n", "output": "666674.9511055604\n"}, {"type": "stdin_stdout", "input": "100000 3\n", "output": "200002.4853316681\n"}, {"type": "stdin_stdout", "input": "33333 9\n", "output": "200005.4562967670\n"}, {"type": "stdin_stdout", "input": "99999 9\n", "output": "600001.45599500... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAllen wants to enter a fan zone ... | [{"type": "stdin_stdout", "input": "30\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 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\nBuses run between the cities A a... | [{"type": "stdin_stdout", "input": "60 120\n17 120\n23:00\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "60 120\n24 100\n13:00\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "23 118\n118 20\n23:24\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 120\n1 100\n23:59\n", "output": "100\n"}, {"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNatasha is planning an expeditio... | [{"type": "stdin_stdout", "input": "4 100\n84 99 66 69 86 94 89 96 98 93 93 82 87 93 91 100 69 99 93 81 99 84 75 100 86 88 98 100 84 96 44 70 94 91 85 78 86 79 45 88 91 78 98 94 81 87 93 72 96 88 96 97 96 62 86 72 94 84 80 98 88 90 93 73 73 98 78 50 91 96 97 82 85 90 87 41 97 82 97 77 100 100 92 83 98 81 70 81 74 78 84... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTonight is brain dinner night an... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "536870910\n", "output": "268435455\n"}, {"type": "stdin_stdout", "input": "536870912\n", "output": "268435456\n"}, {"type": "stdin_stdout", "input": "876543210\n", "output": "438271605\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere exists an island called Ar... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "6"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "2"}, {"type": "stdin_stdout", "input": "999999998\n", "output": "4"}, {"type": "stdin_stdout", "input": "999999997\n", "output": "8"}, {"type": "stdin_stdout", "input": "989898989\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\nOne day Vasya the Hipster decide... | [{"type": "stdin_stdout", "input": "100 100\n", "output": "100 0\n"}, {"type": "stdin_stdout", "input": "100 45\n", "output": "45 27\n"}, {"type": "stdin_stdout", "input": "100 23\n", "output": "23 38\n"}, {"type": "stdin_stdout", "input": "100 11\n", "output": "11 44\n"}, {"type": "stdin_stdout", "input": "100 10\n", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLuke Skywalker got locked up in ... | [{"type": "stdin_stdout", "input": "9999 10000 10000 10000\n", "output": "0.000050\n"}, {"type": "stdin_stdout", "input": "2173 2176 10000 9989\n", "output": "0.000150\n"}, {"type": "stdin_stdout", "input": "1023 2340 1029 3021\n", "output": "0.325185\n"}, {"type": "stdin_stdout", "input": "1 10000 10000 10000\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\nThese days Arkady works as an ai... | [{"type": "stdin_stdout", "input": "66 20\n0 16\n0 45\n0 58\n1 6\n1 19\n2 7\n2 9\n3 9\n3 25\n3 57\n4 38\n4 58\n5 21\n5 40\n6 16\n6 19\n6 58\n7 6\n7 26\n7 51\n8 13\n8 36\n8 55\n9 1\n9 15\n9 33\n10 12\n10 37\n11 15\n11 34\n12 8\n12 37\n12 55\n13 26\n14 0\n14 34\n14 36\n14 48\n15 23\n15 29\n15 43\n16 8\n16 41\n16 45\n17 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\nYou're given an array $a$ of len... | [{"type": "stdin_stdout", "input": "36\n398353608 662365068 456456182 594572278 958026500 524977116 903404403 382220192 142092809 137516115 522872496 527845939 116437661 423289717 907151540 961740613 981968938 143206666 773454188 691188206 95402302 602570397 986508327 617421132 46091276 866348540 485487643 843511039 76... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation is a sequence of i... | [{"type": "stdin_stdout", "input": "100\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49 52 51 54 53 56 55 58 57 60 59 62 61 64 63 66 65 68 67 70 69 72 71 74 73 76 75 78 77 80 79 82 81 84 83 86 85 88 87 90 89 92 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\nYou are playing the following ga... | [{"type": "stdin_stdout", "input": "9\n7 8 9\n*addcbaba\na*dbbbbbb\ndd*cccbdc\ndbc*ccccc\ncbcc*abdb\nbbcca*cbd\nabbcbc*bb\nbbdcdbb*c\nabccbdbc*\n", "output": "10\n7 4\n9 3\n3 5\n5 1\n8 3\n3 2\n1 8\n8 7\n7 3\n4 1\n"}, {"type": "stdin_stdout", "input": "10\n6 5 10\n*aababbbab\na*bbbbaaaa\nab*aaaabaa\nbba*abbbaa\nabaa*aba... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 problems prepared fo... | [{"type": "stdin_stdout", "input": "100000 10\n99562 479\n643 99684\n593 99867\n99529 175\n99738 616\n99523 766\n99503 121\n99784 158\n199 99199\n15 99849\n", "output": "98433\n"}, {"type": "stdin_stdout", "input": "10 11\n1 10\n1 9\n1 8\n1 7\n2 10\n2 9\n2 8\n2 7\n3 10\n3 9\n3 8\n", "output": "4\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe math faculty of Berland Stat... | [{"type": "stdin_stdout", "input": "100\n1 2 1 2 1 2 1 2 1 3 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 2 1 3 1 2 1 2 1 3 1 3 1 2 1 2 1 3 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 2 1 3 1 3 1 3 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 2 1 2 1 2 1 3 1 2 1 3 1 2 1 2\n", "output": "Finite\n331\n"}, {"type": "stdin_stdout", "input": "100\n2 1 3 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce upon a time there was only ... | [{"type": "stdin_stdout", "input": "10\n1 2 2 4 5 5 6 4 7\n", "output": "1 2 4 5 7 10 "}, {"type": "stdin_stdout", "input": "9\n1 1 3 4 4 6 5 8\n", "output": "1 3 4 5 8 9 "}, {"type": "stdin_stdout", "input": "10\n1 1 1 3 3 5 6 8 3\n", "output": "1 3 10 "}, {"type": "stdin_stdout", "input": "10\n1 1 1 2 3 2 1 2 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\nLet $n$ be an integer. Consider ... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "549766631\n"}, {"type": "stdin_stdout", "input": "623847\n", "output": "407299584\n"}, {"type": "stdin_stdout", "input": "771623\n", "output": "501916356\n"}, {"type": "stdin_stdout", "input": "259813\n", "output": "285457511\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\nYou are given an array $a_1, a_2... | [{"type": "stdin_stdout", "input": "50\n1 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "20\n24 20 23 33 22 18 42 47 47 50 38 37 27 12 25 24 24 43 17 24\n", "output": "17\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\nBerland has a long and glorious ... | [{"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\nDima and his friends have been p... | [{"type": "stdin_stdout", "input": "100\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 5 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 2 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 2 1 2 1 2\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "100\n2 1 1 3 5 4 4 2 3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n— This is not playing but duty a... | [{"type": "stdin_stdout", "input": "5000 5000 5000\n", "output": "986778560\n"}, {"type": "stdin_stdout", "input": "1171 2989 2853\n", "output": "234725427\n"}, {"type": "stdin_stdout", "input": "3238 2923 4661\n", "output": "636587126\n"}, {"type": "stdin_stdout", "input": "4539 2805 2702\n", "output": "356944655\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\nEric is the teacher of graph the... | [{"type": "stdin_stdout", "input": "50\n21 10\n30 22\n3 37\n37 32\n4 27\n18 7\n2 30\n29 19\n6 37\n12 39\n47 25\n41 49\n45 9\n25 48\n16 14\n9 7\n33 28\n3 31\n34 16\n35 37\n27 40\n45 16\n29 44\n16 15\n26 15\n1 12\n2 13\n15 21\n43 14\n9 33\n44 15\n46 1\n38 5\n15 5\n1 32\n42 35\n20 27\n23 8\n1 16\n15 17\n36 50\n13 8\n49 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\nBerland, 2016. The exchange rate... | [{"type": "stdin_stdout", "input": "4314752277691991627730686134692292422155753465948025897701703862445837045929984759093775762579123919\n", "output": "9314752277691991627730686134692292422155753465948025897701703862445837045929984759093775762579123914\n"}, {"type": "stdin_stdout", "input": "354515198058487122724043653... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rules of the Berlan... | [{"type": "stdin_stdout", "input": "231\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 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... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnton loves transforming one per... | [{"type": "stdin_stdout", "input": "12\n3 4 10 1 2 6 7 9 12 5 8 11\n5 8 11 3 4 10 1 2 6 7 9 12\n", "output": "27\n27\n9 10\n10 11\n11 12\n8 9\n9 10\n10 11\n7 8\n8 9\n9 10\n6 7\n7 8\n8 9\n5 6\n6 7\n7 8\n4 5\n5 6\n6 7\n3 4\n4 5\n5 6\n2 3\n3 4\n4 5\n1 2\n2 3\n3 4\n"}, {"type": "stdin_stdout", "input": "10\n9 5 8 6 3 2 4 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\nIn the city of Ultima Thule job ... | [{"type": "stdin_stdout", "input": "####\n.#..\n####\n....\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "....\n....\n....\n....\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "#..#\n.##.\n####\n####\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "#.#.\n.###\n#.#.\n.###\n", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ chips arranged in ... | [{"type": "stdin_stdout", "input": "101 2\nBWBWBWWWBWBWBWWWBWWWBWWWBWBBBBBWBWBBBWBWBWWBBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWWWBWBWBWB\n", "output": "BBBWWWWWWWBWWWWWWWWWWWWWWBBBBBBBBBBBBBBWWWWBBBBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWWWWWWWBWBBB\n"}, {"type": "stdin_stdout", "input": "50 4\nBWBWBWBWBWBW... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 array a with n ele... | [{"type": "stdin_stdout", "input": "100 343\n999 284 486 785 176 742 856 415 992 601 600 122 460 214 338 92 627 913 376 835 384 914 335 179 409 957 96 784 531 43 584 206 971 799 592 801 870 978 437 517 466 952 1 327 731 689 816 681 383 969 452 298 114 687 314 436 267 154 827 197 805 207 284 550 351 700 94 567 524 329 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\nAs you know, an undirected conne... | [{"type": "stdin_stdout", "input": "300 34\n777 497 1099 1221 1255 733 1119 533 1130 822 1000 1272 1104 575 1012 1137 1125 733 1036 823 845 923 1271 949 709 766 935 1226 1088 765 1269 475 1020 977\n5 18\n5 8\n1 20\n2 25\n4 19\n11 34\n6 9\n14 23\n21 22\n12 30\n7 11\n3 12\n18 21\n1 4\n2 6\n1 2\n11 15\n2 31\n4 13\n25 28\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasily the bear has a favorite r... | [{"type": "stdin_stdout", "input": "-1000000000 -1000000000\n", "output": "-2000000000 0 0 -2000000000\n"}, {"type": "stdin_stdout", "input": "-1000000000 -999999999\n", "output": "-1999999999 0 0 -1999999999\n"}, {"type": "stdin_stdout", "input": "-999999999 -1000000000\n", "output": "-1999999999 0 0 -1999999999\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\nEveryone loves a freebie. Especi... | [{"type": "stdin_stdout", "input": "100\n98 63 672 100 254 218 623 415 426 986 920 915 736 795 407 541 382 213 935 743 961 59 660 512 134 935 248 378 739 356 543 714 28 667 602 596 759 791 103 564 225 520 159 542 966 332 983 655 517 273 95 242 593 940 286 236 41 318 941 727 384 225 319 627 982 359 232 769 854 172 643 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\nNow Vasya is taking an exam in m... | [{"type": "stdin_stdout", "input": "10 10\n522 84 340 666 203 545 475 106 1012 955\n72 764 778 197 586 124 407 834 126 866\n", "output": "YES\n0 0 0 0 0 0 0 0 0 522 \n0 0 0 0 0 0 0 0 0 84 \n0 0 0 0 0 0 0 0 0 340 \n0 0 0 0 0 0 0 0 0 666 \n0 0 0 0 0 0 0 0 0 203 \n0 0 0 0 0 0 0 0 0 545 \n0 0 0 0 0 0 0 0 0 475 \n0 0 0 0 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\nAncient Egyptians are known to h... | [{"type": "stdin_stdout", "input": "107 100000\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 0 0 0 0 0 0 0\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... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 integers N and M.\... | [{"type": "stdin_stdout", "input": "100000 1000000000\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "100000 921100000\n", "output": "9211\n"}, {"type": "stdin_stdout", "input": "100000 932262032\n", "output": "6362\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\nYou are given an undirected conn... | [{"type": "stdin_stdout", "input": "100 1000\n1 2 1\n1 3 1\n1 4 1\n1 5 1\n1 6 1\n1 7 1\n1 8 1\n1 9 1\n1 10 1\n1 11 1\n1 12 1\n1 13 1\n1 14 1\n1 15 1\n1 16 1\n1 17 1\n1 18 1\n1 19 1\n1 20 1\n1 21 1\n1 22 1\n1 23 1\n1 24 1\n1 25 1\n1 26 1\n1 27 1\n1 28 1\n1 29 1\n1 30 1\n1 31 1\n1 32 1\n1 33 1\n1 34 1\n1 35 1\n1 36 1\n1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a string S. Each charac... | [{"type": "stdin_stdout", "input": "???????????????2?????????????8???????????6????????5?6?5????1???8????1???????????????????????????????????3??????9????????????3??6???????????6???????????????????3???????????9???????3????6?5?????????????????2???????????5418??????????8????????9????????????0????????????????????????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\nSince the giant heads have appea... | [{"type": "stdin_stdout", "input": "100 50\n2 62 -62\n2 19 -19\n2 38 -38\n2 -84 84\n2 -16 16\n2 67 -67\n2 41 -41\n2 -32 32\n2 32 -32\n2 -62 62\n2 89 -89\n2 -84 84\n2 96 -96\n2 -11 11\n2 59 -59\n2 -13 13\n2 -70 70\n2 -3 3\n2 -41 41\n2 -74 74\n2 47 -47\n2 87 -87\n2 17 -17\n2 20 -20\n2 -14 14\n2 -67 67\n2 -95 95\n2 -15 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\nYou are given an array $a$ of $n... | [{"type": "stdin_stdout", "input": "23 691688417\n162011045 845692742 774584765 103906675 222286673 251540072 657857114 45615854 71306611 790640347 835976636 327687572 570766082 48938195 769656348 341889962 393959831 928029640 320443541 248114937 798473713 159552755 533648295\n", "output": "632988146"}, {"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\nYou are given a text of single-s... | [{"type": "stdin_stdout", "input": "200\nLBmJKQLCKUgtTxMoDsEerwvLOXsxASSydOqWyULsRcjMYDWdDCgaDvBfATIWPVSXlbcCLHPYahhxMEYUiaxoCebghJqvmRnaNHYTKLeOiaLDnATPZAOgSNfBzaxLymTGjfzvTegbXsAthTxyDTcmBUkqyGlVGZhoazQzVSoKbTFcCRvYsgSCwjGMxBfWEwMHuagTBxkz\n", "output": "105\n"}, {"type": "stdin_stdout", "input": "200\nAAAAAAAAAAAAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCaisa is going to have a party a... | [{"type": "stdin_stdout", "input": "69 9\n39 15\n70 44\n90 89\n84 58\n83 97\n24 28\n90 18\n7 96\n43 86\n99 50\n77 12\n12 34\n100 19\n21 86\n55 30\n99 29\n26 92\n82 67\n78 14\n64 16\n98 12\n31 39\n36 86\n73 36\n87 29\n42 23\n58 15\n35 52\n91 56\n39 6\n88 45\n38 36\n57 12\n79 71\n40 33\n98 42\n34 36\n23 79\n69 68\n50 47\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToad Ivan has $m$ pairs of integ... | [{"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 6\n2 7\n2 9\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9 10\n6 5\n9 8\n7 8\n4 5\n5 8\n3 5\n7 8\n9 8\n8 5\n1 5\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 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\nVasiliy is fond of solving diffe... | [{"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\naaaaaaaaaaab\nab\naab\naaab\naaaab\naaaaab\naaaaaab\naaaaaaab\naaaaaaaab\naaaaaaaaab\n", "output": "8000000000\n"}, {"type": "stdin_stdout", "input": "10\n1000000000 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\nPetya studies in a school and he... | [{"type": "stdin_stdout", "input": "10\n10\n10\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "10\n5\n6\n", "output": "300\n"}, {"type": "stdin_stdout", "input": "2\n10\n3\n", "output": "60\n"}, {"type": "stdin_stdout", "input": "9\n7\n2\n", "output": "126\n"}, {"type": "stdin_stdout", "input": "1\n1\n10\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 parliamentarians in ... | [{"type": "stdin_stdout", "input": "109 37 3\n", "output": "1 2 3 \n4 5 6 \n7 8 9 \n10 11 12 \n13 14 15 \n16 17 18 \n19 20 21 \n22 23 24 \n25 26 27 \n28 29 30 \n31 32 33 \n34 35 36 \n37 38 39 \n40 41 42 \n43 44 45 \n46 47 48 \n49 50 51 \n52 53 54 \n55 56 57 \n58 59 60 \n61 62 63 \n64 65 66 \n67 68 69 \n70 71 72 \n73 74... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Radewoosh are going to... | [{"type": "stdin_stdout", "input": "50 1\n5 14 18 73 137 187 195 197 212 226 235 251 262 278 287 304 310 322 342 379 393 420 442 444 448 472 483 485 508 515 517 523 559 585 618 627 636 646 666 682 703 707 780 853 937 951 959 989 991 992\n30 84 113 173 199 220 235 261 266 277 300 306 310 312 347 356 394 396 397 409 414 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSakuzyo - Imprinting\n\nA.R.C. M... | [{"type": "stdin_stdout", "input": "1\n100 52 99\n51 69 42 32 34 62 12 75 88 18 57 47 40 91 100 81 72 15 26 14 93 68 6 50 5 24 97 52 10 20 54 9 56 39 21 55 7 98 59 87 77 17 29 13 30 46 37 76 71 78 96 82 49 64 84 60 67 19 2 25 85 89 38 41 11 90 35 48 27 28 70 65 66 16 79 3 80 44 36 43 61 99 22 33 86 4 83 94 74 31 73 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\nPolycarp is preparing the first ... | [{"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 1 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\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 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPiegirl is buying stickers for a... | [{"type": "stdin_stdout", "input": "aaaaa\n100\n", "output": "1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"}, {"type": "stdin_stdout", "input": "abc\n100\n", "output": "1\nabcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKarl likes Codeforces and subseq... | [{"type": "stdin_stdout", "input": "10000000000000000\n", "output": "ccccccccccccccccccccccccccccccccccccccccooooooooooooooooooooooooooooooooooooooooddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffffffoooooooooooooooooooooooooooooooooooooooorrrrrrrrrrr... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSagheer is playing a game with h... | [{"type": "stdin_stdout", "input": "21\n6194737 6429360 6047962 1014039 9196042 2483033 9232471 5444322 4437778 6614229 4791649 7417126 7679607 790939 3062370 174847 8404336 832859 2083127 9041108 3074902\n1 2 3 4 4 6 7 2 9 10 9 12 12 1 15 1 17 1 19 19\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "23\n795895... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 planning to build housin... | [{"type": "stdin_stdout", "input": "50 50 50\n28 29 9\n33 43 30\n12 34 3\n9 12 26\n24 39 10\n12 47 35\n29 41 47\n43 44 49\n19 37 36\n11 18 46\n19 42 20\n9 40 47\n18 34 22\n11 20 44\n5 31 44\n29 40 0\n1 26 19\n7 50 4\n14 34 48\n43 48 21\n12 49 23\n6 40 47\n22 37 50\n39 48 29\n12 34 13\n5 10 25\n30 45 46\n26 32 29\n2 4 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\nVery soon Berland will hold a Sc... | [{"type": "stdin_stdout", "input": "10 4\nigtVqPgoW 3 24\nuc 1 381\nOxmovZAv 4 727\nxyRAaAk 2 378\nvYCV 4 67\nuf 2 478\nDawOytiYiH 2 775\nRS 1 374\npLhTehhjA 2 38\nYkWfb 3 595\n", "output": "uc RS\nDawOytiYiH uf\nYkWfb igtVqPgoW\nOxmovZAv vYCV\n"}, {"type": "stdin_stdout", "input": "10 2\nSHiBIEz 2 628\nXxwaAxB 1 190\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\nNatasha is going to fly to Mars.... | [{"type": "stdin_stdout", "input": "50 13\nqwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "169"}, {"type": "stdin_stdout", "input": "50 14\nqwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "-1"}, {"type": "stdin_stdout", "input": "50 31\nahbyyoxltryqdmvenemaqnbakglgqolxnaifnqtoclnnqiab... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 100000\n100000 100000 100000 100000\n100000 100000 100000 100000\n100000 100000 100000 100000\n", "output": "1 99000 1000\n"}, {"type": "stdin_stdout", "input": "100000\n100000 100000 100000 100000\n100000 100000 100000 100000\n100000 100000 100000 100000\n10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has n dice d_1, d_2, ..... | [{"type": "stdin_stdout", "input": "10 20\n1 1 1 1 5 100 1 1 1 1\n", "output": "0 0 0 0 0 95 0 0 0 0 "}, {"type": "stdin_stdout", "input": "10 13\n9 9 6 9 10 4 5 10 8 9\n", "output": "5 5 2 5 6 0 1 6 4 5 "}, {"type": "stdin_stdout", "input": "10 79\n9 9 6 9 10 4 5 10 8 9\n", "output": "8 8 5 8 9 3 4 9 7 8 "}, {"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\nAndrewid the Android is a galaxy... | [{"type": "stdin_stdout", "input": "100\n15 86 17 88 19 90 21 92 23 94 25 96 27 98 29 0 31 2 33 4 35 6 37 8 39 10 41 12 43 14 45 16 47 18 49 20 51 22 53 24 55 26 57 28 59 30 61 32 63 34 65 36 67 38 69 40 71 42 73 44 75 46 77 48 79 50 81 52 83 54 85 56 87 58 89 60 91 62 93 64 95 66 97 68 99 70 1 72 3 74 5 76 7 78 9 80 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob and Alice are often particip... | [{"type": "stdin_stdout", "input": "372839920 992839201 1000000000\n100293021 773829394 999999993\n", "output": "619999282\n"}, {"type": "stdin_stdout", "input": "111111111 888888889 999999999\n998997996 999999999 1000000000\n", "output": "1002004\n"}, {"type": "stdin_stdout", "input": "100293023 882738299 1000000000\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKostya is a genial sculptor, he ... | [{"type": "stdin_stdout", "input": "2\n999999999 1000000000 1000000000\n1000000000 1000000000 1000000000\n", "output": "2\n2 1\n"}, {"type": "stdin_stdout", "input": "9\n1 3 2\n3 3 1\n3 1 2\n3 3 2\n2 2 2\n3 2 1\n3 3 1\n3 3 1\n2 1 2\n", "output": "2\n4 8\n"}, {"type": "stdin_stdout", "input": "7\n10 7 8\n5 10 3\n4 2 6\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a grid of square cells ... | [{"type": "stdin_stdout", "input": "22 75\n5 4 1 0 6 8 6 1 4 4 1 3 6 5 1 1 7 6 6 8 7 0 8 5 9 7 7 5 9 2 2 8 0 9 4 7 0 9 6 7 3 7 5 4 0 9 1 4 0 6 6 3 0 3 4 3 4 9 0 4 0 1 4 0 1 2 5 1 8 8 6 5 1 1 7\n2 4 1 3 9 3 7 3 1 8 9 2 0 0 1 9 6 6 4 6 6 7 9 5 3 2 9 5 0 7 8 2 1 3 1 4 4 8 3 6 8 1 4 9 9 7 8 1 9 6 8 7 0 9 5 2 8 4 0 9 4 7 7 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInna and Dima decided to surpris... | [{"type": "stdin_stdout", "input": "63 67 18046757 61758841 85367218 68\n22 30\n25 40\n56 58\n29 11\n34 63\n28 66\n51 5\n39 64\n1 23\n24 61\n19 47\n10 31\n55 28\n52 26\n38 7\n28 31\n13 27\n37 42\n10 52\n19 33\n7 36\n13 1\n46 40\n21 41\n1 1\n6 35\n10 4\n46 9\n21 57\n1 49\n34 14\n14 35\n43 4\n1 41\n25 22\n18 25\n27 23\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\nLet's define logical OR as an op... | [{"type": "stdin_stdout", "input": "7 10\n1 0 1 0 0 0 1 0 1 0\n1 0 1 0 0 0 1 0 1 0\n1 1 1 1 1 1 1 1 1 1\n1 0 1 0 0 0 1 0 1 0\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n", "output": "YES\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n1 0 1 0 0 0 1 0 1 0\n0 0 0 0 0 0 0 0 0 0\n1 0 1 0 0 0 1 0 1 0\n1 0 1 0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGennady owns a small hotel in th... | [{"type": "stdin_stdout", "input": "AS\n2H 4C TH JH AD\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4D\nAS AC AD AH 5H\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "KH\n3C QD 9S KS 8D\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4H\nJH QC 5H 9H KD\n", "output": "YES\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\nAfter celebrating the midcourse ... | [{"type": "stdin_stdout", "input": "40\n119631 119631 772776 119631 658661 119631 108862 524470 125132 700668 69196 844949 154577 108862 108862 108862 597344 940938 989698 108862 154577 69196 125132 687080 940938 125132 69196 69196 125132 566152 953083 406319 380068 119631 154577 125132 413984 69196 154577 154577\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\nYour friend Mishka and you atten... | [{"type": "stdin_stdout", "input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 1 1 1 1 1 0 1\n", "output": "10009\n"}, {"type": "stdin_stdout", "input": "10 4\n9 5 6 4 3 9 5 1 10 7\n0 0 0 0 0 0 1 0 0 1\n", "output": "36\n"}, {"type": "stdin_stdout", "input": "10 5\n3 5 9 2 5 9 3 8 8 1\n0 1 1 1 0 1 0 0 0 0\n", "output": "49\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn a galaxy far, far away Lesha ... | [{"type": "stdin_stdout", "input": "90 900\n", "output": "12\n13 12 11 10 9 8 7 6 5 4 3 2 \n32\n44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 1 "}, {"type": "stdin_stdout", "input": "660 6\n", "output": "33\n36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 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\nIn Berland, there is the nationa... | [{"type": "stdin_stdout", "input": "99 42\n61 66 47\n10 47 96\n68 86 67\n21 29 10\n55 44 47\n12 82 4\n45 71 55\n86 3 95\n16 99 93\n14 92 82\n12 59 20\n73 24 8\n79 72 48\n44 87 39\n87 84 97\n47 70 37\n49 77 95\n39 75 28\n75 25 5\n44 41 36\n76 86 78\n73 6 90\n8 22 58\n9 72 63\n81 42 14\n1 21 35\n91 54 15\n30 13 39\n56 89... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMasha has three sticks of length... | [{"type": "stdin_stdout", "input": "100 100 100\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "100 10 10\n", "output": "81\n"}, {"type": "stdin_stdout", "input": "100 100 99\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "12 34 56\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "100 100 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 an integer $n$ ($n... | [{"type": "stdin_stdout", "input": "97 100\n93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChouti and his classmates are go... | [{"type": "stdin_stdout", "input": "36\n34 35 34 34 32 32 35 34 34 32 33 35 33 35 35 34 35 33 34 35 34 35 35 35 34 35 32 35 33 35 33 33 35 35 35 34\n", "output": "Possible\n17 1 17 18 24 24 2 18 19 24 22 3 22 4 5 19 6 22 20 7 20 8 9 10 21 11 24 12 23 13 23 23 14 15 16 21 "}, {"type": "stdin_stdout", "input": "10\n7 7 7... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday, Wet Shark is given n inte... | [{"type": "stdin_stdout", "input": "5\n999999999 999999999 999999999 999999999 999999999\n", "output": "3999999996"}, {"type": "stdin_stdout", "input": "15\n87 22 98 32 88 36 72 31 100 97 17 16 60 22 20\n", "output": "798"}, {"type": "stdin_stdout", "input": "15\n87 37 91 29 58 45 51 74 70 71 47 38 91 89 44\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\nIn Berland there are n cities an... | [{"type": "stdin_stdout", "input": "12\n1 2\n2 3\n2 4\n2 5\n5 7\n5 6\n5 8\n5 12\n12 10\n12 11\n12 9\n", "output": "5\n2 4 9 \n3 1 5 10 \n3 2 6 11 \n2 3 7 \n1 8 \n"}, {"type": "stdin_stdout", "input": "10\n2 8\n5 10\n3 4\n1 6\n3 9\n1 7\n4 8\n10 8\n1 8\n", "output": "4\n4 1 2 3 4 \n3 5 6 7 \n1 8 \n1 9 \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\nDima and Seryozha live in an ord... | [{"type": "stdin_stdout", "input": "50\n384672 661179 -775591 -989608 611120 442691 601796 502406 384323 -315945 -934146 873993 -156910 -94123 -930137 208544 816236 466922 473696 463604 794454 -872433 -149791 -858684 -467655 -555239 623978 -217138 -408658 493342 -733576 -350871 711210 884148 -426172 519986 -356885 5271... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen preparing a tournament, Cod... | [{"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": "EASY\n"}, {"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 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\nIn Omkar's last class of math, h... | [{"type": "stdin_stdout", "input": "10\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n", "output": "500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGreatest common divisor GCD(a, b... | [{"type": "stdin_stdout", "input": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "10000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 overcoming the stairs Dash... | [{"type": "stdin_stdout", "input": "25 16\nvza**ooxkmd#*ywa\ndip#*#&ef&z&&&pv\nwggob&&72#*&&nku\nrsb##*&jm&#u**te\nzif#lu#t&2w#jbqb\nwfo&#&***0xp#&hp\njbw##h*###nkmkdn\nqrn*&y#3cnf&d*rc\nend*zg&0f*&g*&ak\niayh&r#8om#o**yq\nwym&e&*v0j&#zono\ntzu*vj&i18iew&ht\nhpfnceb193&#&acf\ngesvq&l&*&m*l*ru\nfot#u&pq&0y&s*pg\nqdfgs&h... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 natural number was written ... | [{"type": "stdin_stdout", "input": "200\n1000000010000000000000000000010000000000000001000001000000000000000000000000000000000000000000000000\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "700\n9307216756404590162143344901558545760612901767837570518638460182990196397856220673189163417019781185\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\nAndrew prefers taxi to other mea... | [{"type": "stdin_stdout", "input": "10 45\n5 6 894\n9 4 197\n7 1 325\n9 7 232\n7 2 902\n1 4 183\n5 7 41\n10 5 481\n7 8 495\n8 5 266\n4 7 152\n1 8 704\n3 1 790\n9 1 458\n10 2 546\n6 2 258\n2 5 30\n5 4 366\n6 7 747\n4 2 546\n6 8 332\n6 10 816\n3 6 523\n10 3 683\n4 3 771\n3 9 152\n5 1 647\n2 3 967\n3 8 785\n9 10 793\n9 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\nUser ainta has a permutation p_1... | [{"type": "stdin_stdout", "input": "15\n6 1 2 7 9 13 14 8 4 5 3 12 10 15 11\n000100100100100\n000010010010010\n000001001001001\n100000100100100\n010000010010010\n001000001001001\n100100000100100\n010010000010010\n001001000001001\n100100100000100\n010010010000010\n001001001000001\n100100100100000\n010010010010000\n00100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHongcow is learning to spell! On... | [{"type": "stdin_stdout", "input": "abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "zyzzzyyzyyyzyyzyzyzyzyzzzyyyzzyzyyzzzzzyyyzzzzyzyy\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaab\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\nBerland shop sells $n$ kinds of ... | [{"type": "stdin_stdout", "input": "25\n8 CA\n4 AB\n8 CA\n4 CA\n7 CB\n4 CB\n4 CB\n2 AC\n2 CA\n3 BC\n4 AC\n7 AB\n3 CA\n5 BC\n7 CB\n9 CA\n7 AB\n7 CA\n9 BA\n8 AC\n6 BA\n2 AC\n1 CB\n5 AB\n3 AB\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "20\n10 CA\n1 CB\n10 BC\n4 AC\n4 BA\n6 CB\n10 CB\n8 BC\n9 BC\n1 BA\n10 AB\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\nОсновой любой социальной сети яв... | [{"type": "stdin_stdout", "input": "10 50\n946010975 207263044\n923545573 749203275\n862015642 426425906\n749203275 839134958\n910721783 289091881\n827003531 333726912\n49704846 538788252\n382891592 207263044\n333726912 438209022\n974360048 49704846\n", "output": "49704846: 0\n207263044: 0\n289091881: 0\n333726912: 0\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs it's the first of April, Heid... | [{"type": "stdin_stdout", "input": "plqaykgovxkvsiahdbglktdlhcqwelxxmtlyymrsyubxdskvyjkrowvcbpdofpjqspsrgpakdczletxujzlsegepzleipiyycpinzxgwjsgslnxsotouddgfcybozfpjhhocpybfjbaywsehbcfrayvancbrumdfngqytnhihyxnlvilrqyhnxeckprqafofelospffhtwguzjbbjlzbqrtiielbvzutzgpqxosiaqznndgobcluuqlhmffiowkjdlkokehtjdyjvmxsiyxureflmdom... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. He... | [{"type": "stdin_stdout", "input": "69 1701\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzy\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax\n"}, {"type": "stdin_stdout", "input": "50 100\ntewducenaqgpilgftjcmzttrgebnyldwfgbtttrygaiqtkgbjb\n", "output": "azazec... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 n × n square matrix is specia... | [{"type": "stdin_stdout", "input": "7 4 100501\n0100010\n0000101\n0100100\n0000011\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "6 4 100501\n100010\n100100\n010100\n000011\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "8 2 910911\n01000100\n01010000\n", "output": "148140\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 likes to solve equations. ... | [{"type": "stdin_stdout", "input": "999983 1000\n", "output": "999983001\n"}, {"type": "stdin_stdout", "input": "999995 1000\n", "output": "199999005\n"}, {"type": "stdin_stdout", "input": "1000000 1000\n", "output": "1250800\n"}, {"type": "stdin_stdout", "input": "994009 997\n", "output": "991026974\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\nVladik often travels by trains. ... | [{"type": "stdin_stdout", "input": "100\n931 4584 2116 3004 3813 62 2819 2998 2080 4906 3198 2443 2952 3793 1958 3864 3985 3169 3134 4011 4525 995 4163 308 4362 1148 4906 3092 1647 244 1370 1424 2753 84 2997 1197 2606 425 3501 2606 683 4747 3884 4787 2166 3017 3080 4303 3352 1667 2636 3994 757 2388 870 1788 988 1303 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\nGiven is a directed graph G with... | [{"type": "stdin_stdout", "input": "1000 2000\n284 896\n114 756\n378 967\n409 521\n21 743\n663 470\n940 331\n253 190\n101 967\n445 448\n229 742\n208 887\n481 989\n212 276\n886 105\n522 952\n70 458\n108 793\n883 175\n392 676\n432 113\n997 710\n643 649\n813 939\n796 315\n586 763\n746 409\n160 722\n577 249\n897 905\n332 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 N cells arranged in a ... | [{"type": "stdin_stdout", "input": "200000 10\n195313 197047\n198503 199144\n199910 200000\n193793 195312\n186922 193792\n199860 199909\n199145 199570\n197048 198502\n1 186921\n199571 199859\n", "output": "946746535\n"}, {"type": "stdin_stdout", "input": "199993 10\n23896 23905\n92651 92660\n184931 184940\n101332 10134... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "20 1 20 1 18 20\n", "output": "20\nAAAAAAAAAAAAAAAAAAAA\nBBBBBBBBBBBBBBBBBBBB\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCCCCCCCCCCCCCCC\nCCCCCCC... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt seems like the year of 2013 c... | [{"type": "stdin_stdout", "input": "1987\n", "output": "2013\n"}, {"type": "stdin_stdout", "input": "2013\n", "output": "2014\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "1023\n"}, {"type": "stdin_stdout", "input": "1001\n", "output": "1023\n"}, {"type": "stdin_stdout", "input": "1234\n", "output": "1235... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEmuskald is addicted to Codeforc... | [{"type": "stdin_stdout", "input": "132\n13 7 33 124 118 76 94 92 16 107 130 1 46 58 28 119 42 53 102 81 99 29 57 70 125 45 100 68 10 63 34 38 19 49 56 30 103 72 106 3 121 110 78 2 31 129 128 24 77 61 87 47 15 21 88 60 5 101 82 108 84 41 86 66 79 75 54 97 55 12 69 44 83 131 9 95 11 85 52 35 115 80 111 27 109 36 39 104 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 way to make a new task is to m... | [{"type": "stdin_stdout", "input": "6\nzfnkpxaavrcvqhhkclcuiswawpghlqrlq wnvbzhvsjozlkwxowcvyclmehjkkvkxin\nzkxkvlnovnloxjdydujkjydaegzjypsgrzq dmiilhmkspokltabpvwalijhlitbfp\nldfbfggqsdqethdgkmbcwloluguxiluqjyr fewoondewvndcxticvpiqnvvdhsnzfd\nepokfmixjnawdfgkmqlcyirxuprrvudh xvijbdzqdyjwsyhjucytuxrxuiynxf\nxntrjusjwb... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 boy named Ayrat lives on plane... | [{"type": "stdin_stdout", "input": "jjjbjjbjbbbbbbjbjbbjbjbbbjbjbbjbbjbbjjbjbjjjbbbbjbjjjjbbbjbjjjjjbjbjbjjjbjjjjjjjjbbjbjbbjbbjbbbbbjjjbbjjbjjbbbbjbbjbbbbbjbbjjbjjbbjjjbjjbbbbjbjjbjbbjbbjbjbjbbbjjjjbjbjbbjbjjjjbbjbjbbbjjjjjbjjbjbjjjbjjjbbbjbjjbbbbbbbjjjjbbbbj\njjbbjbbjjjbjbbjjjjjbjbjjjbjbbbbjbbjbjjbjbbjbbbjjbjjbjbbbjb... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "100\n93 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 58 100 83 92 89 56 99 88 59 95 72 81 51 85 71 97 60 91 63 65 98 79 84 53 62 87 55 52 78\n", "output": "1225\n"}, {"type": "stdin_stdout", "input": "100\n9 63 62 88 3 67 54 33 79 51 71 80 37 46 43 57 69 17 34 6 18 40 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKolya is going to make fresh ora... | [{"type": "stdin_stdout", "input": "100 1000 1083\n992 616 818 359 609 783 263 989 501 929 362 394 919 1081 870 830 1097 975 62 346 531 367 323 457 707 360 949 334 867 116 478 417 961 963 1029 114 867 1008 988 916 983 1077 959 942 572 961 579 318 721 337 488 717 111 70 416 685 987 130 353 107 61 191 827 849 106 815 211... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is a farmer. He has a large ... | [{"type": "stdin_stdout", "input": "10 10\n....W.W.W.\n.........S\n.S.S...S..\nW.......SS\n.W..W.....\n.W...W....\nS..S...S.S\n....W...S.\n..S..S.S.S\nSS.......S\n", "output": "Yes\nDDDDWDWDWD\nDDDDDDDDDS\nDSDSDDDSDD\nWDDDDDDDSS\nDWDDWDDDDD\nDWDDDWDDDD\nSDDSDDDSDS\nDDDDWDDDSD\nDDSDDSDSDS\nSSDDDDDDDS\n"}, {"type": "stdi... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.