messages
listlengths
1
1
ground_truth
stringlengths
156
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\nYou have N cards. On the i-th card, an integer A_i is written.\nFor each j = 1, 2, ..., M in this order, you ...
[{"input": "11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n", "output": "10000000001\n"}, {"input": "11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000001", "output": "10000000004\n"}, {"input": "11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1100000000", "output": "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\nLet A, B, C, D, E be sets of integers and let U is a universal set that includes all sets under consideration...
[{"input": "A 3\n1 2 -1\nB 4\n4 0 0 11\nD 1\n5\nR 0\ncAiBdD\nC 3\n1 2 3\nA 4\n2 7 8 0\nB 3\n3 6 21\nR 0\n(As(AiB))uB", "output": "0 4 11\n0 2 3 6 7 8 21\n"}, {"input": "A 3\n2 3 -1\nB 4\n3 1 10 11\nD 1\n5\nR 0\ncAiBdD\nC 3\n1 2 3\nA 4\n2 10 8 3\nB 3\n2 4 7\nR 0\n(As(AiB))uC", "output": "1 10 11\n1 2 3 8 10\n"}, {"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\nValeric and Valerko missed the last Euro football game, so they decided to watch the game's key moments on th...
[{"input": "1000 1 1000\n", "output": "999000\n"}, {"input": "1286 123 1043\n", "output": "9862\n"}, {"input": "1286 187 1043\n", "output": "6130\n"}, {"input": "1705 812 917\n", "output": "1009\n"}, {"input": "1286 123 899\n", "output": "8501\n"}, {"input": "1705 1125 917\n", "output": "473\n"}, {"input": "1329 1125 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\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence. The sequence A nee...
[{"input": "15043200 358979323846264338", "output": "35\n"}, {"input": "12899738 158337027091717102", "output": "34\n"}, {"input": "12899738 686618920047839292", "output": "36\n"}, {"input": "1565492 1138463356571161467", "output": "40\n"}, {"input": "12899738 272946151952874087", "output": "35\n"}, {"input": "12899738...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream...
[{"input": "100 100\n100 100\n", "output": "100\n"}, {"input": "100 100\n100 100\n", "output": "100\n"}, {"input": "100 110\n100 100\n", "output": "-1\n"}, {"input": "87 22\n119 64\n", "output": "1849\n"}, {"input": "31 74\n88 152\n", "output": "2616\n"}, {"input": "39 52\n88 78\n", "output": "1222\n"}, {"input": "59 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\nIt all started with a black-and-white picture, that can be represented as an $n \\times m$ matrix such that a...
[{"input": "6 4 7\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n010...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a function that returns an array containing the first `l` digits from the `n`th diagonal of [Pascal's ...
[{"input": "4\n10", "output": "[[1, 5, 15, 35, 70, 126, 210, 330, 495, 715]]", "fn_name": "generate_diagonal"}, {"input": "100\n6", "output": "[[1, 101, 5151, 176851, 4598126, 96560646]]", "fn_name": "generate_diagonal"}, {"input": "3\n10", "output": "[[1, 4, 10, 20, 35, 56, 84, 120, 165, 220]]", "fn_name": "generate_d...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp is wondering about buying a new computer, which costs $c$ tugriks. To do this, he wants to get a job...
[{"input": "3\n4 15\n1 3 20 11\n1 2 13\n4 100\n2 5 10 50\n3 26 12\n2 1000000000\n1 1\n1\n", "output": "5\n14\n1000000000\n"}, {"input": "3\n4 15\n1 6 20 11\n1 2 13\n4 100\n2 7 10 50\n3 26 12\n2 1000000000\n1 1\n1\n", "output": "5\n12\n1000000000\n"}, {"input": "3\n4 15\n1 3 10 11\n0 2 23\n4 100\n2 5 10 50\n3 14 12\n2 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\nThere is a binary string $a$ of length $n$. In one operation, you can select any prefix of $a$ with an equal ...
[{"input": "5\n10\n0111010000\n0100101100\n4\n0000\n0000\n3\n000\n000\n12\n010101010101\n100110011010\n6\n000111\n110100\n", "output": "YES\nYES\nYES\nYES\nNO\n"}, {"input": "5\n10\n0101011000\n1001101000\n4\n0000\n0000\n3\n010\n100\n12\n010101010101\n100110011010\n6\n000011\n110100\n", "output": "YES\nYES\nYES\nYES\nN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ of $n$ positive integers.\n\nYou can use the following operation as many times as ...
[{"input": "4\n3\n1 2 -1\n5\n40 9 13 6 13\n5\n1 1 0 1 1\n4\n7 2 1 10\n", "output": "NO\nYES\nYES\nYES\n"}, {"input": "4\n3\n1 2 2\n5\n20 9 15 6 9\n5\n1 1 0 1 1\n4\n5 2 1 10\n", "output": "YES\nYES\nYES\nYES\n"}, {"input": "4\n3\n1 2 1\n5\n20 9 15 6 9\n5\n1 1 0 1 1\n4\n5 2 1 10\n", "output": "YES\nYES\nYES\nYES\n"}, {"i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function that receives two strings and returns n, where n is equal to the number of characters we sho...
[{"input": "\"123456789!@#$%^&*( )qwerty\"\n\"9!@#$%^&*( )qwerty12345678\"", "output": "[18]", "fn_name": "shifted_diff"}, {"input": "\"doomhouse\"\n\"hoodmouse\"", "output": "[-1]", "fn_name": "shifted_diff"}, {"input": "\"fatigue\"\n\"tiguefa\"", "output": "[5]", "fn_name": "shifted_diff"}, {"input": "\"eecoff\"\n\"c...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the capital city of Berland, Bertown, demonstrations are against the recent election of the King of Berlan...
[{"input": "100 10\n9199\n89 409 428 408 309 400 259 393 212 273 472 654 533 774 663 484 695 801 587 518 521 578 767 644 532 785 500 944 582 680 899 882 589 601 614 633 877 543 770 614 852 715 932 627 639 658 765 957 898 545 977 751 740 869 885 831 834 702 934 954 500 626 605 921 755 661 707 952 842 978 979 879 837 581...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA browser-based puzzle game called \"Bubble Puzzle\" is now popular on the Internet.\n\nThe puzzle is played ...
[{"input": "2 4 3 4\n2 1 2 4\n3 3 2 2\n0 3 3 3", "output": "-1\n"}, {"input": "2 4 3 4\n2 1 2 0\n3 3 2 2\n0 3 3 3", "output": "-1\n"}, {"input": "2 1 4 1\n2 2 4 2\n2 4 4 1\n0 4 4 1", "output": "-1\n"}, {"input": "2 4 3 3\n2 1 4 1\n3 3 2 2\n0 3 1 3", "output": "-1\n"}, {"input": "2 4 4 0\n2 2 4 1\n2 4 1 1\n2 3 4 0", "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\nWhen provided with a number between 0-9, return it in words.\n\nInput :: 1\n\nOutput :: \"One\".\n\nIf your l...
[{"input": "3", "output": "[\"Three\"]", "fn_name": "switch_it_up"}, {"input": "7", "output": "[\"Seven\"]", "fn_name": "switch_it_up"}, {"input": "8", "output": "[\"Eight\"]", "fn_name": "switch_it_up"}, {"input": "0", "output": "[\"Zero\"]", "fn_name": "switch_it_up"}, {"input": "4", "output": "[\"Four\"]", "fn_name"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n let F(N) be the sum square of digits of N. So:\n \n `F(1) = 1, F(3) = 9, F(123) = 14`\n\n Choose a n...
[{"input": "810", "output": "[8]", "fn_name": "repeat_sequence_len"}, {"input": "812", "output": "[8]", "fn_name": "repeat_sequence_len"}, {"input": "818", "output": "[1]", "fn_name": "repeat_sequence_len"}, {"input": "833", "output": "[1]", "fn_name": "repeat_sequence_len"}, {"input": "85", "output": "[8]", "fn_name":...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, ...
[{"input": "18 1 -1\n2 -1 1\n5 2 1\n1 1 4\n5 2 0\n2 0 12", "output": "18\n"}, {"input": "10 10 5\n1 6 1\n4 1 3\n6 9 4\n9 4 2\n3 1 3\n", "output": "64\n"}, {"input": "10 10 5\n1 14 1\n4 1 1\n6 4 4\n9 0 2\n3 2 4", "output": "10\n"}, {"input": "10 10 0\n1 6 1\n4 1 1\n6 4 4\n9 4 0\n3 2 4", "output": "100\n"}, {"input": "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\nEmuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet β€”...
[{"input": "10 23\n10 5 94\n6 9 20\n10 2 79\n3 9 63\n1 6 80\n7 8 21\n3 5 6\n3 1 94\n2 5 21\n1 2 100\n1 7 79\n6 10 59\n8 1 60\n10 3 37\n9 1 37\n4 8 40\n7 10 100\n6 4 41\n5 1 79\n8 10 79\n9 10 80\n10 4 60\n4 1 59\n", "output": "1\n1\n1\n0\n0\n1\n1\n1\n0\n0\n0\n0\n1\n1\n1\n0\n0\n0\n1\n0\n0\n1\n1\n"}, {"input": "10 20\n3 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\nKuriyama Mirai has killed many monsters and got many (namely n) stones. She numbers the stones from 1 to n. T...
[{"input": "56\n43 100 44 66 65 11 26 75 96 77 5 15 75 96 11 44 11 97 75 53 33 26 32 33 90 26 68 72 5 44 53 26 33 88 68 25 84 21 25 92 1 84 21 66 94 35 76 51 11 95 67 4 61 3 34 18\n27\n1 20 38\n1 11 46\n2 42 53\n1 8 11\n2 11 42\n2 35 39\n2 37 41\n1 48 51\n1 32 51\n1 36 40\n1 31 56\n1 18 38\n2 9 51\n1 7 48\n1 15 52\n1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn a public bath, there is a shower which emits water for T seconds when the switch is pushed.\n\nIf the swit...
[{"input": "4 1000000000\n0 1100 1000000 1000000000", "output": "2000000000\n"}, {"input": "4 1000000000\n0 1100 1000000 1010000000", "output": "2001000000\n"}, {"input": "4 1000010000\n0 1000 1000000 1000000000", "output": "2000010000\n"}, {"input": "4 1000000000\n0 1100 1100000 1010000000", "output": "2001100000\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\nThis kata requires you to convert minutes (`int`) to hours and minutes in the format `hh:mm` (`string`).\n\nI...
[{"input": "565757", "output": "[\"9429:17\"]", "fn_name": "time_convert"}, {"input": "134", "output": "[\"02:14\"]", "fn_name": "time_convert"}, {"input": "180", "output": "[\"03:00\"]", "fn_name": "time_convert"}, {"input": "970", "output": "[\"16:10\"]", "fn_name": "time_convert"}, {"input": "-6", "output": "[\"00:0...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is an undirected tree of $n$ vertices, connected by $n-1$ bidirectional edges. There is also a snake st...
[{"input": "4\n8 4 7\n1 2\n2 3\n1 4\n4 5\n4 6\n1 7\n7 8\n4 3 2\n4 3\n1 2\n2 3\n9 3 5\n1 2\n2 3\n3 4\n1 5\n5 6\n6 7\n1 8\n8 9\n16 15 12\n1 2\n2 3\n1 4\n4 5\n5 6\n6 7\n4 8\n10 9\n8 13\n10 11\n11 12\n11 13\n13 14\n10 15\n15 16\n", "output": "YES\nNO\nNO\nYES\n"}, {"input": "4\n8 4 7\n1 2\n2 3\n1 4\n4 5\n4 6\n1 7\n7 8\n4 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\nChef is good at making pancakes. Generally he gets requests to serve N pancakes at once.\nHe serves them in t...
[{"input": "2\n-1\n162", "output": "0\n688663125\n"}, {"input": "2\n-1\n199", "output": "0\n347692428\n"}, {"input": "2\n-1\n52", "output": "0\n756600466\n"}, {"input": "2\n-1\n87", "output": "0\n884560880\n"}, {"input": "2\n-1\n14", "output": "0\n190899322\n"}, {"input": "2\n1\n108", "output": "1\n842145354\n"}, {"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\nTo become the king of Codeforces, Kuroni has to solve the following problem.\n\nHe is given $n$ numbers $a_1,...
[{"input": "140 149\n124 109 136 123 83 121 53 37 111 105 75 224 99 87 51 45 131 83 18 76 99 29 115 96 16 89 88 69 81 100 120 90 141 48 83 97 26 27 51 94 53 25 32 27 4 139 81 140 137 95 94 89 116 32 85 155 68 12 107 10 124 96 110 32 135 126 2 146 79 14 132 136 110 16 130 98 109 191 2 18 52 27 134 74 101 84 13 133 12 38...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells a_{i} theorems ...
[{"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"}, {"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"}, {"input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 0 1 1 1 1 0 1\n", "output": "10008\n"}, {"input": "10 5\n1 2 1 1 1 1 1 1 10000 1\n1 1 1 0 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\nThe History of Magic is perhaps the most boring subject in the Hogwarts school of Witchcraft and Wizardry. Ha...
[{"input": "50\n1230\n6040\n1035\n1973\n9096\n5133\n1146\n1164\n9195\n5211\n6212\n1313\n1953\n1560\n1382\n2324\n1343\n1481\n1555\n1363\n1487\n1414\n1525\n1564\n1561\n9585\n7590\n1663\n5625\n1630\n1630\n3644\n1164\n1665\n7678\n1282\n1626\n1798\n9755\n7801\n8809\n1762\n1867\n1861\n1826\n1809\n8902\n1033\n1774\n9978\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\nToad Zitz has an array of integers, each integer is between $0$ and $m-1$ inclusive. The integers are $a_1, a...
[{"input": "100 1000\n980 755 745 448 424 691 210 545 942 979 555 783 425 942 495 741 487 514 752 434 187 874 372 617 414 505 659 445 81 397 243 986 441 587 31 350 831 801 194 103 723 166 108 182 252 846 328 905 639 690 738 638 986 340 559 626 572 808 442 410 179 549 880 153 449 99 434 945 163 687 173 797 999 274 975 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\nYou are given a multiset S. Over all pairs of subsets A and B, such that:\n\n * B βŠ‚ A; \n * |B| = |A| - 1; ...
[{"input": "30\n50791 243945320\n48702 457583014\n41675 229737141\n51903 823204069\n62672 982333456\n13022 6181002\n21220 952812271\n49208 751131975\n73341 457778516\n17236 855209229\n34474 293240200\n4702 655177190\n39507 367063302\n94513 894252033\n62219 507962042\n88877 952246542\n74469 527469163\n54023 724142796\n9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Cybernetics Failures (CF) organisation made a prototype of a bomb technician robot. To find the possible ...
[{"input": "15 17 8 9\nURRDLUULLDDDRRURR\n", "output": "1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 241\n"}, {"input": "15 17 8 9\nURRDLUULLDDDRRURR\n", "output": "1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 241 "}, {"input": "15 17 7 9\nURRDLUULLDDDRRURR\n", "output": "1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 241\n"}, {"input": "15 17 1 9\nURRD...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDaisy, being a good hacker as we all know, recently came across a file of the evil organization-Hydra which r...
[{"input": "206\nHa HaHaHaHa\nTheHandleCanBeVeryLong TheHandleCanBeVeryLong\nLong LongLong\nhFVvzbvASpRyHNXXoGHe NxjozJgpEPXrDJaBJmtjessBysMuMZzawDHEFqAQ\nUxuJUtGhPW yCqiAekNxXkzlPBTpBOy\nLDybFtrIbfBFfKBfxM LDybFtrIbfBFfKBfxMLDybFtrIbfBFfKBfxM\nwSoinsWghfObLqESjxBOJCW xwzBtBWANgrWaqdFjkRthQHdbblnTmELOqiFOPjAWRJSWu\nJAl...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour favorite music streaming platform has formed a perfectly balanced playlist exclusively for you. The play...
[{"input": "100\n7585 5510 1017 4329 2840 8171 5089 1873 7308 9656 6833 7578 4914 6658 4408 7122 5265 1204 9800 3150 2151 6906 6041 3973 931 7239 4421 4211 156 8655 4266 3543 9752 3117 2731 6052 8950 9391 6367 996 9973 629 9489 4912 9226 9301 5166 4889 3710 6794 618 9155 2462 1120 5499 5861 3177 9274 3036 666 8054 5789...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have to rebuild a string from an enumerated list.\nFor this task, you have to check if input is correct b...
[{"input": "[[\"a\", 0]]", "output": "[false]", "fn_name": "denumerate"}, {"input": "[[1, \"a\"]]", "output": "[false]", "fn_name": "denumerate"}, {"input": "[[0, \"\"]]", "output": "[false]", "fn_name": "denumerate"}, {"input": "\"a\"", "output": "[false]", "fn_name": "denumerate"}, {"input": "[0]", "output": "[false]...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAccording to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and s...
[{"input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 50 4 80 72 39\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\nproblem\n\nYou love pasta, and you make and eat pasta for dinner every day. You can make three types of pasta...
[{"input": "12 0\n1 3\n-1 1\n1 1", "output": "4576\n"}, {"input": "21 1\n2 2\n1 4\n10 2", "output": "2256\n"}, {"input": "18 2\n12 3\n1 1\n4 5", "output": "2568\n"}, {"input": "17 0\n1 3\n-2 1\n1 2", "output": "8560\n"}, {"input": "10 1\n3 2\n1 2\n4 3", "output": "9136\n"}, {"input": "13 3\n3 2\n1 2\n4 3", "output": "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\nThe life goes up and down, just like nice sequences. Sequence t_1, t_2, ..., t_{n} is called nice if the foll...
[{"input": "50\n11836 28308 72527 92281 139289 93797 134555 148444 40866 111317 21564 87813 65466 20541 99238 2287 74647 128071 18163 61672 39766 55589 138385 147443 138100 142683 60703 15444 52566 72976 147412 116006 115986 110545 79993 100440 9876 71470 75209 62443 64906 88987 72232 2246 63160 45041 729 148611 103397...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N towns on a line running east-west. The towns are numbered 1 through N, in order from west to east...
[{"input": "7 4 101\n20 172 33 4 146 156 146", "output": "-470\n"}, {"input": "7 2 100\n40 43 45 105 108 115 124", "output": "148\n"}, {"input": "7 2 101\n40 105 30 4 146 147 37", "output": "-218\n"}, {"input": "7 2 101\n20 174 30 4 146 147 37", "output": "-356\n"}, {"input": "7 2 101\n20 172 33 4 146 156 37", "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\nYou have n problems. You have estimated the difficulty of the i-th one as integer c_{i}. Now you want to prep...
[{"input": "15 4789415 23152928 140536\n502422 273992 449428 1752566 753047 681985 857134 243310 478052 77769 936151 642380 464695 281772 964693\n", "output": "15447\n"}, {"input": "15 4789415 22705612 140536\n502422 273992 449428 1752566 753047 681985 857134 243310 478052 77769 936151 642380 464695 281772 964693\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\nDescription\n\nF, who likes to dance, decided to practice a hardcore dance called JUMP STYLE at a certain dan...
[{"input": "1\n0 0\n2\n1 0 0 1\n0 0 0 0\n2\n1 1 0 1\n1 1 1 0\n3\n0 1 2 2 2 0\n0 2 1 2 2 1\n0 0 0 1 1 0\n4\n3 2 2 -1 3 2 0 1\n1 1 0 3 1 2 3 0\n1 3 1 3 3 0 2 2\n1 1 1 1 3 2 1 3\n0", "output": "1\n1\n1\n4\n1\n"}, {"input": "1\n0 0\n2\n1 0 0 1\n0 0 0 0\n2\n1 1 0 1\n1 1 1 0\n3\n0 1 2 2 2 2\n0 2 1 2 2 0\n0 0 0 1 1 0\n4\n3 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIahub likes trees very much. Recently he discovered an interesting tree named propagating tree. The tree cons...
[{"input": "10 10\n418 45 865 869 745 901 177 773 854 462\n4 8\n1 4\n3 6\n1 5\n1 10\n5 9\n1 2\n4 7\n1 3\n2 2\n1 6 246\n1 4 296\n1 2 378\n1 8 648\n2 6\n1 5 288\n1 6 981\n1 2 868\n2 7\n", "output": "45\n1147\n-119\n"}, {"input": "10 10\n418 45 865 869 745 901 177 773 854 462\n4 8\n1 4\n3 6\n1 5\n1 10\n5 9\n1 2\n4 7\n1 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\nIn the capital city of Berland, Bertown, demonstrations are against the recent election of the King of Berlan...
[{"input": "100 10\n9199\n89 409 428 408 309 400 259 393 212 273 472 654 533 774 663 484 695 801 587 518 521 578 767 644 532 785 500 944 582 680 899 882 589 601 614 633 877 543 770 614 852 715 932 627 639 658 765 957 898 545 977 751 740 869 885 831 834 702 934 954 500 626 605 921 755 661 707 952 842 978 979 879 837 581...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis contest is `CODE FESTIVAL`. However, Mr. Takahashi always writes it `CODEFESTIVAL`, omitting the single ...
[{"input": "ETAUDARGTSOP", "output": "ETAU DARGTSOP\n"}, {"input": "AACDEFGHIJKL", "output": "AACD EFGHIJKL\n"}, {"input": "COCEFESTIVAL", "output": "COCE FESTIVAL\n"}, {"input": "POSTGRADUATF", "output": "POST GRADUATF\n"}, {"input": "ALCDEFGHIJKA", "output": "ALCD EFGHIJKA\n"}, {"input": "COCEFESTIV@L", "output": "CO...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have N coins each of which has a value ai. Find the number of combinations that result when you choose K ...
[{"input": "5 4 7 19\n1 10 2 2 -1", "output": "4\n"}, {"input": "5 6 7 19\n1 10 2 2 -1", "output": "0\n"}, {"input": "5 4 13 19\n1 5 1 2 -1", "output": "0\n"}, {"input": "5 6 10 7\n1 10 2 2 -1", "output": "0\n"}, {"input": "5 3 13 19\n1 5 1 2 -1", "output": "0\n"}, {"input": "5 6 10 7\n0 10 2 2 -1", "output": "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\nHave you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single prob...
[{"input": "11 59 59 11 12\n", "output": "YES\n"}, {"input": "12 12 12 11 12\n", "output": "YES\n"}, {"input": "11 59 59 12 11\n", "output": "YES\n"}, {"input": "12 12 12 11 12\n", "output": "YES\n"}, {"input": "11 59 59 11 12\n", "output": "YES\n"}, {"input": "11 59 59 12 11\n", "output": "YES\n"}, {"input": "10 22 59...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectivel...
[{"input": "10\n2 0\n2 -1\n-1 -1\n1 20\n0 -1\n-18 -1\n1 -1\n1 1\n-5 -1\n4 0", "output": "399\n"}, {"input": "10\n2 0\n0 0\n-1 2\n-1 13\n-2 -26\n-11 -1\n2 -1\n0 1\n0 0\n0 4", "output": "161\n"}, {"input": "10\n2 -1\n0 0\n-1 2\n-1 13\n0 -26\n-16 -1\n4 -1\n0 1\n0 0\n0 4", "output": "257\n"}, {"input": "10\n1 -1\n0 0\n0 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\nThe protection of a popular program developed by one of IT City companies is organized the following way. Aft...
[{"input": "91537\n", "output": "27651\n"}, {"input": "13542\n", "output": "84443\n"}, {"input": "32036\n", "output": "82432\n"}, {"input": "71232\n", "output": "10151\n"}, {"input": "10000\n", "output": "00000\n"}, {"input": "70809\n", "output": "00000\n"}, {"input": "41675\n", "output": "61851\n"}, {"input": "99999\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\nSnuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th cre...
[{"input": "6\n65 3 38 -1 1 43", "output": "3\n"}, {"input": "6\n65 2 38 -1 1 43", "output": "3\n"}, {"input": "6\n65 3 38 -2 1 43", "output": "3\n"}, {"input": "6\n65 4 38 -1 1 43", "output": "3\n"}, {"input": "6\n40 1 26 2 7 20", "output": "4\n"}, {"input": "6\n40 1 26 2 9 20", "output": "4\n"}, {"input": "6\n40 1 21...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis time the Berland Team Olympiad in Informatics is held in a remote city that can only be reached by one s...
[{"input": "10 5 1000000000\n1 1 1 2 2 1 2 2 2 2\n", "output": "10000000000\n"}, {"input": "10 5 1000000000\n1 1 1 2 2 1 2 2 3 2\n", "output": "10000000000\n"}, {"input": "10 5 1000000000\n1 1 1 2 0 1 2 2 3 2\n", "output": "10000000000\n"}, {"input": "1 1000000000 1000000000\n100000\n", "output": "0\n"}, {"input": "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\nIn the Kingdom of AtCoder, people use a language called Taknese, which uses lowercase English letters.\nIn Ta...
[{"input": "upruskhsmeicaqqesyyvopepmvdosibrvqoghdeikbpqbfgrufxdsqchjkuxpxngebxrmqdgqjsosencrbwknllvucvubyozfmttxtlsrrnrqavshaszrenhlbzpnpjgqftvwgukjwsekfcgllbzlnvmosmvqubtwsgltvmmzmslqdxqiifzkaqhsxzguseuexlycgubhdnwhrssyiybitcoowlhmmrdpgtrdwalvffknwibhwhacqfjcmwupoxonavvxwsvprpymskznabsquwssucxrmywerfpziqdziycnynthgmd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n stones on the table in a row, each of them can be red, green or blue. Count the minimum number of...
[{"input": "50\nGRBGGRBRGRBGGBBBBBGGGBBBBRBRGBRRBRGBBBRBBRRGBGGGRB\n", "output": "18\n"}, {"input": "50\nRBGGBGGRBGRBBBGBBGRBBBGGGRBBBGBBBGRGGBGGBRBGBGRRGG\n", "output": "17\n"}, {"input": "50\nGGGBBRGGGGGRRGGRBGGRGBBRBRRBGRGBBBGBRBGRGBBGRGGBRB\n", "output": "16\n"}, {"input": "50\nGBGRGRRBRRRRRGGBBGBRRRBBBRBBBRRGRBBRG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA boy Valera registered on site Codeforces as Valera, and wrote his first Codeforces Round #300. He boasted t...
[{"input": "230 125 175 124 1 1\n", "output": "YES\n"}, {"input": "230 125 221 124 1 1\n", "output": "YES\n"}, {"input": "230 195 221 124 1 1\n", "output": "YES\n"}, {"input": "375 6 133 267 19 36\n", "output": "NO\n"}, {"input": "363 2 280 239 5 231\n", "output": "NO\n"}, {"input": "223 92 123 118 1 1\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\nIn this task Anna and Maria play a game with a very unpleasant rival. Anna and Maria are in the opposite squa...
[{"input": "S......A\n.SS..S..\nS....S..\nSSS...S.\n.SS.STS.\n.S.SS...\n..S..S..\nM.SS....\n", "output": "LOSE\n"}, {"input": "SSSSSSSA\n......S.\n/.....S.\n.....SS.\n....SS..\n...SS...\n..SS....\nMSS.....\n", "output": "LOSE\n"}, {"input": "S..SSSSA\n.S..S...\nS.S....S\n.S.S..SS\nSSSS.S..\n.SS..SS.\n....SS..\nMS..S......
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBob has a string $s$ consisting of lowercase English letters. He defines $s'$ to be the string after removing...
[{"input": "keumiataaaaaznatbaawaaahebaaftaakaammcaeaihadapagaaaabaaacaxaaauaahwlydqnacamhpitahaamamaazaiohaaaaakeumitzntbwhebftkmmceihdpgbcxuhwlydqncmhpithmmzioh\n", "output": "keumiataaaaaznatbaawaaahebaaftaakaammcaeaihadapagaaaabaaacaxaaauaahwlydqnacamhpitahaamamaazaiohaaaaa\n"}, {"input": "aeaaaaravazyzaadwaarzajaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a sequence of items and a specific item in that sequence, return the item immediately following the ite...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8]\n3", "output": "[4]", "fn_name": "next_item"}, {"input": "[\"a\", \"b\", \"c\"]\n\"d\"", "output": "[null]", "fn_name": "next_item"}, {"input": "[\"a\", \"b\", \"c\"]\n\"c\"", "output": "[null]", "fn_name": "next_item"}, {"input": "\"testing\"\n\"t\"", "output": "[\"e\"]", "fn_name"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe will play a one-player game using a number line and N pieces.\nFirst, we place each of these pieces at som...
[{"input": "2060 10101\n-28299 -22999 -45034 -52144 -38874 -24054 -31154 -41529 -19634 -44464 -39214 -24864 -14084 -47669 -34229 -25844 -19579 -10739 -54349 -12634 -55214 -37604 -45514 -52584 -41274 -55634 -23024 -42104 -54549 -44704 -11454 -28559 -9914 -50144 -41269 -30224 -39509 -14994 -33229 -35339 -49969 -12744 -39...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Berland Armed Forces System consists of n ranks that are numbered using natural numbers from 1 to n, wher...
[{"input": "100\n63 65 21 41 95 23 3 4 12 23 95 50 75 63 58 34 71 27 75 31 23 94 96 74 69 34 43 25 25 55 44 19 43 86 68 17 52 65 36 29 72 96 84 25 84 23 71 54 6 7 71 7 21 100 99 58 93 35 62 47 36 70 68 9 75 13 35 70 76 36 62 22 52 51 2 87 66 41 54 35 78 62 30 35 65 44 74 93 78 37 96 70 26 32 71 27 85 85 63\n43 92\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\nYou will have a list of rationals in the form\n\n```\nlst = [ [numer_1, denom_1] , ... , [numer_n, denom_n] ]...
[{"input": "[[81345, 15786], [87546, 11111111], [43216, 255689]]", "output": "[[79677895891146625, 14949283383840498]]", "fn_name": "sum_fracts"}, {"input": "[[6, 13], [187, 1310], [31, 41]]", "output": "[[949861, 698230]]", "fn_name": "sum_fracts"}, {"input": "[[77, 130], [84, 131], [60, 80]]", "output": "[[67559, 340...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBear Limak has n colored balls, arranged in one long row. Balls are numbered 1 through n, from left to right....
[{"input": "150\n28 124 138 71 71 18 78 136 138 93 145 93 18 15 71 47 47 64 18 72 138 72 18 150 7 71 109 149 18 115 149 149 15 78 124 27 72 124 28 108 138 109 108 111 148 138 78 27 28 150 138 65 15 145 109 47 102 62 28 7 115 108 102 149 150 27 111 64 149 124 13 21 108 64 7 15 72 72 124 47 102 28 109 18 124 28 111 138 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\nLittle Paul wants to learn how to play piano. He already has a melody he wants to start with. For simplicity ...
[{"input": "100\n5 5 2 4 5 4 4 4 4 2 5 3 4 2 4 4 1 1 5 3 2 2 1 3 3 2 5 3 4 5 1 3 5 4 4 4 3 1 4 4 3 4 5 2 5 4 2 1 2 2 3 5 5 5 1 4 5 3 1 4 2 2 5 1 5 3 4 1 5 1 2 2 3 5 1 3 2 4 2 4 2 2 4 1 3 5 2 2 2 3 3 4 3 2 2 5 5 4 2 5\n", "output": "1 2 1 2 3 1 2 1 2 1 2 1 2 1 2 3 2 1 3 2 1 2 1 3 2 1 2 1 2 3 1 2 3 2 1 3 2 1 3 2 1 2 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\nA sequence of non-negative integers a_1, a_2, ..., a_{n} of length n is called a wool sequence if and only if...
[{"input": "100000 100000\n", "output": "738698541\n"}, {"input": "100000 100000\n", "output": "738698541\n"}, {"input": "100010 100000\n", "output": "917914137\n"}, {"input": "50000 100000\n", "output": "821709120\n"}, {"input": "50000 100000\n", "output": "821709120\n"}, {"input": "60282 92611\n", "output": "81490807...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEmuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-build...
[{"input": "6\n1\n2\n3\n170\n179\n25\n", "output": "NO\nNO\nNO\nYES\nYES\nNO\n"}, {"input": "6\n1\n2\n3\n170\n179\n25\n", "output": "NO\nNO\nNO\nYES\nYES\nNO\n"}, {"input": "6\n1\n2\n3\n107\n179\n25\n", "output": "NO\nNO\nNO\nNO\nYES\nNO\n"}, {"input": "6\n2\n2\n3\n107\n179\n25\n", "output": "NO\nNO\nNO\nNO\nYES\nNO\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\nThe final match of the Berland Football Cup has been held recently. The referee has shown $n$ yellow cards th...
[{"input": "1000\n1000\n1000\n1000\n1999999\n", "output": "1999 1999\n"}, {"input": "1000\n1000\n1000\n1000\n2000000\n", "output": "2000 2000\n"}, {"input": "1000\n1000\n1000\n1000\n2000000\n", "output": "2000 2000\n"}, {"input": "1000\n1000\n1000\n1000\n1999999\n", "output": "1999 1999\n"}, {"input": "1000\n1000\n1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section d...
[{"input": "\\/_/\\_/\\\\_/\\\\__///\\\\/_/\\\\\\\\/\\/_\\/\\/\\\\", "output": "32\n8 1 2 20 5 1 1 1 1\n"}, {"input": "\\/_/\\_/\\\\_/\\\\__///\\\\/_/\\[\\\\0\\/_\\/\\/\\\\", "output": "31\n7 1 2 20 5 1 1 1\n"}, {"input": "\\/_/\\_/\\\\_/\\\\__///\\\\/_0\\[\\\\0\\/_\\/\\/\\\\", "output": "27\n7 1 2 20 1 1 1 1\n"}, {"in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou will be given a string and you task is to check if it is possible to convert that string into a palindrom...
[{"input": "\"abbcdedba\"", "output": "[\"not possible\"]", "fn_name": "solve"}, {"input": "\"raydarm\"", "output": "[\"not possible\"]", "fn_name": "solve"}, {"input": "\"abbaab\"", "output": "[\"not possible\"]", "fn_name": "solve"}, {"input": "\"abededba\"", "output": "[\"remove one\"]", "fn_name": "solve"}, {"input...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nN players will participate in a tennis tournament. We will call them Player 1, Player 2, \\ldots, Player N.\n...
[{"input": "171\n158 2 11 40 53 51 26 89 135 78 167 25 123 157 100 152 72 35 39 126 124 119 68 105 162 150 84 82 59 109 28 70 34 110 85 136 57 145 134 47 99 20 83 95 154 98 73 138 48 29 120 116 66 58 96 18 102 24 153 127 125 61 32 129 16 131 50 46 10 113 91 75 13 86 65 45 146 133 122 103 128 93 77 5 63 3 118 164 147 16...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis problem's actual name, \"Lexicographically Largest Palindromic Subsequence\" is too long to fit into the...
[{"input": "zzzzzzzzzz\n", "output": "zzzzzzzzzz\n"}, {"input": "aaaaaaaaaa\n", "output": "aaaaaaaaaa\n"}, {"input": "zzzzzzzazz\n", "output": "zzzzzzzzz\n"}, {"input": "abbbbbbbbb\n", "output": "bbbbbbbbb\n"}, {"input": "zzzzzzzzzy\n", "output": "zzzzzzzzz\n"}, {"input": "zzazzzzzzz\n", "output": "zzzzzzzzz\n"}, {"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\nTsumugi brought $n$ delicious sweets to the Light Music Club. They are numbered from $1$ to $n$, where the $i...
[{"input": "37 13\n164823 8992 21818 77521 130870 83201 174985 168799 9565 84443 105083 54131 130813 42829 98759 60103 198520 125068 59611 45609 124003 106143 54167 179002 103755 152802 146640 74767 91309 11941 131534 32533 67324 27272 49166 129157 41630\n", "output": "8992 18557 30498 52316 79588 112121 153751 196580 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAtCoDeer the deer and his friend TopCoDeer is playing a game.\nThe game consists of N turns.\nIn each turn, e...
[{"input": "ggppgggpgg\n", "output": "2\n"}, {"input": "ggpgggppgg", "output": "2\n"}, {"input": "ggggggpppg", "output": "2\n"}, {"input": "ggppgpgggg", "output": "2\n"}, {"input": "ggppggpggg", "output": "2\n"}, {"input": "gggpggppgg", "output": "2\n"}, {"input": "gggggpppgg", "output": "2\n"}, {"input": "pggpggpggg",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Unfinished Loop - Bug Fixing #1\n\nOh no, Timmy's created an infinite loop! Help Timmy find and fix the b...
[{"input": "10", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]", "fn_name": "create_array"}, {"input": "9", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9]]", "fn_name": "create_array"}, {"input": "8", "output": "[[1, 2, 3, 4, 5, 6, 7, 8]]", "fn_name": "create_array"}, {"input": "7", "output": "[[1, 2, 3, 4, 5, 6, 7]]", "fn_nam...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHaiku is a genre of Japanese traditional poetry.\n\nA haiku poem consists of 17 syllables split into three ph...
[{"input": "aaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\naaaaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\naaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\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\nTwo bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, a...
[{"input": "10\n9 8 7 6 2 3 5 4 10 1\n1 9\n", "output": "103 1\n"}, {"input": "10\n1 10\n9 5 7 6 1 2 3 9 8 4\n", "output": "105 1\n"}, {"input": "10\n9 8 7 6 2 3 5 4 9 1\n1 10\n", "output": "105 2\n"}, {"input": "10\n9 8 7 6 2 3 5 4 9 1\n1 10\n", "output": "105 2"}, {"input": "10\n1 10\n9 5 7 6 1 2 3 9 8 4\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\nn soldiers stand in a circle. For each soldier his height ai is known. A reconnaissance unit can be made of s...
[{"input": "88\n1000 1000 1000 1000 1000 998 998 1000 1000 1000 1000 999 999 1000 1000 1000 999 1000 997 999 997 1000 999 998 1000 999 1000 1000 1000 999 1000 999 999 1000 1000 999 1000 999 1000 1000 998 1000 1000 1000 998 998 1000 1000 999 1000 1000 1000 1000 1000 1000 1000 998 1000 1000 1000 999 1000 1000 999 1000 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nβ€” Thanks a lot for today.\n\nβ€” I experienced so many great things.\n\nβ€” You gave me memories like dreams... B...
[{"input": "100000 1000000000\n", "output": "495495496\n"}, {"input": "100000 1000000000\n", "output": "495495496\n"}, {"input": "91454 1017443433\n", "output": "794092041\n"}, {"input": "42147 412393322\n", "output": "251637727\n"}, {"input": "77809 868097296\n", "output": "440411873\n"}, {"input": "75615 376679484\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\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string ...
[{"input": "TTTTTTTTTT\n", "output": "10\n"}, {"input": "BBBBBBBBBB\n", "output": "0\n"}, {"input": "GACGCTCCAV\n", "output": "9\n"}, {"input": "CTTAHTGACT\n", "output": "5\n"}, {"input": "TGMJCTTDAA\n", "output": "3\n"}, {"input": "ABTTGTTTC\n", "output": "7\n"}, {"input": "HATAGAYA\n", "output": "5\n"}, {"input": "SH...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elem...
[{"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 1000 1000 1000 1000 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\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a pa...
[{"input": "575\n", "output": "Yes\n"}, {"input": "999\n", "output": "Yes\n"}, {"input": "171\n", "output": "Yes\n"}, {"input": "123\n", "output": "No\n"}, {"input": "812\n", "output": "No\n"}, {"input": "100\n", "output": "No\n"}, {"input": "521\n", "output": "No\n"}, {"input": "974\n", "output": "No\n"}, {"input": "2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPasha loves his phone and also putting his hair up... But the hair is now irrelevant.\n\nPasha has installed ...
[{"input": "928 467 10\n37 45\n47 278\n17 467\n158 66\n483 198\n83 123\n285 219\n513 187\n380 107\n304 352\n", "output": "0\n"}, {"input": "518 518 10\n37 97\n47 278\n17 467\n158 66\n483 351\n83 123\n285 219\n513 187\n380 75\n304 352\n", "output": "0\n"}, {"input": "518 518 10\n37 97\n38 278\n17 467\n158 66\n483 351\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\nYou are given a string $s$, consisting only of characters '0' or '1'. Let $|s|$ be the length of $s$.\n\nYou ...
[{"input": "1\n0000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100\n", "output": "NO\n"}, {"input": "1\n0000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100\n", "output": "NO\n"}, {"input": "1\n00000111111111111111111111111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA taxi driver, Nakamura, was so delighted because he got a passenger who wanted to go to a city thousands of ...
[{"input": "6 3 41\nTokyo Kyoto\nTokyo Niigata 335\nTokyo Shizuoka 174\nShizuoka Nagoya 176\nNagoya Kyoto 195\nToyama Niigata 215\nToyama Kyoto 296\nNagoya\nNiigata\nToyama\n6 3 30\nTokyo Kyoto\nTokyo Niigata 335\nTokyo Shizuoka 174\nShizuoka Nagoya 176\nNagoya Kyoto 195\nToyama Niigata 215\nToyama Kyoto 296\nNagoya\nN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMr. Simpson got up with a slight feeling of tiredness. It was the start of another day of hard work. A bunch ...
[{"input": "a+b+c\n(a+b)+c\na- (b-c)+2\n.\n4ab\n(a - b) (0-b+a) - 1a ^ 2 - b ^ 3\n2 b 2 a\n.\n108 a\n2 2 3 3 3 a\n4 a^1 27\n.\n.", "output": "yes\nno\n.\nno\nyes\n.\nyes\nyes\n.\n"}, {"input": "a+b+c\n(a+b)+c\na- (b-c)+2\n.\n4ab\n(a - b) (0-b+a) - 1a ^ 4 - b ^ 3\n2 b 2 a\n.\n108 a\n2 2 3 3 3 a\n4 a^1 27\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\nRead problems statements in Mandarin Chinese and Russian as well. \n\nThere are 100 houses located on a strai...
[{"input": "3\n4 7 8\n12 52 56 8\n2 10 2\n21 75\n2 5 8\n10 49", "output": "0\n18\n11\n"}, {"input": "3\n4 7 3\n3 52 56 8\n2 10 2\n21 75\n2 5 8\n10 49", "output": "24\n18\n11\n"}, {"input": "3\n4 7 8\n19 52 56 8\n2 20 2\n21 34\n2 5 8\n10 29", "output": "0\n26\n31\n"}, {"input": "3\n4 7 8\n7 87 96 8\n2 11 2\n66 75\n2 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\nThe purpose of this problem is to verify whether the method you are using to read input data is sufficiently ...
[{"input": "7 2\n1\n106\n966369\n10\n12\n40177\n11", "output": "3\n"}, {"input": "7 4\n1\n106\n966369\n10\n12\n40177\n11", "output": "1\n"}, {"input": "7 4\n1\n106\n966369\n10\n18\n40177\n11", "output": "0\n"}, {"input": "7 2\n1\n62\n334284\n16\n12\n40177\n12", "output": "5\n"}, {"input": "7 2\n1\n62\n966369\n10\n12\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\nThere are N points in a D-dimensional space.\nThe coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{...
[{"input": "10 10\n8 -14 -14 -20 18 -1 -3 18 -1 10\n-9 2 4 -13 13 5 14 -9 20 -18\n-19 -19 -19 20 -3 20 -2 -18 -7 -11\n5 7 3 -11 12 -9 -10 10 20 -19\n-12 -8 -20 -13 12 13 17 17 -6 0\n-4 -14 -15 -15 18 19 -8 -1 -20 -2\n-7 11 -10 -16 3 -5 -12 15 6 -2\n12 18 -3 -15 -20 17 9 9 10 -10\n10 -2 9 -16 2 17 15 -16 -2 -12\n16 -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\nA palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forw...
[{"input": "\"ACCDDCCA\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "\"1551\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "-4505", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "22.22", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "12...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLuntik has decided to try singing. He has $a$ one-minute songs, $b$ two-minute songs and $c$ three-minute son...
[{"input": "4\n2 4 1\n4 2 0\n10 4 5\n1 1 2\n", "output": "1\n0\n1\n1\n"}, {"input": "4\n2 2 0\n4 2 0\n10 4 5\n1 1 2\n", "output": "0\n0\n1\n1\n"}, {"input": "4\n2 4 0\n4 2 0\n10 4 5\n1 1 2\n", "output": "0\n0\n1\n1\n"}, {"input": "4\n2 4 1\n4 2 0\n10 4 3\n1 1 2\n", "output": "1\n0\n1\n1\n"}, {"input": "4\n2 4 1\n7 2 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\n###Instructions\n\nA time period starting from ```'hh:mm'``` lasting until ```'hh:mm'``` is stored in an arra...
[{"input": "[[\"12:00\", \"10:01\"], [\"06:31\", \"14:23\"], [\"03:02\", \"07:58\"], [\"08:13\", \"10:05\"], [\"18:37\", \"04:22\"], [\"12:58\", \"14:28\"], [\"01:51\", \"14:40\"], [\"04:27\", \"01:00\"], [\"22:56\", \"23:33\"], [\"19:23\", \"07:00\"], [\"02:13\", \"16:14\"], [\"10:40\", \"02:36\"], [\"11:49\", \"00:10...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlicia has an array, $a_1, a_2, \\ldots, a_n$, of non-negative integers. For each $1 \\leq i \\leq n$, she ha...
[{"input": "35\n15 13 -25 -7 -18 -16 4 -15 2 -23 0 -3 -26 -27 -24 -27 -22 1 -52 -19 -16 -15 -29 -43 -18 -27 -11 -20 -2 -11 -20 -30 -1 -13 -46\n", "output": "15 28 3 21 10 12 32 17 34 11 34 31 8 7 10 7 12 35 -17 16 19 20 6 -8 17 8 24 15 33 24 15 5 34 22 -11 "}, {"input": "35\n15 13 -25 -7 -18 -16 4 -15 2 -23 0 -3 -26 -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\nLet p (i) be the i-th prime number from the smallest. For example, 7 is the fourth prime number from the smal...
[{"input": "2\n219\n0", "output": "5\n136114\n"}, {"input": "2\n279\n0", "output": "5\n231208\n"}, {"input": "2\n195\n0", "output": "5\n105540\n"}, {"input": "2\n199\n0", "output": "5\n110364\n"}, {"input": "2\n233\n0", "output": "5\n156108\n"}, {"input": "2\n264\n0", "output": "5\n204989\n"}, {"input": "2\n361\n0", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Petya loves counting. He wants to count the number of ways to paint a rectangular checkered board of s...
[{"input": "1000 1000 1000000\n", "output": " 396597934\n"}, {"input": "182 314 814124\n", "output": " 753768028\n"}, {"input": "892 996 619800\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\nThere are 32 letters in the Polish alphabet: 9 vowels and 23 consonants. \n \nYour task is to change the lett...
[{"input": "\"W\\u00f3\\u0142 go pyta: 'Panie chrz\\u0105szczu,Po co pan tak brz\\u0119czy w g\\u0105szczu?'\"", "output": "[\"Wol go pyta: 'Panie chrzaszczu,Po co pan tak brzeczy w gaszczu?'\"]", "fn_name": "correct_polish_letters"}, {"input": "\"Za\\u017c\\u00f3\\u0142\\u0107 g\\u0119\\u015bl\\u0105 ja\\u017a\\u0144\...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA bracketed sequence is called correct (regular) if by inserting \"+\" and \"1\" you can get a well-formed ma...
[{"input": "101\n(())))))()))()())(()))((())))((())(()()()(()()((()()((()((())))((()))()(())(()(())((()))(()))()(((()(\n", "output": "-1\n"}, {"input": "100\n)()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(\n", "output": "100\n"}, {"input": "101\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\nDaniel has a string s, consisting of lowercase English letters and period signs (characters '.'). Let's defin...
[{"input": "2 7\nab\n1 w\n2 w\n1 c\n2 .\n2 .\n1 .\n2 b\n", "output": "0\n0\n0\n0\n0\n1\n0\n"}, {"input": "2 7\nab\n1 w\n2 w\n1 c\n2 .\n2 .\n1 .\n2 b\n", "output": "0\n0\n0\n0\n0\n1\n0\n"}, {"input": "2 7\nab\n2 w\n2 w\n1 c\n2 .\n2 .\n1 .\n2 b\n", "output": "0\n0\n0\n0\n0\n1\n0\n"}, {"input": "2 7\nab\n2 w\n2 w\n1 c\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYakko, Wakko and Dot, world-famous animaniacs, decided to rest from acting in cartoons, and take a leave to t...
[{"input": "-16 2\n", "output": "5/6\n"}, {"input": "-16 3\n", "output": "2/3\n"}, {"input": "-12 2\n", "output": "5/6\n"}, {"input": "3 -12\n", "output": "2/3\n"}, {"input": "-12 3\n", "output": "2/3\n"}, {"input": "-17 5\n", "output": "1/3\n"}, {"input": "-1 3\n", "output": "2/3\n"}, {"input": "2 -1\n", "output": "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\nGreg has an array a = a_1, a_2, ..., a_{n} and m operations. Each operation looks as: l_{i}, r_{i}, d_{i}, (1...
[{"input": "4 3 6\n2 2 3 4\n1 2 2\n2 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 22 31 20\n"}, {"input": "4 3 6\n2 2 3 4\n1 2 2\n3 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 10 31 20\n"}, {"input": "4 3 6\n2 2 3 4\n1 2 2\n2 3 4\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 34 43 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string $s$ consisting of $n$ lowercase Latin letters. Polycarp wants to remove exactly $k$ ch...
[{"input": "26 1\nabcdefghijklmnopqrstuvwxyz\n", "output": "bcdefghijklmnopqrstuvwxyz\n"}, {"input": "26 1\nabcdefghijklmnopqrsuuvwxyz\n", "output": "bcdefghijklmnopqrsuuvwxyz\n"}, {"input": "26 2\nabcdefghijklmnopqrstuvwxyz\n", "output": "cdefghijklmnopqrstuvwxyz\n"}, {"input": "26 3\nabcdefghijklmnopqrstuvwxyz\n", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of positive integers a1, a2, ..., an Γ— T of length n Γ— T. We know that for any i > n i...
[{"input": "100 10000000\n300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 30...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAfter finding and moving to the new planet that supports human life, discussions started on which currency sh...
[{"input": "10\n1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000001\n1000000000 999999999\n", "output": "999999999\n"}, {"input": "10\n1 10 100 1000 10000 100000 1000000 11000000 100000000 1000000001\n1000000000 999999999\n", "output": "999999999\n"}, {"input": "10\n1 5 100 1000 10000 100000 1000000 100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou and your n - 1 friends have found an array of integers a_1, a_2, ..., a_n. You have decided to share it i...
[{"input": "4\n6 4 2\n3 9 2 3 8 4\n4 3 1\n1 13 60 4\n4 1 3\n1 0 2 1\n2 2 2\n1 2\n", "output": "8\n60\n1\n2\n"}, {"input": "4\n6 4 2\n2 7 4 5 8 7\n4 4 1\n8 13 111 4\n4 1 2\n1 2 2 1\n2 2 1\n2 3\n", "output": "7\n8\n1\n3\n"}, {"input": "4\n6 4 2\n2 7 4 5 1 7\n4 4 1\n8 13 111 4\n4 1 2\n1 2 2 1\n2 2 1\n2 3\n", "output": "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\nThe only difference between the easy and the hard version is the constraint on $n$.\n\nYou are given an undir...
[{"input": "1337\n", "output": "520628749\n"}, {"input": "1000\n", "output": "756980810\n"}, {"input": "3000\n", "output": "596853783\n"}, {"input": "4500\n", "output": "299551211\n"}, {"input": "100\n", "output": "878752271\n"}, {"input": "5000\n", "output": "37327598\n"}, {"input": "500\n", "output": "39656147\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\nThe winter in Berland lasts n days. For each day we know the forecast for the average air temperature that da...
[{"input": "100 50\n-7 -3 9 2 16 -19 0 -10 3 -11 17 7 -7 -10 -14 -14 -7 -15 -15 -8 8 -18 -17 -5 -19 -15 -14 0 8 -3 -19 -13 -3 11 -3 -16 16 -16 -12 -2 -17 7 -16 -14 -10 0 -10 -18 -16 -11 -2 -12 -15 -8 -1 -11 -3 -17 -14 -6 -9 -15 -14 -11 -20 -20 -4 -20 -14 -2 0 -2 -20 17 -17 2 0 1 2 6 -5 -13 -16 -5 -11 0 16 -16 -4 -18 -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\nThe number `1035` is the smallest integer that exhibits a non frequent property: one its multiples, `3105 = 1...
[{"input": "10000\n7", "output": "[1]", "fn_name": "search_permMult"}, {"input": "10000\n4", "output": "[2]", "fn_name": "search_permMult"}, {"input": "10000\n3", "output": "[2]", "fn_name": "search_permMult"}, {"input": "5000\n7", "output": "[0]", "fn_name": "search_permMult"}, {"input": "8000\n4", "output": "[1]", "f...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \\ldo...
[{"input": "20\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50\n", "output": "1950\n"}, {"input": "20\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20\n22 9 21 42 22 12 39 41 37 11 35 19 43 38 3...
code_stdio