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\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b. Here, he will get sad if ...
[{"input": "9\n1 -4 4 -6 -16 1 1 24 -1", "output": "59\n"}, {"input": "9\n0 -1 -7 2 -1 0 -1 6 -3", "output": "28\n"}, {"input": "9\n0 -1 -7 2 -1 0 -1 6 -2", "output": "27\n"}, {"input": "9\n2 0 5 -2 -2 1 -2 10 -7", "output": "41\n"}, {"input": "9\n1 -4 4 -4 -4 1 0 18 -1", "output": "40\n"}, {"input": "9\n1 -4 4 -4 -8 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\nStephen Queen wants to write a story. He is a very unusual writer, he uses only letters 'a', 'b', 'c', 'd' an...
[{"input": "6\n3\nbac\naaada\ne\n3\naba\nabcde\naba\n2\nbaba\nbaba\n4\nab\nab\nc\nbc\n5\ncbdca\nd\na\nd\ne\n3\nb\nc\nca\n", "output": "3\n2\n0\n2\n3\n2\n"}, {"input": "6\n3\nbac\naaada\ne\n3\naba\nabcde\naba\n2\nbaba\nbaba\n4\nba\nab\nc\nbc\n5\ncbdca\nd\na\nd\ne\n3\nb\nc\nca\n", "output": "3\n2\n0\n2\n3\n2\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\n#### Task:\n\nYour job here is to implement a method, `approx_root` in Ruby/Python/Crystal and `approxRoot` i...
[{"input": "401", "output": "[20.02]", "fn_name": "approx_root"}, {"input": "120", "output": "[10.95]", "fn_name": "approx_root"}, {"input": "106", "output": "[10.29]", "fn_name": "approx_root"}, {"input": "111", "output": "[10.52]", "fn_name": "approx_root"}, {"input": "168", "output": "[12.96]", "fn_name": "approx_ro...
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\nKevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the ...
[{"input": "93\n010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010\n", "output": "93\n"}, {"input": "93\n010101010101010101010101010101010101010101010101010101010101010101010101011101010101010101010\n", "output": "93\n"}, {"input": "93\n0101010101010101010101010101010101010101...
code_stdio
[ { "content": "You are an expert Python programmer. 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 connected undirected weighted graph consisting of $n$ vertices and $m$ edges.\n\nYou need to ...
[{"input": "28 27 378\n1 2 1000000000\n2 3 1000000000\n3 4 1000000000\n4 5 1000000000\n5 6 1000000000\n6 7 1000000000\n7 8 1000000000\n8 9 1000000000\n9 10 1000000000\n10 11 1000000000\n11 12 1000000000\n12 13 1000000000\n13 14 1000000000\n14 15 1000000000\n15 16 1000000000\n16 17 1000000000\n17 18 1000000000\n18 19 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\nKaren has just arrived at school, and she has a math test today!\n\n<image>\n\nThe test is about basic additi...
[{"input": "19\n716981305 764655030 1148561420 914539062 853464027 317088317 653721289 239862203 605157354 943428394 261437390 821695238 312192823 432992892 547139308 121208111 1614663126 223751525 1084180198\n", "output": "399181927\n"}, {"input": "19\n469776209 764655030 1148561420 914539062 853464027 317088317 65372...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are wi...
[{"input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\n1 5 1000000000\n1 8 1000000000\n2 15 1000000000\n3 3 1000000000\n3 10 1000000000\n3 6 1000000000\n3 7 1000000000\n", "output": "0\n3\n2\n2\n"}, {"input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\n1 5 1000000000\n1 8 1000000000\n2 15 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\nMoscow is hosting a major international conference, which is attended by n scientists from different countrie...
[{"input": "20\n2 2 1 6 6 5 10 3 5 4 4 8 6 8 8 10 2 1 5 6\n20\n1 9 1 1 5 1 9 10 1 10 9 9 8 7 5 1 1 10 2 7\n5 5 9 2 10 8 2 16 6 7 8 8 6 5 3 4 6 3 7 4\n", "output": "13\n"}, {"input": "20\n2 2 1 6 6 5 10 3 5 4 4 8 6 8 8 10 2 1 5 6\n20\n1 9 1 1 5 1 9 10 1 10 9 9 8 7 5 1 1 10 2 7\n5 5 9 2 10 8 2 16 5 7 8 8 6 5 3 4 6 3 7 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\nProblem\n\nAlice and Bob are competing in the 50m dash.\nHowever, in this world, the higher the AOJ rate is, ...
[{"input": "2 11 1010 1000", "output": "Alice\n"}, {"input": "2 11 1011 1000", "output": "Alice\n"}, {"input": "3 11 1011 1000", "output": "Alice\n"}, {"input": "3 11 1011 1001", "output": "Alice\n"}, {"input": "3 16 1001 0110", "output": "Alice\n"}, {"input": "3 11 1011 1011", "output": "Draw\n"}, {"input": "4 9 1001 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 has two positive integers A and B.\n\nIt is known that A plus B equals N. Find the minimum possible...
[{"input": "100000", "output": "10"}, {"input": "1697", "output": "23\n"}, {"input": "199", "output": "19\n"}, {"input": "178", "output": "16\n"}, {"input": "389", "output": "20\n"}, {"input": "499", "output": "22\n"}, {"input": "789", "output": "24\n"}, {"input": "795", "output": "21\n"}, {"input": "989", "output": "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\nRead problems statements in Mandarin Chinese and Russian as well. \n\n\tA version control system(VCS) is a re...
[{"input": "2\n19 4 6\n1 4 6 7\n1 2 3 4 6 8\n12 2 2\n1 4\n1 4", "output": "3 12\n2 10\n"}, {"input": "2\n19 4 6\n1 4 6 7\n1 2 3 4 6 7\n12 2 2\n1 4\n1 4", "output": "4 13\n2 10\n"}, {"input": "2\n17 4 6\n1 3 6 11\n1 2 3 5 6 7\n5 2 2\n2 4\n3 4", "output": "3 10\n1 2\n"}, {"input": "2\n21 4 6\n2 3 6 14\n1 2 3 4 6 9\n4 2 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\nYou are given a huge decimal number consisting of $n$ digits. It is guaranteed that this number has no leadin...
[{"input": "213 5 3\n111001111110111001101011111100010010011001000001111010110110011000100000101010111110010001111110001010011001101000000011111110101001101100100100110100000111111100010100011010010001011100111011000001110000111000101\n", "output": "3\n"}, {"input": "213 5 3\n1110011111101110011010111111000100100110010...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMaya writes weekly articles to a well known magazine, but she is missing one word each time she is about to s...
[{"input": "103247", "output": "[\"boiled\"]", "fn_name": "hidden"}, {"input": "942547", "output": "[\"melted\"]", "fn_name": "hidden"}, {"input": "49632", "output": "[\"email\"]", "fn_name": "hidden"}, {"input": "12674", "output": "[\"blade\"]", "fn_name": "hidden"}, {"input": "56124", "output": "[\"table\"]", "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\nIf you draw a few infinitely long straight lines on an infinitely wide plane, this plane will be divided into...
[{"input": "1\n705", "output": "2\n248866\n"}, {"input": "1\n506", "output": "2\n128272\n"}, {"input": "1\n154", "output": "2\n11936\n"}, {"input": "1\n238", "output": "2\n28442\n"}, {"input": "1\n373", "output": "2\n69752\n"}, {"input": "1\n155", "output": "2\n12091\n"}, {"input": "1\n159", "output": "2\n12721\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\nMr. E Ven only likes even length words.\nPlease create a translator so that he doesn't have to hear those pes...
[{"input": "\"underscore is not considered a word..in this case,\"", "output": "[\"underscore is nott considered aa wordin this case\"]", "fn_name": "evenator"}, {"input": "\"lorem is so ipsum. why bother?\"", "output": "[\"loremm is so ipsumm whyy bother\"]", "fn_name": "evenator"}, {"input": "\"hi. how are you? Bye!!...
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\nAt 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and t...
[{"input": "6 6\n4 4 X X T T\n4 7 8 2 X 7\n1 X X X 1 8\n1 2 X X X 6\n1 1 2 4 4 7\nS S 2 3 X X\n2 10\nT 1\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n2 10\nT X\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n10 10\nT T T T T T T T T T\nX 2 X X X X X 3 4 X\n9 8 9 X X X 2 9 X 9\n7 7 X 7 3 X X 8 9 X\n8 9 9 9 6 3 X 5 X 5\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\nThere are n positive integers a_1, a_2, ..., a_n. For the one move you can choose any even value c and divide...
[{"input": "4\n6\n37 6 40 3 20 1\n1\n1024\n4\n2 6 10 16\n3\n3 1 7\n", "output": "4\n10\n6\n0\n"}, {"input": "4\n6\n40 6 40 2 20 1\n1\n1024\n4\n2 4 8 16\n3\n3 1 14\n", "output": "5\n10\n4\n1\n"}, {"input": "4\n6\n37 6 79 3 20 1\n1\n1024\n4\n2 6 10 16\n1\n3 1 7\n", "output": "3\n10\n6\n0\n"}, {"input": "4\n6\n40 6 40 3 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\nThis kata is from check py.checkio.org\n\nYou are given an array with positive numbers and a number N. You sh...
[{"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 100]\n9", "output": "[1000000000000000000]", "fn_name": "index"}, {"input": "[75, 68, 35, 61, 9, 36, 89, 0, 30]\n10", "output": "[-1]", "fn_name": "index"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n9", "output": "[1]", "fn_name": "index"}, {"input": "[1, 3, 10, 100]\n3", "outpu...
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 have an H \\times W grid whose squares are painted black or white. The square at the i-th row from the top...
[{"input": "10 37\n.....................................\n...#...####...####..###...###...###..\n..#.#..#...#.##....#...#.#...#.#...#.\n..#.#..#...#.#.....#...#.#...#.#...#.\n.#...#.#..##.#.....#...#.#.###.#.###.\n.#####.####..#.....#...#..##....##...\n.#...#.#...#.#.....#...#.#...#.#...#.\n.#...#.#...#.##....#...#.#.....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe official capital and the cultural capital of Berland are connected by a single road running through n reg...
[{"input": "20 102\n73 79 75 27\n13 15 62 47\n74 75 85 86\n49 81 23 69\n43 17 45 27\n35 14 90 35\n51 74 35 33\n54 66 46 24\n33 76 49 3\n34 53 25 76\n69 72 76 31\n41 31 8 48\n49 48 85 24\n19 2 59 83\n19 31 51 86\n31 10 45 76\n56 47 79 86\n49 33 15 1\n77 89 26 64\n7 52 76 77\n", "output": "59201\n"}, {"input": "20 102\n7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNezzar has $n$ balls, numbered with integers $1, 2, \\ldots, n$. Numbers $a_1, a_2, \\ldots, a_n$ are written...
[{"input": "5\n6\n1 1 1 2 3 4\n5\n1 1 2 2 3\n4\n2 2 2 2\n3\n1 2 3\n1\n1\n", "output": "\n3\n2\n4\n1\n1\n"}, {"input": "5\n6\n1 1 1 2 3 4\n5\n1 1 2 2 3\n4\n2 2 2 2\n3\n1 2 3\n1\n1\n", "output": "3\n2\n4\n1\n1\n"}, {"input": "5\n6\n1 1 1 2 3 4\n5\n1 1 2 2 3\n4\n2 2 2 2\n3\n2 2 3\n1\n1\n", "output": "3\n2\n4\n2\n1\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\nWe, the researchers who discovered and investigated the ancient nation Iwashiro, finally discovered the templ...
[{"input": "aaaabaaaabaaaabaaaab\naabaa", "output": "1576\n"}, {"input": "aaaabaaaabaa`abaaaab\naabaa", "output": "1248\n"}, {"input": "aaaabaaaabaa`ababaaa\naabaa", "output": "1446\n"}, {"input": "aaaabaaaabaaaabaaaab\nbaaaa", "output": "566\n"}, {"input": "aa`abbbaaaaa``bababa\na`bab", "output": "180\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\nBoolean Expression Compressor\n\nYou are asked to build a compressor for Boolean expressions that transforms ...
[{"input": "0\n(a*(0*b))\n(1^a)\n(-(-a*-b)*a)\n(a^(b^(c^d)))\n.", "output": "1\n1\n2\n1\n13\n"}, {"input": "0\n(a*(1*b))\n(1^b)\n(-(-a*-b)*a)\n(a^(b^(c^d)))\n.", "output": "1\n5\n2\n1\n13\n"}, {"input": "0\n(a*(1*b))\n(0^a)\n(-(-b*-c)*a)\nca^(b^((^e)))\n.", "output": "1\n5\n1\n12\n1\n"}, {"input": "0\n(a*(1*c))\n(1^a)\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 is visiting a shop in Tokyo called 109 to buy some logs.\nHe wants n logs: one of length 1, one of leng...
[{"input": "1000000000000000000\n", "output": "999999998585786440\n"}, {"input": "109109109109109109\n", "output": "109109108641970782\n"}, {"input": "252509054433933446\n", "output": "252509053723287187\n"}, {"input": "335408917861648771\n", "output": "335408917042614075\n"}, {"input": "522842184971407774\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\nYou are given a string $s$ consisting of $n$ lowercase Latin letters.\n\nYou have to remove at most one (i.e....
[{"input": "26\nlolthisiscoolfreehackforya\n", "output": "llthisiscoolfreehackforya\n"}, {"input": "26\nlolthisiscoolfreehackforya\n", "output": "llthisiscoolfreehackforya\n"}, {"input": "26\nlolthisiscoolfrfehackforya\n", "output": "llthisiscoolfrfehackforya\n"}, {"input": "26\nayrofkcahefrfloocsisihtlol\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\nSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such re...
[{"input": "2\n6\n17\n34\n20\n1266\n24\n20\n0", "output": "1\n0\n2\n0\n0\n1\n1\n0\n"}, {"input": "2\n3\n17\n41\n20\n666\n24\n53\n0", "output": "1\n1\n2\n3\n0\n0\n1\n2\n"}, {"input": "2\n3\n17\n41\n20\n666\n24\n56\n0", "output": "1\n1\n2\n3\n0\n0\n1\n1\n"}, {"input": "2\n3\n17\n41\n20\n666\n24\n20\n0", "output": "1\n1\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\nOmkar is playing his favorite pixelated video game, Bed Wars! In Bed Wars, there are $n$ players arranged in ...
[{"input": "5\n4\nRLRL\n6\nLRRRRL\n8\nRLLRRRLL\n12\nLLLLRRLRRRLL\n5\nRRRRR\n", "output": "0\n1\n1\n3\n2\n"}, {"input": "5\n4\nRLRL\n6\nLRRRRL\n8\nRLLRRRLL\n12\nLLRRRLRRLLLL\n5\nRRRRR\n", "output": "0\n1\n1\n3\n2\n"}, {"input": "5\n4\nRLRL\n6\nRRRLRL\n8\nRLLRRRLL\n12\nLLLLRRLRLRRL\n5\nRRRRR\n", "output": "0\n1\n1\n1\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\nNotice that the memory limit is non-standard.\n\nRecently Arthur and Sasha have studied correct bracket seque...
[{"input": "50\n97 97\n61 61\n59 59\n29 29\n13 13\n7 7\n5 5\n3 3\n1 1\n3 3\n1 1\n13 13\n11 11\n9 9\n3 3\n1 1\n1 1\n1 1\n27 27\n25 25\n1 1\n21 21\n19 19\n17 17\n15 15\n5 5\n1 1\n1 1\n7 7\n1 1\n3 3\n1 1\n15 15\n13 13\n1 1\n9 9\n7 7\n5 5\n3 3\n1 1\n15 15\n5 5\n1 1\n1 1\n3 3\n1 1\n1 1\n1 1\n1 1\n1 1\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\nWherever the destination is, whoever we meet, let's render this song together.\n\nOn a Cartesian coordinate p...
[{"input": "20 50000 50000\n2 45955 55488\n1 19804 29337\n2 3767 90811\n2 24025 33558\n1 46985 56518\n2 21094 30627\n2 5787 15320\n1 4262 91306\n2 37231 46764\n1 18125 27658\n1 36532 12317\n1 31330 40863\n1 18992 28525\n1 29387 38920\n1 44654 54187\n2 45485 55018\n2 36850 46383\n1 44649 54182\n1 40922 50455\n2 12781 99...
code_stdio
[ { "content": "You are an expert Python programmer. 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 ask you to select some number of positive integers, and calculate the sum of them.\nIt is allowed to selec...
[{"input": "103 135 85", "output": "YES\n"}, {"input": "1 100 97\n", "output": "YES\n"}, {"input": "40 98 58\n", "output": "YES\n"}, {"input": "103 98 58", "output": "YES\n"}, {"input": "103 98 87", "output": "YES\n"}, {"input": "103 77 58", "output": "YES\n"}, {"input": "103 98 85", "output": "YES\n"}, {"input": "117 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 an integer N, let us consider a triangle of numbers of N lines in which a number a_{11} appears in the ...
[{"input": "2\n3\n1\n8 1\n41 4 3\n4 \n5 \n-1 0 \n2 -4 0\n3 0 12 -1", "output": "50\n17\n"}, {"input": "2\n3\n1\n4 2\n28 4 1\n4 \n4 \n1 0 \n5 -1 -1\n3 0 2 -1", "output": "33\n13\n"}, {"input": "2\n3\n1\n4 2\n28 4 2\n4 \n4 \n1 0 \n2 -1 -1\n3 0 4 -1", "output": "33\n10\n"}, {"input": "2\n3\n1\n8 1\n41 4 3\n4 \n14 \n0 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\nStudents Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks they decid...
[{"input": "222\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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\nOne day, the teacher came up with the following game.\nThe game uses n cards with one number from 1 to 10 and...
[{"input": "4 3\n15\n3\n16\n5\n0 0", "output": "480\n"}, {"input": "4 3\n12\n3\n16\n5\n0 0", "output": "384\n"}, {"input": "4 3\n8\n3\n16\n5\n0 0", "output": "256\n"}, {"input": "4 2\n8\n3\n10\n5\n0 0", "output": "30\n"}, {"input": "4 2\n4\n1\n14\n3\n0 0", "output": "14\n"}, {"input": "4 2\n8\n3\n16\n5\n0 0", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds ...
[{"input": "5 5 0\n-10 0\n12 10 -2\n-1 2 1", "output": "-12\n"}, {"input": "2 10 0\n-5 -1\n13 10 -1\n0 2 7", "output": "-6\n"}, {"input": "3 10 -1\n-5 0\n11 10 -2\n0 2 1", "output": "-7\n"}, {"input": "5 10 0\n-6 0\n12 10 -2\n-1 2 1", "output": "-8\n"}, {"input": "5 5 0\n-8 0\n12 10 -2\n-1 2 1", "output": "-10\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\nHands that shed innocent blood!\n\nThere are n guilty people in a line, the i-th of them holds a claw with le...
[{"input": "11\n1 0 0 1 1 3 2 0 0 2 3\n", "output": "4\n"}, {"input": "11\n1 0 0 1 1 3 2 0 0 2 3\n", "output": "4\n"}, {"input": "11\n1 0 0 1 0 3 2 0 0 2 3\n", "output": "4\n"}, {"input": "11\n1 0 0 1 0 3 2 0 0 2 2\n", "output": "4\n"}, {"input": "2\n1000000000 1000000000\n", "output": "1\n"}, {"input": "2\n1000000000 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it.\nThey...
[{"input": "6\n1 30 1 10 -1 6", "output": "15\n"}, {"input": "6\n1 36 1 10 -1 6", "output": "21\n"}, {"input": "6\n1 36 1 10 -1 1", "output": "26\n"}, {"input": "6\n0 3 3 7 1 24", "output": "10\n"}, {"input": "6\n-1 10 3 3 1 8", "output": "0\n"}, {"input": "6\n-1 10 3 3 1 4", "output": "2\n"}, {"input": "6\n-1 15 3 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\nIn Japan, temperature is usually expressed using the Celsius (℃) scale. In America, they used the Fahrenheit ...
[{"input": "22485", "output": "11227\n"}, {"input": "37535", "output": "18752\n"}, {"input": "54760", "output": "27365\n"}, {"input": "10347", "output": "5158\n"}, {"input": "10699", "output": "5334\n"}, {"input": "19116", "output": "9543\n"}, {"input": "11734", "output": "5852\n"}, {"input": "14312", "output": "7141\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 planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy o...
[{"input": "549\n817\n715\n603\n", "output": "1152\n"}, {"input": "600\n300\n220\n420\n", "output": "520\n"}, {"input": "555\n555\n400\n200\n", "output": "755\n"}, {"input": "549\n838\n715\n603", "output": "1152\n"}, {"input": "555\n312\n400\n200", "output": "512\n"}, {"input": "600\n548\n220\n420", "output": "768\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 time no story, no theory. The examples below show you how to write function `accum`:\n\n**Examples:**\n`...
[{"input": "\"ZpglnRxqenU\"", "output": "[\"Z-Pp-Ggg-Llll-Nnnnn-Rrrrrr-Xxxxxxx-Qqqqqqqq-Eeeeeeeee-Nnnnnnnnnn-Uuuuuuuuuuu\"]", "fn_name": "accum"}, {"input": "\"NyffsGeyylB\"", "output": "[\"N-Yy-Fff-Ffff-Sssss-Gggggg-Eeeeeee-Yyyyyyyy-Yyyyyyyyy-Llllllllll-Bbbbbbbbbbb\"]", "fn_name": "accum"}, {"input": "\"MjtkuBovqrU\""...
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\nYou have two friends. You want to present each of them several positive integers. You want to present cnt_1 n...
[{"input": "500000000 500000000 29983 29989\n", "output": "1000000001\n"}, {"input": "500000000 500000000 29959 29983\n", "output": "1000000001\n"}, {"input": "500000000 500000000 29983 29989\n", "output": "1000000001\n"}, {"input": "500000000 500000000 29959 29983\n", "output": "1000000001\n"}, {"input": "500000000 33...
code_stdio
[ { "content": "You are an expert Python programmer. 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 penguin Polo likes permutations. But most of all he likes permutations of integers from 0 to n, inclus...
[{"input": "15475\n", "output": "239491100\n3 2 1 0 11 10 9 8 7 6 5 4 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 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\nLimak is a little polar bear. He doesn't have many toys and thus he often plays with polynomials.\n\nHe consi...
[{"input": "100 1000\n-62 57 -27 -67 49 -10 66 -64 -36 -78 62 -75 -39 75 -47 -36 41 -88 62 -43 22 29 -20 58 40 16 71 -2 -87 12 86 -90 -92 67 -12 -48 -10 -26 78 68 22 -3 66 -95 -81 34 14 -76 -27 76 -60 87 -84 3 35 -60 46 -65 29 -29 2 -44 -55 18 -75 91 36 34 -86 53 59 -54 -29 33 -95 66 9 72 67 -44 37 44 32 -52 -34 -4 -99...
code_stdio
[ { "content": "You are an expert Python programmer. 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 is winter now, and Max decided it's about time he watered the garden.\n\nThe garden can be represented as ...
[{"input": "1\n177 99\n1 4 7 10 11 13 14 15 16 17 19 21 22 24 25 26 27 28 32 34 35 38 39 40 42 45 46 52 54 55 57 58 59 60 62 64 65 67 70 71 74 77 78 79 80 81 83 84 88 92 93 94 95 100 101 102 104 106 107 108 109 110 112 113 114 115 116 118 122 123 124 125 127 128 129 130 134 135 137 138 139 140 142 146 148 149 154 158 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\nYou are looking at the floor plan of the Summer Informatics School's new building. You were tasked with SIS l...
[{"input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100001000 1\n", "output": "100000999\n"}, {"input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100000000 1\n", "output": "99999999\n"}, {"input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100000000 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\nWe have a rectangular grid of squares with H horizontal rows and W vertical columns. Let (i,j) denote the squ...
[{"input": "2 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"input": "5 6 11\n2 0\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"input": "4 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"input": "5 1 11\n2 0\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"input": "5 6 11\n2 1\nRLDRRUDDLSL\nUR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFor an array $b$ of length $m$ we define the function $f$ as $ f(b) = \\begin{cases} b[1] & \\quad \\text{if...
[{"input": "6\n0 1 6 12 51 68\n4\n1 6\n2 6\n3 3\n2 4\n", "output": "125\n125\n6\n13\n"}, {"input": "6\n1 2 4 12 16 32\n4\n1 6\n2 6\n3 4\n1 4\n", "output": "56\n56\n12\n14\n"}, {"input": "6\n1 2 4 12 32 32\n4\n1 6\n2 6\n3 4\n1 4\n", "output": "44\n44\n12\n14\n"}, {"input": "6\n1 2 4 12 16 31\n4\n1 6\n2 6\n3 4\n1 4\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\nAt Akabeko Elementary School, all the students participate in a slightly unusual jogging. Students run their ...
[{"input": "2\n3 4\n13 4\n5\n789 289\n166 46\n9 4\n617 272\n972 303\n2\n11 5\n23 20\n0", "output": "13\n3\n1598397732\n1209243492\n1939462992\n1923746112\n1360317793\n23\n44\n"}, {"input": "2\n3 4\n13 4\n5\n789 289\n166 46\n9 4\n617 272\n972 303\n2\n11 5\n32 20\n0", "output": "13\n3\n1598397732\n1209243492\n1939462992\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNow I have a card with n numbers on it. Consider arranging some or all of these appropriately to make numbers...
[{"input": "4\n2\n8\n6\n10", "output": "1177916\n"}, {"input": "4\n4\n8\n6\n10", "output": "1315948\n"}, {"input": "4\n1\n5\n7\n17", "output": "1022430\n"}, {"input": "4\n4\n8\n3\n10", "output": "1108900\n"}, {"input": "4\n1\n7\n7\n17", "output": "1160462\n"}, {"input": "4\n2\n7\n7\n17", "output": "1229478\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\nA **bouncy number** is a positive integer whose digits neither increase nor decrease. For example, `1235` is ...
[{"input": "129347924210", "output": "[true]", "fn_name": "is_bouncy"}, {"input": "92722983", "output": "[true]", "fn_name": "is_bouncy"}, {"input": "234689", "output": "[false]", "fn_name": "is_bouncy"}, {"input": "98874", "output": "[false]", "fn_name": "is_bouncy"}, {"input": "2379", "output": "[false]", "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\nWrite a function named `first_non_repeating_letter` that takes a string input, and returns the first characte...
[{"input": "\"Go hang a salami, I'm a lasagna hog!\"", "output": "[\",\"]", "fn_name": "first_non_repeating_letter"}, {"input": "\"hello world, eh?\"", "output": "[\"w\"]", "fn_name": "first_non_repeating_letter"}, {"input": "\"moonmen\"", "output": "[\"e\"]", "fn_name": "first_non_repeating_letter"}, {"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\nVasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell $(0, 0)$. Robot...
[{"input": "386\nRUDLURLUURDDLLLRLDURLRRDLDUUURLLRDLRRDLDRLDDURDURURDRLUULLDUULRULDLLLLDLUURRLRRRUDULRDDRDLDULRLDDRDDRLRLDLDULLULUDULLLDUUDURURDDLDRLUDDDDLDUDUURLUUDURRUDRLUDRLULLRLRRDLULDRRURUULLRDLDRLURDUDRLDLRLLUURLURDUUDRDURUDDLLDURURLLRRULURULRRLDLDRLLUUURURDRRRLRDRURULUDURRLRLDRUDLRRRRLLRURDUUDLLLLURDLRLRRDLDLLLD...
code_stdio
[ { "content": "You are an expert Python programmer. 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 some country live wizards. They love playing with numbers. \n\nThe blackboard has two numbers written on i...
[{"input": "66\n7 0\n5 7\n1 3\n3 2\n3 5\n0 6\n1 2\n0 7\n4 5\n4 7\n5 1\n2 0\n4 0\n0 5\n3 6\n7 2\n6 0\n5 3\n6 6\n1 7\n5 6\n2 2\n3 4\n2 0\n5 3\n4 6\n6 1\n5 3\n100000000000 0000000000000000000\n0 1\n4 1\n2 6\n5 5\n4 5\n0 3\n3 7\n3 1\n1 0\n4 4\n1000000000000000000 100000000000\n12 6\n4 2\n7 5\n1 6\n6 1\n2 7\n7 7\n6 7\n2 4\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\nAs AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of ...
[{"input": "10000\n126382592 432418816 117063168 213396480 379143680 515038208 324231168 266539520 602792960 314653184 650153984 883734016 33309696 9005056 46451200 158759424 33279488 319342080 499438080 853167616 310094336 919876608 882363392 132034048 288561664 745817600 28561408 9703936 792974336 310508544 125830656...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFour players participate in the playoff tournament. The tournament is held according to the following scheme:...
[{"input": "4\n3 7 9 5\n4 5 6 1\n5 3 8 1\n2 5 3 2\n", "output": "YES\nYES\nYES\nYES\n"}, {"input": "4\n3 7 2 5\n4 5 6 9\n5 3 15 1\n2 5 3 1\n", "output": "YES\nNO\nYES\nYES\n"}, {"input": "4\n3 7 9 5\n4 5 6 9\n5 3 8 1\n2 5 3 2\n", "output": "YES\nNO\nYES\nYES\n"}, {"input": "4\n3 7 9 5\n4 5 6 9\n5 3 8 1\n2 5 3 1\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFor a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with...
[{"input": "1005856822 8\n", "output": "50292841100000000\n"}, {"input": "1522186596 8\n", "output": "38054664900000000\n"}, {"input": "123456789 8\n", "output": "12345678900000000\n"}, {"input": "999999999 8\n", "output": "99999999900000000\n"}, {"input": "222222222 8\n", "output": "11111111100000000\n"}, {"input": "6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are fed up with your messy room, so you decided to clean it up.\n\nYour room is a bracket sequence $s=s_{...
[{"input": "4\n8 3\n)())(()(\n10 3\n))()()()((\n2 1\n)(\n2 1\n)(\n", "output": "4\n1 2\n3 5\n5 6\n6 8\n5\n1 3\n3 5\n5 7\n6 9\n7 10\n1\n1 2\n1\n1 2\n"}, {"input": "4\n8 2\n)())(()(\n10 4\n))()()()((\n2 1\n)(\n2 1\n)(\n", "output": "4\n1 2\n3 5\n4 6\n5 8\n5\n1 3\n3 5\n5 7\n7 9\n8 10\n1\n1 2\n1\n1 2\n"}, {"input": "4\n8 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\nYou are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.\...
[{"input": "100 1 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n", "output": "100\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\nb\nb\nb\nb\nb\nb\nb\nb\nb\nb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn this problem you have to solve a simple classification task: given an image, determine whether it depicts ...
[{"input": "-116\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n"}, {"input": "-132\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n"}, {"input": "-119\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA substring of some string is called the most frequent, if the number of its occurrences is not less than num...
[{"input": "76\namnctposz\nmnctpos\nos\nu\ne\nam\namnc\neamnctpo\nl\nx\nq\nposzq\neamnc\nctposzq\nctpos\nmnc\ntpos\namnctposzql\ntposzq\nmnctposz\nnctpos\nctposzql\namnctpos\nmnct\np\nux\nposzql\ntpo\nmnctposzql\nmnctp\neamnctpos\namnct\ntposzql\nposz\nz\nct\namnctpo\noszq\neamnct\ntposz\ns\nmn\nn\nc\noszql\npo\no\nmnc...
code_stdio
[ { "content": "You are an expert Python programmer. 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 permutation $p_1, p_2, \\ldots, p_n$.\n\nIn one move you can swap two adjacent values.\n\nYou...
[{"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\nWrite a function which outputs the positions of matching bracket pairs. The output should be a dictionary wit...
[{"input": "\"(a(b)c()d)\"", "output": "[{\"0\": 9, \"2\": 4, \"6\": 7}]", "fn_name": "bracket_pairs"}, {"input": "\"len(list)\"", "output": "[{\"3\": 8}]", "fn_name": "bracket_pairs"}, {"input": "\"f(x[0])\"", "output": "[{\"1\": 6}]", "fn_name": "bracket_pairs"}, {"input": "\"def f(x\"", "output": "[false]", "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\nAddition of Big Integers\n\nGiven two integers $A$ and $B$, compute the sum, $A + B$.\n\nInput\n\nTwo integer...
[{"input": "109 30", "output": "139\n"}, {"input": "195 30", "output": "225\n"}, {"input": "302 30", "output": "332\n"}, {"input": "552 30", "output": "582\n"}, {"input": "139 37", "output": "176\n"}, {"input": "139 39", "output": "178\n"}, {"input": "107 39", "output": "146\n"}, {"input": "107 73", "output": "180\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\nCelebrating the new year, many people post videos of falling dominoes; Here's a list of them: https://www.you...
[{"input": "10\n142699629 183732682\n229190264 203769218\n582937498 331846994\n637776490 872587100\n646511567 582113351\n708368481 242093919\n785185417 665206490\n827596004 933089845\n905276008 416253629\n916536536 583835690\n5\n9 10\n4 9\n1 10\n6 10\n4 5\n", "output": "0\n0\n149978016\n0\n0\n"}, {"input": "10\n1426996...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGeorge has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Al...
[{"input": "100\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour friend Jeff Zebos has been trying to run his new online company, but it's not going very well. He's not ...
[{"input": "3\nAZAMON ALPPE\nAZOMAN ABABILAAAAAAAAAAA\nAPPLE ANAOAB\n", "output": "AAZMON\nAAOMZN\nAEPLP\n"}, {"input": "3\nAZANOM APPLE\nAAZMON ABABILAAAAAAAAAAA\nAPPLF ANANAB\n", "output": "AAZNOM\nAAMZON\nAFPLP\n"}, {"input": "3\nZAAMON APPLE\nAZAMON ABABHLAAAA@AAAAAA\nAPPLF ANANAB\n", "output": "AAZMON\nAAZMON\nAFP...
code_stdio
[ { "content": "You are an expert Python programmer. 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 is preparing to pass IQ test. The most frequent task in this test is `to find out which one of the given ...
[{"input": "\"9 31 27 93 17 77 75 9 9 53 89 39 51 99 5 1 11 39 27 49 91 17 27 79 81 71 37 75 35 13 93 4 99 55 85 11 23 57 5 43 5 61 15 35 23 91 3 81 99 85 43 37 39 27 5 67 7 33 75 59 13 71 51 27 15 93 51 63 91 53 43 99 25 47 17 71 81 15 53 31 59 83 41 23 73 25 91 9\"", "output": "[32]", "fn_name": "iq_test"}, {"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\nKate has a set $S$ of $n$ integers $\\{1, \\dots, n\\} $. \n\nShe thinks that imperfection of a subset $M \\s...
[{"input": "21031\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. 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 fan of pairs and he likes all things that come in pairs. He even has a doll collection in which the d...
[{"input": "1\n1\n100 \n3\n1", "output": "100\n"}, {"input": "1\n5\n1\n1\n3\n3\n3", "output": "3\n"}, {"input": "1\n5\n1\n1\n3\n6\n3", "output": "6\n"}, {"input": "1\n5\n1\n1\n2\n2\n5", "output": "5\n"}, {"input": "1\n5\n1\n1\n3\n3\n9", "output": "9\n"}, {"input": "1\n1\n48 \n9\n-1", "output": "48\n"}, {"input": "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\nA string is called palindrome if it reads the same from left to right and from right to left. For example \"k...
[{"input": "wrwrwfrrfrffrrwwwffffwrfrrwfrrfrwwfwfrwfwfwffwrrwfrrrwwwfrrrwfrrfwrwwrwrrrffffwrrrwrwfffwrffrwwwrwww\n", "output": "fffffffffffffffrrrrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwrrrrrrrrrrrrrrrrrrfffffffffffffff\n"}, {"input": "wrwrwfrrfrffrrwwwffffwrfrrwfrrfrwwfwfrwfwfwffwrrwfrrrwwwfrrrwfrrfwrwwrwrrrf...
code_stdio
[ { "content": "You are an expert Python programmer. 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 might have heard about our new goodie distribution program aka the \"Laddu Accrual System\". This problem...
[{"input": "2\n4 INDIAN\nCONTEST_WON 0\nTOP_CONTRIBUTOR\nBUG_FOUND 110\nCONTEST_HOSTED\n2 NON_INDIAN\nCONTEST_WON -1\nTOP_CONTRIBUTOR\nBUH_FOUND 100\nCONTEST_HOSTED", "output": "3\n1\n"}, {"input": "2\n4 INDIAN\nCONTEST_WON 0\nTOP_CONTRIBUTOR\nBUG_FOUND 110\nCONTEST_HOSTED\n2 NON_INDIAN\nCONTEST_WON -1\nTOP_CONTRIBUTOR...
code_stdio
[ { "content": "You are an expert Python programmer. 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 easy and hard versions are constraints on $n$ and $k$.\n\nYou are messaging in on...
[{"input": "10 4\n2 3 3 1 1 2 1 4 3 3\n", "output": "4\n4 1 3 2\n"}, {"input": "10 4\n2 3 5 1 1 2 1 4 3 3\n", "output": "4\n4 1 5 3\n"}, {"input": "10 4\n2 3 5 2 1 2 1 4 2 3\n", "output": "4\n3 2 4 1\n"}, {"input": "10 4\n2 3 3 1 1 2 1 2 4 3\n", "output": "4\n4 1 3 2\n"}, {"input": "10 4\n2 3 5 2 1 2 1 4 3 3\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAccording to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job...
[{"input": "4\n1475\nKXJURNYJHVLVKULJBPRBCZSOTKNTOGKGFKIQDQEMEAFTPNXQTIQWROI\nKTR\nRHVRWGODYWWTYZFLFYKCVUFFRTQDINKNWPKFHZBFWBHWINWJW\n", "output": "0\n"}, {"input": "4\n1475\nKXJURNYJHVLVKULJBPRBCZSOTKNTOGKGFKIQDQEMEAFTPNXQTIQWROI\nRTK\nRHVRWGODYWWTYZFLFYKCVUFFRTQDINKNWPKFHZBFWBHWINWJW\n", "output": "0\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\nYou are given a sequence $a_1, a_2, \\dots, a_n$ consisting of $n$ integers.\n\nYou may perform the following...
[{"input": "100 1186\n619 240 80 547 446 128 43 285 725 220 56 690 770 431 777 5 41 549 405 203 2 477 919 481 453 787 680 326 318 241 942 497 504 324 598 925 346 628 851 38 355 493 748 685 901 63 698 676 154 162 313 964 455 617 381 41 479 746 83 253 164 907 950 918 264 307 980 743 257 322 845 419 559 496 434 759 584 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\nIn this problem is used an extremely simplified version of HTML table markup. Please use the statement as a f...
[{"input": "<table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke stands on a number line. He has L ears, and he will walk along the line continuously under the followin...
[{"input": "7\n180356616\n666988621\n1507983937\n574614921\n254436000\n1351749818\n0", "output": "0\n"}, {"input": "7\n314159265\n429733551\n846264338\n327950288\n419716939\n937510582\n-1", "output": "0\n"}, {"input": "7\n314159265\n274050664\n846264338\n327950288\n419716939\n937510582\n-1", "output": "0\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\nIn one of the games Arkady is fond of the game process happens on a rectangular field. In the game process Ar...
[{"input": "82424 40643 9 2 200\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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\nOne day shooshuns found a sequence of n integers, written on a blackboard. The shooshuns can perform one oper...
[{"input": "20 20\n20 1 19 2 18 3 17 4 16 5 15 6 14 7 13 8 12 9 11 10\n", "output": "19\n"}, {"input": "20 10\n1 2 3 4 8 6 7 10 9 10 1 1 1 1 1 1 1 1 1 1\n", "output": "-1\n"}, {"input": "20 10\n1 2 3 4 8 6 7 10 9 10 1 1 1 1 0 1 1 1 1 1\n", "output": "-1\n"}, {"input": "20 10\n1 1 3 4 8 6 7 10 9 10 1 1 1 1 0 1 1 1 1 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\nMr. A, who will graduate next spring, decided to move when he got a job. The company that finds a job has off...
[{"input": "6\n0 1 80\n1 3 20\n0 2 60\n2 4 50\n3 2 66\n0 4 165\n2\n0 1 1\n1 2 1\n0", "output": "2 262\n1 2\n"}, {"input": "6\n0 1 80\n1 3 20\n0 2 60\n2 4 50\n3 2 66\n0 4 165\n2\n0 1 1\n0 2 1\n0", "output": "2 262\n0 2\n"}, {"input": "6\n0 1 113\n1 4 20\n0 2 60\n2 2 47\n3 4 66\n1 4 90\n2\n0 1 1\n1 2 1\n0", "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's define a forest as a non-directed acyclic graph (also without loops and parallel edges). One day Misha ...
[{"input": "19\n1 13\n0 0\n1 9\n1 11\n1 11\n2 3\n2 30\n0 0\n1 5\n1 2\n0 0\n5 29\n1 6\n2 11\n0 0\n0 0\n0 0\n0 0\n2 13\n", "output": "10\n0 13\n2 9\n3 11\n4 11\n8 5\n12 6\n13 11\n5 11\n6 18\n11 18\n"}, {"input": "18\n0 0\n0 0\n2 19\n1 2\n2 29\n0 0\n1 7\n1 6\n1 12\n1 13\n0 0\n1 12\n4 23\n1 9\n0 0\n0 0\n2 14\n1 4\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nB: Dansunau www --Dance Now!-\n\nstory\n\nLast lab life! Daigakuin! !! Dosanko Snow has won 9th place in the ...
[{"input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n4 3 3\n4 0 4\n5 10 5\n12 9 7\n7 7 7\n8 11 8\n9 11 9", "output": "3\n"}, {"input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n4 3 3\n4 0 4\n5 10 5\n12 9 7\n7 7 7\n8 8 8\n9 11 9", "output": "3\n"}, {"input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n8 3 3\n4 0 4\n5 10 5\n12 9 7\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\nWrite a function that takes a positive integer and returns the next smaller positive integer containing the s...
[{"input": "59884848483559", "output": "[59884848459853]", "fn_name": "next_smaller"}, {"input": "51226262651257", "output": "[51226262627551]", "fn_name": "next_smaller"}, {"input": "1234567908", "output": "[1234567890]", "fn_name": "next_smaller"}, {"input": "123456798", "output": "[123456789]", "fn_name": "next_smal...
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\nproblem\n\nFive students, Taro, Jiro, Saburo, Shiro, and Hanako, participated in the JOI High School class.\n...
[{"input": "10\n130\n100\n37\n101", "output": "82\n"}, {"input": "10\n130\n100\n65\n101", "output": "87\n"}, {"input": "10\n130\n100\n98\n101", "output": "93\n"}, {"input": "10\n130\n110\n98\n100", "output": "95\n"}, {"input": "10\n130\n111\n98\n000", "output": "83\n"}, {"input": "10\n100\n111\n225\n4", "output": "103\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given...
[{"input": "34 12\n234598000 42842091", "output": "2 204\n1 10050668864418000\n"}, {"input": "34 12\n234598000 60832539", "output": "2 204\n1 14271191984322000\n"}, {"input": "34 9\n234598000 42842091", "output": "1 306\n1 10050668864418000\n"}, {"input": "13 24\n38128567 122348608", "output": "1 312\n1 466497709748473...
code_stdio
[ { "content": "You are an expert Python programmer. 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 a string s = s_1s_2...s_{|}s|, where |s| is the length of string s, and s_{i} its i-th character. \n...
[{"input": "AAAAAAAAAAAAAAAAXAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "17\n1 39\n2 37\n3 35\n4 33\n5 31\n6 29\n7 27\n8 25\n9 23\n10 21\n11 19\n12 17\n13 15\n14 13\n15 11\n16 9\n40 1\n"}, {"input": "AAAAAAAAAAAAAAAAXAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "17\n1 39\n2 37\n3 35\n4 33\n5 31\n6 29\n7 27\n8 25\n9 23\n10 21\n11 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\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which...
[{"input": "3\n-1 1 10 18\n3 3 6 20\n4 3 8 -1", "output": " 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 18\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 20 0 0 0 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\nTakahashi has a lot of peculiar devices. These cylindrical devices receive balls from left and right. Each de...
[{"input": "4 123456789\nAABA", "output": "BABA\n"}, {"input": "4 110986646\nAABB", "output": "BABA\n"}, {"input": "4 123456789\nAAAA", "output": "BABA\n"}, {"input": "4 110986646\nBABA", "output": "BABA\n"}, {"input": "4 164919271\nBAAA", "output": "BABA\n"}, {"input": "4 219940491\nBAAA", "output": "BABA\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\nSee the following triangle:\n```\n____________________________________\n 1 ...
[{"input": "50", "output": "[[1625625, 1235000, 390625]]", "fn_name": "mult_triangle"}, {"input": "10", "output": "[[3025, 2400, 625]]", "fn_name": "mult_triangle"}, {"input": "5", "output": "[[225, 144, 81]]", "fn_name": "mult_triangle"}, {"input": "4", "output": "[[100, 84, 16]]", "fn_name": "mult_triangle"}, {"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\nStep through my `green glass door`.\n\nYou can take the `moon`, but not the `sun`.\n\nYou can take your `slip...
[{"input": "\"airplane\"", "output": "[false]", "fn_name": "step_through_with"}, {"input": "\"aardvark\"", "output": "[true]", "fn_name": "step_through_with"}, {"input": "\"glasses\"", "output": "[true]", "fn_name": "step_through_with"}, {"input": "\"branch\"", "output": "[false]", "fn_name": "step_through_with"}, {"in...
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\nYou are given a string S of length 2N, containing N occurrences of `a` and N occurrences of `b`.\n\nYou will ...
[{"input": "9\nbbbbbaaaababbaabaa", "output": "bbbbbaaaababbaabaa\n"}, {"input": "9\nbbbbbabaabbaaabaaa", "output": "bbbbbabaabbaaabaaa\n"}, {"input": "9\nabbbbabaababaabbaa", "output": "bbbabaababaabbaa\n"}, {"input": "9\nabbbbabaaabbabaaba", "output": "bbbabaaabbabaaba\n"}, {"input": "9\nabbbbabaabababaaab", "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\n10^{10^{10}} participants, including Takahashi, competed in two programming contests.\nIn each contest, all p...
[{"input": "99\n207579013 207579013\n376140463 376140463\n186969586 186969586\n326402540 326402540\n158176573 158176573\n127860890 127860890\n570870045 570870045\n178509023 178509023\n61263305 61263305\n558212775 558212775\n26389630 26389630\n496148000 496148000\n837151741 837151741\n656585276 656585276\n902071051 9020...
code_stdio
[ { "content": "You are an expert Python programmer. 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 you had helped Fedor to find friends in the «Call of Soldiers 3» game, he stopped studying completely. ...
[{"input": "2\nABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABBA ABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABA\n2\nABBABAABBAABABBABAABABBAABBABAAABAABABBAABBABAABABBABAABBAABABA neuzaiheshi\nABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABBA ABBABAABBAABABBABAABABBAABBABA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGerald has been selling state secrets at leisure. All the secrets cost the same: n marks. The state which sec...
[{"input": "243\n", "output": " 1\n"}, {"input": "108\n", "output": " 2\n"}, {"input": "81\n", "output": " 1\n"}, {"input": "10\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\nN of us are going on a trip, by train or taxi.\nThe train will cost each of us A yen (the currency of Japan)....
[{"input": "12 -13 -107", "output": "-156\n"}, {"input": "-1719 1 -2", "output": "-1719\n"}, {"input": "10 -2 -141", "output": "-141\n"}, {"input": "10 -2 -162", "output": "-162\n"}, {"input": "10 -7 -107", "output": "-107\n"}, {"input": "19 -7 -107", "output": "-133\n"}, {"input": "13 -13 -48", "output": "-169\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\nPari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is c_{i}. The...
[{"input": "9 436\n1 2 4 8 14 32 27 128 256\n", "output": "160\n0 1 2 3 4 6 8 9 10 11 14 15 16 17 18 20 22 23 24 25 27 28 29 30 32 34 35 36 37 38 41 42 43 44 46 48 49 50 51 52 128 129 130 131 132 134 136 137 138 139 142 143 144 145 146 148 150 151 152 153 155 156 157 158 160 162 163 164 165 166 169 170 171 172 174 176 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 program which reads three integers a, b and c, and prints \"Yes\" if a < b < c, otherwise \"No\".\n\n...
[{"input": "-1 -1 -1", "output": "No\n"}, {"input": "-1 -1 -2", "output": "No\n"}, {"input": "18 10 10", "output": "No\n"}, {"input": "-1 0 2", "output": "Yes\n"}, {"input": "-1 -1 2", "output": "No\n"}, {"input": "-1 -1 1", "output": "No\n"}, {"input": "-1 -1 0", "output": "No\n"}, {"input": "18 16 5", "output": "No\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\nA population of bears consists of black bears, brown bears, and white bears.\n\nThe input is an array of two ...
[{"input": "[\"white\", \"brown\"]", "output": "[\"light brown\"]", "fn_name": "bear_fur"}, {"input": "[\"black\", \"brown\"]", "output": "[\"dark brown\"]", "fn_name": "bear_fur"}, {"input": "[\"pink\", \"black\"]", "output": "[\"unknown\"]", "fn_name": "bear_fur"}, {"input": "[\"black\", \"black\"]", "output": "[\"bl...
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\nYou're given an array $a$. You should repeat the following operation $k$ times: find the minimum non-zero ele...
[{"input": "50 48\n26 87 99 27 2 2 94 10 21 9 6 7 85 10 66 56 16 55 101 51 16 151 100 28 93 70 33 84 50 87 55 36 93 84 63 94 119 2 42 84 37 54 34 76 38 78 14 21 6 4\n", "output": "2\n2\n2\n1\n2\n1\n4\n2\n5\n5\n1\n1\n5\n1\n2\n1\n1\n4\n8\n1\n3\n1\n1\n7\n3\n4\n6\n2\n6\n1\n2\n6\n1\n5\n1\n1\n18\n32\n0\n0\n0\n0\n0\n0\n0\n0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently Vladik discovered a new entertainment — coding bots for social networks. He would like to use machin...
[{"input": "2\n3\nnetman vladik Fedosik\n2\n?: users are netman, vladik, kisodeF\nvladik: something wrong with shis chat\n4\nnetman tigerrrrr banany2001 klinchuh\n4\n?: tigerrrrr, banany2001, klinchuh- my favourite team evdr, are you ready?\nklinchuh: xes, coach!\n?: yes, netman\nbanany2001: yes of .esruoc\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\nArithmetic Progressions\n\nAn arithmetic progression is a sequence of numbers $a_1, a_2, ..., a_k$ where the ...
[{"input": "6\n-2 11 12 30 3 0", "output": "2\n"}, {"input": "6\n-4 1 6 2 13 -1", "output": "3\n"}, {"input": "6\n-2 1 -1 8 13 9", "output": "2\n"}, {"input": "6\n-2 11 5 20 8 0", "output": "3\n"}, {"input": "6\n-2 11 6 20 8 0", "output": "2\n"}, {"input": "6\n-2 11 6 20 3 0", "output": "3\n"}, {"input": "6\n-2 11 6 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\nA triple of numbers is said to be poor when two of those numbers are equal but the other number is different ...
[{"input": "1 -2 -2", "output": "Yes\n"}, {"input": "0 -2 -2", "output": "Yes\n"}, {"input": "5 7 5\n", "output": "Yes\n"}, {"input": "3 3 4\n", "output": "Yes\n"}, {"input": "6 1 6\n", "output": "Yes\n"}, {"input": "8 8 2\n", "output": "Yes\n"}, {"input": "9 1 1\n", "output": "Yes\n"}, {"input": "7 8 8\n", "output": "...
code_stdio