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\nBeaches are filled with sand, water, fish, and sun. Given a string, calculate how many times the words `\"San...
[{"input": "\"saNdsandwaterwAterfishfishsunsunsandwatersandsandwaterwaterfishfishsunsunsandwatersandsandwaterwaterfishfishsunsunsandwatersandsandwaterwaterfishfishsunsunsandwatersandsandwaterwaterfishfishsunsunsandwatersandsandwaterwaterfishfishsunsunsandwatersandsandwaterwaterfishfishsunsunsandwatersandsandwaterwaterf...
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\nMaksim walks on a Cartesian plane. Initially, he stands at the point $(0, 0)$ and in one move he can go to an...
[{"input": "39\n27 47\n30 9\n18 28\n49 16\n10 12\n25 13\n44 11\n13 9\n3 8\n30 2\n8 30\n38 32\n7 29\n38 43\n27 37\n6 13\n21 25\n31 18\n17 26\n51 52\n27 40\n10 43\n50 27\n41 41\n2 11\n38 45\n37 43\n20 52\n36 11\n43 46\n4 39\n22 32\n42 11\n8 37\n9 17\n38 8\n41 1\n24 50\n47 7\n", "output": "861\n"}, {"input": "39\n27 47\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAyush, Ashish and Vivek are busy preparing a new problem for the next Codeforces round and need help checking...
[{"input": "24\n4\n1 2 3 4\n1 2 3 4\n4\n1 2 3 4\n1 2 4 3\n4\n1 2 3 4\n1 3 2 4\n4\n1 2 3 4\n1 3 4 2\n4\n1 2 3 4\n1 4 2 3\n4\n1 2 3 4\n1 4 3 2\n4\n1 2 3 4\n2 1 3 4\n4\n1 2 3 4\n2 1 4 3\n4\n1 2 3 4\n2 3 1 4\n4\n1 2 3 4\n2 3 4 1\n4\n1 2 3 4\n2 4 1 3\n4\n1 2 3 4\n2 4 3 1\n4\n1 2 3 4\n3 1 2 4\n4\n1 2 3 4\n3 1 4 2\n4\n1 2 3 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\nYou are given a tree consisting of n nodes. You generate an array from the tree by marking nodes one by one.\...
[{"input": "6\n2 1\n2 3\n6 1\n2 4\n2 5\n", "output": "583333343\n"}, {"input": "6\n2 1\n2 3\n6 1\n2 4\n1 5\n", "output": "500000009\n"}, {"input": "6\n3 1\n2 3\n6 1\n2 4\n1 5\n", "output": "875000012\n"}, {"input": "6\n2 1\n1 3\n6 1\n1 4\n2 5\n", "output": "416666675\n"}, {"input": "6\n2 1\n1 3\n6 1\n1 4\n4 5\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\nSnuke is having a barbeque party.\nAt the party, he will make N servings of Skewer Meal.\nExample of a servin...
[{"input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time a...
[{"input": "1\n90\n90 90 90 90 51 90 88 90 112 67 90 90 90 13 90 48 164 172 98 102 73 90 90 90 90 124 90 90 46 139 90 84 85 90 90 18 52 30 90 90 90 87 47 90 146 30 90 97 153 90 90 227 248 90 90 28 174 139 90 90 62 90 23 124 90 36 81 90 90 82 90 54 90 163 105 147 90 14 90 90 151 90 90 82 90 90 90 56 90 90\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\nFind the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of s...
[{"input": "1 -1000000000000000000 1000000000000000000\n", "output": "2000000000000000001\n"}, {"input": "2 -1000000000000000000 1000000000000000000\n", "output": "1000000000000000001\n"}, {"input": "1000000000000000000 -1000000000000000000 1000000000000000000\n", "output": "3\n"}, {"input": "100000000000000321 -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\nThe Fair Nut likes kvass very much. On his birthday parents presented him $n$ kegs of kvass. There are $v_i$ ...
[{"input": "4 4\n1000000000 1000000000 1000000000 1000000000\n", "output": "999999999\n"}, {"input": "4 4\n1000000000 1000000000 1000000000 1000000000\n", "output": "999999999\n"}, {"input": "4 4\n1000000000 1000000100 1000000000 1000000000\n", "output": "1000000000"}, {"input": "4 4\n1000000000 1000000100 1000000000 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\nn children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1...
[{"input": "101 30\n1122517 913885 829106 127375 848316 278798 520469 1178427 61045 916519 767861 370006 75224 321506 124981 1042689 131175 689748 422800 181309 1322 2845106 1285852 60402 766045 1676905 513021 206603 979480 962688\n", "output": "4 90 71 46 100 15 77 24 63 81 85 3 26 72 31 58 84 13 11 21 52 37 97 38 101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLinear Kingdom has exactly one tram line. It has n stops, numbered from 1 to n in the order of tram's movemen...
[{"input": "100\n0 1\n0 0\n0 0\n1 0\n0 0\n0 1\n0 1\n1 1\n0 0\n0 0\n1 1\n0 0\n1 1\n0 1\n1 1\n0 1\n1 1\n1 0\n1 0\n0 0\n1 0\n0 0\n1 0\n0 0\n0 1\n1 1\n1 1\n0 1\n0 0\n1 0\n1 1\n0 1\n1 0\n1 1\n0 1\n1 1\n1 0\n0 0\n0 0\n0 1\n0 0\n-1 1\n1 1\n0 0\n1 1\n1 1\n0 0\n0 1\n1 0\n0 1\n0 0\n0 1\n0 1\n1 1\n1 1\n1 1\n0 0\n0 0\n1 1\n0 1\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\nThe Fair Nut is going to travel to the Tree Country, in which there are $n$ cities. Most of the land of this ...
[{"input": "10\n81 34 31 38 69 62 54 18 72 29\n4 8 12\n2 9 25\n4 5 17\n5 7 35\n10 1 13\n9 3 53\n7 6 22\n1 6 82\n3 10 42\n", "output": " 187\n"}, {"input": "10\n11 43 11 96 18 53 25 89 31 41\n2 4 41\n7 1 88\n3 2 19\n10 3 38\n8 4 97\n7 5 21\n7 2 71\n3 6 69\n9 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\nFor two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows:\n - Consider r...
[{"input": "5\n52 67 72 25 79\n", "output": "269312\n"}, {"input": "5\n52 103 72 25 79", "output": "292096\n"}, {"input": "5\n63 103 72 25 79", "output": "306176\n"}, {"input": "1\n1000000000\n", "output": "999999993\n"}, {"input": "5\n20 67 72 25 79", "output": "227072\n"}, {"input": "5\n2 124 30 25 55", "output": "17...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have $n \\times n$ square grid and an integer $k$. Put an integer in each cell while satisfying the condi...
[{"input": "250 1000000000\n", "output": "770503193\n"}, {"input": "250 1000000000\n", "output": "770503193\n"}, {"input": "216 1142401243\n", "output": "820247611\n"}, {"input": "246 1140071398\n", "output": "783102336\n"}, {"input": "218 1771958988\n", "output": "699159875\n"}, {"input": "244 315404017\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\nPetya and Gena love playing table tennis. A single match is played according to the following rules: a match ...
[{"input": "186\n2 1 2 1 1 1 1 1 2 1 1 2 2 2 1 1 2 2 1 1 1 2 1 1 2 2 1 1 1 2 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 2 2 1 1 1 1 1 2 2 1 2 2 1 2 2 1 1 1 2 2 1 1 2 2 1 2 2 1 2 2 2 2 2 1 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 1 2 1 1 2 2 1 2 2 1 1 1 1 1 2 2 1 1 2 2 1 2 2 2 1 2 1 2 1 1 2 1 2 2 2 2 1 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\nDue to the coronavirus pandemic, city authorities obligated citizens to keep a social distance. The mayor of ...
[{"input": "5\n2 1\n1 3\n2 2\n1 3\n5 4\n", "output": "1\n2\n2\n2\n10\n"}, {"input": "2\n461 5299\n118 177\n", "output": "1221420\n10443\n"}, {"input": "2\n461 5299\n176 177\n", "output": "1221420\n15576\n"}, {"input": "5\n5 1\n1 3\n2 4\n1 3\n7 3\n", "output": "3\n2\n4\n2\n11\n"}, {"input": "2\n461 5299\n176 213\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\nMike and !Mike are old childhood rivals, they are opposite in everything they do, except programming. Today t...
[{"input": "17\n714413739 -959271262 714413739 -745891378 926207665 -404845105 -404845105 -959271262 -189641729 -670860364 714413739 -189641729 192457837 -745891378 -670860364 536388097 -959271262\n-417715348 -959271262 -959271262 714413739 -189641729 571055593 571055593 571055593 -417715348 -417715348 192457837 -74589...
code_stdio
[ { "content": "You are an expert Python programmer. 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 town Nsk consists of n junctions connected by m bidirectional roads. Each road connects two distinct j...
[{"input": "5 6 1 5\n1 2\n1 3\n1 4\n4 5\n3 5\n2 5\n", "output": "3\n"}, {"input": "5 6 1 5\n1 2\n1 3\n1 4\n4 5\n3 5\n1 5\n", "output": "4\n"}, {"input": "5 6 1 5\n1 2\n1 3\n2 4\n4 5\n3 5\n2 5\n", "output": "3\n"}, {"input": "5 6 1 5\n1 2\n1 3\n1 4\n1 5\n3 5\n2 5\n", "output": "4\n"}, {"input": "5 6 1 5\n1 2\n1 5\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\nSereja loves number sequences very much. That's why he decided to make himself a new one following a certain ...
[{"input": "7\n1 53989\n1 47249\n1 71935\n2 1 3\n1 84520\n1 84185\n2 6 1\n14\n1 2 3 4 5 6 7 8 9 10 11 12 13 14\n", "output": "53989 47249 71935 53989 53989 53989 84520 84185 53989 47249 71935 53989 53989 53989\n"}, {"input": "7\n1 53989\n1 47249\n1 71935\n2 1 3\n1 84520\n1 84185\n2 6 1\n14\n1 2 3 4 5 6 7 8 9 10 11 12 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\nAncient Egyptians are known to have used a large set of symbols $\\sum$ to write on the walls of the temples....
[{"input": "107 100000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n-----Problem Statement-----\nSereja has a sequence of n integers a[1], a[2], ..., a[n]. Sereja can do followi...
[{"input": "3\n0 1 -1 0\n5 0 -1 1\n7 2 -1 1", "output": "0\n999999977\n999999629\n"}, {"input": "3\n-24 12 0 -1\n-1 -6 1 -2\n102 1 -1 1", "output": "0\n0\n810970227\n"}, {"input": "3\n-24 12 0 -1\n-1 -6 1 -2\n198 1 -1 1", "output": "0\n0\n249722532\n"}, {"input": "3\n-24 12 0 -1\n-1 -2 1 -2\n198 0 -1 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\nIs the number even?\n\nIf the numbers is even return `true`. If it's odd, return `false`. \n\n\nOh yeah... th...
[{"input": "15", "output": "[false]", "fn_name": "is_even"}, {"input": "27", "output": "[false]", "fn_name": "is_even"}, {"input": "3", "output": "[false]", "fn_name": "is_even"}, {"input": "14", "output": "[true]", "fn_name": "is_even"}, {"input": "26", "output": "[true]", "fn_name": "is_even"}, {"input": "2", "output...
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\nGiven a random string consisting of numbers, letters, symbols, you need to sum up the numbers in the string. ...
[{"input": "\"aHR0cDovL3d3dy5jb2Rld2Fycy5jb20va2F0YS9uZXcvamF2YXNjcmlwdA==\"", "output": "[53]", "fn_name": "sum_from_string"}, {"input": "\"In 2015, I want to know how much does iPhone 6+ cost?\"", "output": "[2021]", "fn_name": "sum_from_string"}, {"input": "\"a30561ff4fb19170aa598b1431b52edad1fcc3e0\"", "output": "[...
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\nAlice is playing with some stones.\n\nNow there are three numbered heaps of stones. The first of them contain...
[{"input": "64\n0 0 0\n0 0 1\n0 0 2\n0 0 3\n0 1 0\n0 1 1\n0 1 2\n0 1 3\n0 2 0\n0 2 1\n0 2 2\n0 2 3\n0 3 0\n0 3 1\n0 3 2\n0 3 3\n1 0 0\n1 0 1\n1 0 2\n1 0 3\n1 1 0\n1 1 1\n1 1 2\n1 1 3\n1 2 0\n1 2 1\n1 2 2\n1 2 3\n1 3 0\n1 3 1\n1 3 2\n1 3 3\n2 0 0\n2 0 1\n2 0 2\n2 0 3\n2 1 0\n2 1 1\n2 1 2\n2 1 3\n2 2 0\n2 2 1\n2 2 2\n2 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 an integer $n$. In $1$ move, you can do one of the following actions:\n\nerase any digit of the...
[{"input": "12\n825\n8888\n4\n157\n146\n1\n301\n19634\n1504\n10521\n1000000000\n687194767\n", "output": "2\n3\n0\n2\n1\n0\n2\n3\n3\n3\n9\n2\n"}, {"input": "12\n825\n4320\n12\n75\n113\n1\n186\n10133\n2180\n12699\n1000000000\n687194767\n", "output": "2\n2\n1\n3\n2\n0\n1\n4\n3\n3\n9\n2\n"}, {"input": "12\n825\n8888\n4\n15...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called ...
[{"input": "32640\n", "output": "32640\n"}, {"input": "97920\n", "output": "32640\n"}, {"input": "32640\n", "output": "32640\n"}, {"input": "97920\n", "output": "32640\n"}, {"input": "12096\n", "output": "2016\n"}, {"input": "38304\n", "output": "2016\n"}, {"input": "89408\n", "output": "8128\n"}, {"input": "10080\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\nGiven two words and a letter, return a single word that's a combination of both words, merged at the point wh...
[{"input": "\"JiOdIdA4\"\n\"oopopopoodddasdfdfsd\"\n\"d\"", "output": "[\"JiOdddasdfdfsd\"]", "fn_name": "string_merge"}, {"input": "\"abcdefxxxyzz\"\n\"abcxxxyyyxyzz\"\n\"x\"", "output": "[\"abcdefxxxyyyxyzz\"]", "fn_name": "string_merge"}, {"input": "\"apowiejfoiajsf\"\n\"iwahfeijouh\"\n\"j\"", "output": "[\"apowiejo...
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\nGiven are positive integers N and K.\n\nDetermine if the 3N integers K, K+1, ..., K+3N-1 can be partitioned i...
[{"input": "1 -12", "output": "-12 -11 -10\n"}, {"input": "1 -20", "output": "-20 -19 -18\n"}, {"input": "1 -33", "output": "-33 -32 -31\n"}, {"input": "1 -36", "output": "-36 -35 -34\n"}, {"input": "1 -26", "output": "-26 -25 -24\n"}, {"input": "1 -16", "output": "-16 -15 -14\n"}, {"input": "1 -10", "output": "-10 -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\nRidbit starts with an integer $n$.\n\nIn one move, he can perform one of the following operations:\n\ndivide ...
[{"input": "6\n1\n2\n3\n10\n10\n18\n", "output": "0\n1\n2\n2\n2\n2\n"}, {"input": "6\n1\n2\n3\n14\n6\n45\n", "output": "0\n1\n2\n2\n2\n3\n"}, {"input": "6\n2\n2\n3\n11\n4\n45\n", "output": "1\n1\n2\n3\n2\n3\n"}, {"input": "6\n2\n1\n3\n11\n4\n45\n", "output": "1\n0\n2\n3\n2\n3\n"}, {"input": "6\n1\n2\n1\n10\n1\n16\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\nArkady coordinates rounds on some not really famous competitive programming platform. Each round features $n$...
[{"input": "11000 10\n10000 9999 9998 1967 4502 9995 9994 10823 9992 9991\n", "output": "0000000000\n"}, {"input": "11000 10\n10000 9999 9998 1967 4502 9995 3707 10823 9992 9991\n", "output": "0000000000\n"}, {"input": "11010 10\n10000 9999 9998 1967 4502 9995 3707 10823 9992 9991\n", "output": "0000000000\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're given a list of n strings a_1, a_2, ..., a_{n}. You'd like to concatenate them together in some order ...
[{"input": "13\nclgknjjojyuvdtv\nclgknjjojyuvdtvzxz\nclgknjjojyuvdtvzxzxradqhm\ngvzpnckalbaubfviyhijosiixvxaydxagvymq\nclgknjjojyuvdtvjgcwarwvgilcctdiytmvmvfxxkezymt\nbvwzpuut\nclgknjjojyuvdtvjgcwarwvgilcctdiytmvmvfxxkezymth\nclgknjjojyuvdtvjgcwarwvgilcctdiytmvmvfxxkezymtlkdl\nrbwvaayhhunlvmwexvkmqbquypsnjbdkkeytthektt...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Smart Beaver from ABBYY invented a new message encryption method and now wants to check its performance. ...
[{"input": "20 15 17\n4 9 14 11 15 16 15 4 0 10 7 12 10 1 8 6 7 14 1 13\n6 3 14 8 8 11 16 4 5 9 2 13 6 14 15\n", "output": "10 1 3 8 3 15 7 14 1 12 3 10 15 16 16 5 4 15 13 11 "}, {"input": "20 15 17\n4 9 14 11 15 16 15 4 0 10 7 12 10 1 8 6 7 14 1 13\n6 3 14 8 8 11 16 4 6 9 2 13 6 14 15\n", "output": "10 1 3 8 3 15 7 14...
code_stdio
[ { "content": "You are an expert Python programmer. 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, your task is to use ASCII graphics to paint a cardiogram. \n\nA cardiogram is a polyline wit...
[{"input": "23\n33 42 55 36 73 42 36 39 35 38 38 65 31 33 26 40 20 32 45 32 31 35 36\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\nA very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, h...
[{"input": "100\n0 0 0 0 0 0 1 4 4 0 2 2 4 1 7 1 11 0 8 4 12 12 3 0 3 2 2 4 3 9 1 5 4 6 9 14 6 2 4 18 7 7 19 11 20 13 17 16 0 34 2 6 12 27 9 4 29 22 4 20 20 17 17 20 37 53 17 3 3 15 1 46 11 24 31 6 12 6 11 18 13 1 5 0 19 10 24 41 16 41 18 52 46 39 16 30 18 23 53 13\n", "output": "66\n"}, {"input": "100\n0 0 0 0 0 0 1 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\nOne of the oddest traditions of the town of Gameston may be that even the town mayor of the next term is chos...
[{"input": "3 3\n1 2\n3 50\n10 29\n146 32\n39 2\n50 50\n0 0", "output": "0\n0\n1\n5\n31\n1\n13\n"}, {"input": "3 2\n1 2\n3 10\n10 29\n142 48\n39 2\n50 50\n0 0", "output": "1\n0\n2\n5\n63\n1\n13\n"}, {"input": "4 3\n3 3\n3 105\n10 29\n31 32\n27 5\n50 50\n0 0", "output": "3\n0\n1\n5\n30\n7\n13\n"}, {"input": "4 3\n3 3\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a matrix, consisting of n rows and m columns. The rows are numbered top to bottom, the columns ...
[{"input": "9 10 30\n5 3\n5 5\n5 10\n1 3\n5 7\n1 8\n4 9\n2 10\n4 10\n3 1\n2 5\n3 8\n1 7\n2 2\n1 5\n2 3\n3 2\n3 10\n3 2\n2 7\n2 4\n1 4\n4 8\n2 8\n4 1\n5 3\n4 6\n5 8\n1 5\n1 1\n", "output": "1027\n857\n829\n783\n664\n648\n619\n611\n606\n595\n548\n527\n521\n486\n480\n469\n462\n458\n465\n458\n451\n450\n420\n417\n404\n470\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\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\n-----Constraints---...
[{"input": "1000000000000000 9.99\n", "output": "9990000000000000\n"}, {"input": "1010000000000101 9.99", "output": "10089900000001008\n"}, {"input": "1010000000100101 9.99", "output": "10089900001000008\n"}, {"input": "1010000100000101 9.99", "output": "10089900999001008\n"}, {"input": "1010010100000101 9.99", "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\nIvan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, a...
[{"input": "5 5 5 5\n836 776 809 618 397\n121 629 373 169 333\n589 439 410 388 446\n936 472 433 647 791\n25\n1 2\n4 5\n5 4\n4 1\n3 5\n5 2\n2 4\n3 4\n3 3\n3 2\n4 4\n4 3\n1 1\n1 4\n5 1\n2 3\n1 5\n5 5\n2 5\n3 1\n2 1\n2 2\n1 3\n5 3\n4 2\n25\n1 1\n5 4\n4 1\n1 2\n1 4\n2 3\n3 3\n4 3\n2 2\n5 3\n2 1\n1 3\n5 5\n3 5\n2 4\n3 1\n5 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 cities numbered 1 through N, and M bidirectional roads numbered 1 through M. Road i connects City...
[{"input": "103 1\n6 8", "output": "101\n"}, {"input": "164 1\n6 8", "output": "162\n"}, {"input": "109 1\n5 9", "output": "107\n"}, {"input": "56 1\n12 11", "output": "54\n"}, {"input": "129 1\n4 6", "output": "127\n"}, {"input": "129 1\n6 6", "output": "128\n"}, {"input": "110 1\n3 1", "output": "108\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\nDima's got a staircase that consists of n stairs. The first stair is at height a_1, the second one is at a_2,...
[{"input": "5\n1 2 3 6 6\n25\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 10000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 line of $n$ colored squares in a row, numbered from $1$ to $n$ from left to right. The $i$-th...
[{"input": "93\n2805 3621 1888 921 2394 2426 3424 739 4404 1923 2043 1106 305 788 546 1396 2252 4915 1857 1833 2601 3148 1768 1079 893 4669 1939 1231 1019 4578 3202 3645 352 4730 2074 1251 736 168 1377 4630 1542 3083 222 2864 1 4838 1319 1037 4297 552 304 2638 3278 518 4563 513 4313 4620 4907 4990 4785 2808 4135 4171 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 an integer $x$ of $n$ digits $a_1, a_2, \\ldots, a_n$, which make up its decimal notation in or...
[{"input": "20 10\n21474836472147483648\n", "output": "20\n21474836482147483648\n"}, {"input": "20 19\n19999999999999999999\n", "output": "20\n20000000000000000002\n"}, {"input": "20 19\n19999999999999999999\n", "output": "20\n20000000000000000002\n"}, {"input": "20 10\n21474836472147483648\n", "output": "20\n214748364...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Chef's house there are N apples lying in a row on the floor. These apples are numbered from 1 (left most o...
[{"input": "5 12\n1 4 4 2 -1", "output": "-1\n"}, {"input": "5 24\n1 4 4 2 -1", "output": "-1\n"}, {"input": "5 24\n1 7 4 2 -1", "output": "-1\n"}, {"input": "5 24\n1 6 4 2 -1", "output": "-1\n"}, {"input": "5 24\n1 6 2 2 -1", "output": "-1\n"}, {"input": "5 16\n1 4 4 2 1", "output": "-1\n"}, {"input": "5 16\n1 4 4 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\nYou are given a string $s$ consisting of lowercase Latin letters. Let the length of $s$ be $|s|$. You may per...
[{"input": "100\nyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n", "output": "99\n"}, {"input": "100\naaaaaabbcccccccddffffhhhhhhhhiiiiiikkkkkkkkmmmmmmooooooopppprrrrrrrrrttttttvvvvvvvvvvvvxxxxxxxzzzzzz\n", "output": "21\n"}, {"input": "100\nbabaababbaabbabababbabb...
code_stdio
[ { "content": "You are an expert Python programmer. 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 numbers 1 to n x n are contained in the n x n square squares one by one, and the sum of the squares in an...
[{"input": "3\n29\n0", "output": " 4 9 2\n 3 5 7\n 8 1 6\n 407 828 379 800 351 772 323 744 295 716 267 688 239 660 211 632 183 604 155 576 127 548 99 520 71 492 43 464 15\n 16 408 829 380 801 352 773 324 745 296 717 268 689 240 661 212 633 184 605 156 577 128 549 100 521 72 493 44 436\n 437 17...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a program which manipulates a sequence A = {a0, a1, . . . , an-1} with the following operations:\n\n* f...
[{"input": "5 5\n0 0 0\n1 2 4\n1 0 0\n1 1 9\n1 1 2", "output": "2147483647\n0\n2147483647\n2147483647\n"}, {"input": "6 5\n1 0 0\n0 1 2\n1 2 3\n1 0 2\n1 2 2", "output": "2147483647\n2147483647\n2\n2147483647\n"}, {"input": "3 5\n0 0 1\n1 1 2\n1 2 2\n1 0 3\n1 0 8", "output": "2147483647\n2147483647\n1\n1\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\nThe last stage of Football World Cup is played using the play-off system.\n\nThere are n teams left in this s...
[{"input": "256 128 256\n", "output": "Final!\n"}, {"input": "256 128 129\n", "output": "Final!\n"}, {"input": "256 255 128\n", "output": "Final!\n"}, {"input": "256 107 129\n", "output": "Final!\n"}, {"input": "256 107 240\n", "output": "Final!\n"}, {"input": "256 128 129\n", "output": "Final!"}, {"input": "256 128 25...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nReverse every other word in a given string, then return the string. Throw away any leading or trailing whites...
[{"input": "\"I really hope it works this time...\"", "output": "[\"I yllaer hope ti works siht time...\"]", "fn_name": "reverse_alternate"}, {"input": "\"Reverse this string, please!\"", "output": "[\"Reverse siht string, !esaelp\"]", "fn_name": "reverse_alternate"}, {"input": "\"This is not a test \"", "output": "[\"...
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\nDr .: Peter, I've finally done it.\n\nPeter: See you again? What kind of silly invention is this time?\n\nDr ...
[{"input": "10 0 82 - /\n4 5 - 31 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n-155.000000\n-1.000000\n"}, {"input": "10 0 82 - /\n4 5 - 60 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n-300.000000\n-1.000000\n"}, {"input": "10 0 82 - /\n4 0 - 60 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n1200.000000\n-1.000000\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\nGiven a string of integers, count how many times that integer repeats itself, then return a string showing th...
[{"input": "\"12322212223443\"", "output": "[\"111213321132132413\"]", "fn_name": "count_me"}, {"input": "\"1123\"", "output": "[\"211213\"]", "fn_name": "count_me"}, {"input": "\"1211\"", "output": "[\"111221\"]", "fn_name": "count_me"}, {"input": "\"21\"", "output": "[\"1211\"]", "fn_name": "count_me"}, {"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 participants of the competition were split into m teams in some manner so that each team has at least one p...
[{"input": "1011000000 0001000\n", "output": "511059994500000 511059489505999500\n"}, {"input": "1011100000 0001000\n", "output": "511161099450000 511160594406049500\n"}, {"input": "1011110000 0001000\n", "output": "511171210495000 511170705446054500\n"}, {"input": "1011110000 0001100\n", "output": "464701054490500 511...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nShapur was an extremely gifted student. He was great at everything including Combinatorics, Algebra, Number T...
[{"input": "1010000011010110011101001101110001110010000111011101110010110110111111001001110100101100010101010001\n0111101000111100101100000101111010100100001000011101010100110011100011010011010101000100101011100011\n", "output": "110110101110101011000100100000101101011000111100000010011000010101110001101010000110100011...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nAt the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice ...
[{"input": "800\n1126\n900\n198\n330", "output": "948\n"}, {"input": "800\n1126\n900\n132\n330", "output": "882\n"}, {"input": "800\n1126\n206\n132\n330", "output": "288\n"}, {"input": "800\n1126\n180\n132\n330", "output": "262\n"}, {"input": "800\n1126\n180\n29\n330", "output": "159\n"}, {"input": "800\n1126\n280\n29\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJeff has become friends with Furik. Now these two are going to play one quite amusing game.\n\nAt the beginni...
[{"input": "95\n68 56 24 89 79 20 74 69 49 59 85 67 95 66 15 34 2 13 92 25 84 77 70 71 17 93 62 81 1 87 76 38 75 31 63 51 35 33 37 11 36 52 23 10 27 90 12 6 45 32 86 26 60 47 91 65 58 80 78 88 50 9 44 4 28 29 22 8 48 7 19 57 14 54 55 83 5 30 72 18 82 94 43 46 41 3 61 53 73 39 40 16 64 42 21\n", "output": "5076"}, {"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\nAn array is called `centered-N` if some `consecutive sequence` of elements of the array sum to `N` and this s...
[{"input": "[0, 0, 0, -1, 1, 1, -1, 0, 0, 0]\n0", "output": "[true]", "fn_name": "is_centered"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n0", "output": "[true]", "fn_name": "is_centered"}, {"input": "[3, 2, 10, 4, 1, 6, 9]\n15", "output": "[true]", "fn_name": "is_centered"}, {"input": "[2, 10, 4, 1, 6, 9]\n15", "outp...
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\nLittle Artem found a grasshopper. He brought it to his house and constructed a jumping area for him.\n\nThe a...
[{"input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 6\n", "output": "INFINITE\n"}, {"input": "10\n>>>>>>>>><\n2 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 2 1 1 100\n", "output": "FINITE\n"}, {"input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 4\n", "output": "INFINITE\n"}, {"input": "10\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He w...
[{"input": "10000000 10000000\n", "output": "425362313\n"}, {"input": "10000000 9999999\n", "output": "930564389\n"}, {"input": "3865975 13943620\n", "output": "633381536\n"}, {"input": "6407688 3000816\n", "output": "895399645\n"}, {"input": "1507925 5483803\n", "output": "727607740\n"}, {"input": "9900111 1082917\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\n### Background\nIn classical cryptography, the Hill cipher is a polygraphic substitution cipher based on line...
[{"input": "\"Five + Seven = Twelve\"\n\"math\"", "output": "[\"IVSLIGSLAQEECSWR\"]", "fn_name": "encrypt"}, {"input": "\"CODEWARS IS GREAT\"\n\"wxyz\"", "output": "[\"CICQQIIASSDXKSFP\"]", "fn_name": "encrypt"}, {"input": "\"This is a good day\"\n\"bbaa\"", "output": "[\"AAAAAAGACAGAYA\"]", "fn_name": "encrypt"}, {"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\nAlice and Brown loves games. Today, they will play the following game.\nIn this game, there are two piles ini...
[{"input": "13 -1", "output": "Alice\n"}, {"input": "-1 10", "output": "Alice\n"}, {"input": "18 -1", "output": "Alice\n"}, {"input": "-1 14", "output": "Alice\n"}, {"input": "14 -1", "output": "Alice\n"}, {"input": "-1 12", "output": "Alice\n"}, {"input": "-1 21", "output": "Alice\n"}, {"input": "-1 20", "output": "Al...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwin adventurers Rin and Len are searching for treasure in the Mirror Cave. The cave has two pairs of rooms, ...
[{"input": "5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .&.\n4 1\nL.%. %..R\n0 0", "output": "Yes\nNo\nNo\n"}, {"input": "5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .&.\n4 1\nL.$. %..R\n0 0", "output": "Yes\nNo\nNo\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\nHomer has two friends Alice and Bob. Both of them are string fans.\n\nOne day, Alice and Bob decide to play a...
[{"input": "5\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nazazazazazazazazazazazazazazazazazazazazazazazazaz\nzazazazazazazazazazazazazazazazazazazazazazazazaza\nzzazzazzazzazzazzazzazzazzazzazzazzazzazzazza\n", "output": "bzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbzbz...
code_stdio
[ { "content": "You are an expert Python programmer. 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 name, turn that name into a perfect square matrix (nested array with the amount of arrays equivalent ...
[{"input": "\"Franklin\"", "output": "[[[\"F\", \"r\", \"a\"], [\"n\", \"k\", \"l\"], [\"i\", \"n\", \".\"]]]", "fn_name": "matrixfy"}, {"input": "\"Beyonce\"", "output": "[[[\"B\", \"e\", \"y\"], [\"o\", \"n\", \"c\"], [\"e\", \".\", \".\"]]]", "fn_name": "matrixfy"}, {"input": "\"Frank\"", "output": "[[[\"F\", \"r\",...
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 $n$ books, numbered from $1$ to $n$, arranged in a stack. The topmost book has number $a_1$, th...
[{"input": "10\n4 7 10 2 1 8 3 5 9 6\n4 2 7 1 8 10 5 3 9 6\n", "output": "1 3 0 1 1 0 2 0 1 1 \n"}, {"input": "10\n4 7 10 2 1 8 3 5 9 6\n4 2 7 1 8 10 5 3 9 6\n", "output": "1 3 0 1 1 0 2 0 1 1 "}, {"input": "10\n4 7 10 2 1 8 3 5 9 6\n4 2 7 1 8 10 5 3 7 6\n", "output": "1 3 0 1 1 0 2 0 0 2\n"}, {"input": "10\n4 7 10 2 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\nD: The Diversity of Prime Factorization\n\nProblem\n\nEbi-chan has the FACTORIZATION MACHINE, which can facto...
[{"input": "3\n2 3 11", "output": "3\n"}, {"input": "3\n2 2 11", "output": "1\n"}, {"input": "3\n2 2 13", "output": "1\n"}, {"input": "3\n2 3 17", "output": "3\n"}, {"input": "3\n2 2 15", "output": "0\n"}, {"input": "3\n3 2 11", "output": "1\n"}, {"input": "3\n2 2 17", "output": "1\n"}, {"input": "3\n4 3 10", "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\nWe start with a permutation $a_1, a_2, \\ldots, a_n$ and with an empty array $b$. We apply the following oper...
[{"input": "6\n2 1\n2 1\n1\n3 2\n1 3 2\n1 3\n4 2\n4 1 3 2\n1 2\n5 3\n4 3 2 5 1\n1 4 5\n6 3\n2 4 5 6 1 3\n2 4 5\n7 3\n7 6 4 3 2 1 5\n1 2 6\n", "output": "1\n0\n2\n0\n0\n4\n"}, {"input": "6\n2 1\n2 1\n1\n3 2\n1 3 2\n1 3\n4 2\n4 1 3 2\n1 2\n5 3\n4 3 2 5 1\n1 4 5\n6 3\n2 4 5 6 1 3\n2 4 5\n7 3\n7 6 4 3 2 1 5\n1 2 6\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour.\n\nLet's call colo...
[{"input": "15\n1 2 3 1 2 3 3 1 1 3 2 2 1 2 3\n1 2\n1 3\n1 4\n1 14\n1 15\n2 5\n2 6\n2 7\n3 8\n3 9\n3 10\n4 11\n4 12\n4 13\n", "output": "6 5 4 3 2 3 3 1 1 3 2 2 1 2 3 \n"}, {"input": "15\n1 2 3 1 2 3 3 1 1 3 2 2 1 2 3\n1 2\n1 3\n1 4\n1 14\n1 15\n2 5\n2 6\n2 7\n3 8\n3 9\n3 10\n4 11\n4 12\n4 13\n", "output": "6 5 4 3 2 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, h...
[{"input": "100\n0 0 0 0 0 0 1 4 4 0 2 2 4 1 7 1 11 0 8 4 12 12 3 0 3 2 2 4 3 9 1 5 4 6 9 14 6 2 4 18 7 7 19 11 20 13 17 16 0 34 2 6 12 27 9 4 29 22 4 20 20 17 17 20 37 53 17 3 3 15 1 46 11 24 31 6 12 6 11 18 13 1 5 0 19 10 24 41 16 41 18 52 46 39 16 30 18 23 53 13\n", "output": "66\n"}, {"input": "100\n0 0 0 0 0 0 1 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\nFarmer John has just given the cows a program to play with! The program contains two integer variables, x and...
[{"input": "98\n94 24 17 92 275858941 58 91 57 13 468038892 42 195790073 494005784 8 468106970 518962936 33 27 61 72 42 206673418 10 82 23 34 29 77 90 39 9 67 34 71 29 95 49 48 60 69 86 64 94 77 48 74 19 96700186 5 67 881058074 663483223 64 64 78 23 8 60 7 17 96 71 70 20 5 63 35 34 63 30 86 76 32 86 11 6 96 10 4 378916...
code_stdio
[ { "content": "You are an expert Python programmer. 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 input string.\n\nFor each symbol in the string if it's the first character occurrence, repla...
[{"input": "\"In this string, I'll make sure the amounts of a character go over 9\"", "output": "[\"11111112221221132112411115312263237221234482193101343525441123124155131\"]", "fn_name": "numericals"}, {"input": "\"hope you 123456789 expected numbers in the string\"", "output": "[\"111111212111111111321231141412115115...
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 are various parking lots such as three-dimensional type and tower type in the city to improve the utili...
[{"input": "5 5\n136\n68\n82\n84\n114\n2 4\n14\n30\n118\n54\n0 0", "output": "2 3 4 1 5\n1 2 4 3\n"}, {"input": "2 5\n123\n52\n195\n87\n105\n2 4\n18\n30\n80\n24\n0 0", "output": "4 2 3 1 5\n1 2 4 3\n"}, {"input": "1 5\n123\n52\n105\n87\n105\n2 4\n18\n30\n80\n14\n0 0", "output": "2 3 1 5 4\n1 2 4 3\n"}, {"input": "1 5\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\nAlexey is travelling on a train. Unfortunately, due to the bad weather, the train moves slower that it should...
[{"input": "2\n2\n2 4\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "\n12\n32\n"}, {"input": "2\n2\n2 4\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "12\n32\n"}, {"input": "2\n2\n2 3\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "12\n32\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\nYou are given an array $a$ of $n$ ($n \\geq 2$) positive integers and an integer $p$. Consider an undirected ...
[{"input": "1\n10 195593331\n886547706 549473499 719535263 337021357 357872635 1071822623 699988186 10455 29750933 887846992\n", "output": "1760339979\n"}, {"input": "1\n10 121406599\n432485522 549473499 522487623 1009120577 698965406 845977171 252631181 1770 81120106 717095635\n", "output": "1092659391\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\nThe goal of this exercise is to convert a string to a new string where each character in the new string is `\...
[{"input": "\"Supralapsarian\"", "output": "[\")()))()))))()(\"]", "fn_name": "duplicate_encode"}, {"input": "\"CodeWarrior\"", "output": "[\"()(((())())\"]", "fn_name": "duplicate_encode"}, {"input": "\"Success\"", "output": "[\")())())\"]", "fn_name": "duplicate_encode"}, {"input": "\"recede\"", "output": "[\"()()()\...
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 to restore the wall. The wall consists of $N$ pillars of bricks, the height of the $i$-th pillar is ...
[{"input": "100 20 149 72\n67 101 52 15 0 92 26 74 44 61 6 44 45 19 22 8 10 85 67 78 24 61 81 99 62 84 9 71 11 65 5 97 3 72 5 81 81 104 65 85 52 21 20 53 66 91 4 75 84 139 72 27 50 26 9 65 14 6 54 68 6 2 89 78 40 45 98 45 27 51 94 72 67 81 20 19 38 64 14 40 57 21 82 99 37 113 21 22 30 14 73 93 60 8 63 25 27 30 32 13\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\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \...
[{"input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n", "output": "20 20 20 20 20 20\n"}, {"input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n2 10\n1 10", "output": "10 20 10 20 20 10\n"}, {"input": "6 1\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10", "output": "10 10 10 10 10 10\n"}, {"input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 14\n1 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\nWe have N camels numbered 1,2,\\ldots,N. Snuke has decided to make them line up in a row.\n\nThe happiness of...
[{"input": "3\n2\n1 3 10\n2 15 10\n3\n2 93 78\n1 71 59\n3 57 129\n19\n19 22 16\n5 90 13\n12 85 70\n19 67 78\n18 16 16\n18 48 28\n5 4 24\n12 97 97\n4 57 87\n18 91 74\n18 100 76\n12 31 11\n9 100 57\n3 76 73\n6 84 93\n1 6 139\n11 75 120\n19 15 3\n12 11 34", "output": "25\n221\n1335\n"}, {"input": "3\n2\n1 3 10\n2 15 10\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhen naming identifiers (variables and functions) in programming, compound words that concatenate words are u...
[{"input": "get^user_name L\ngetTserNbme U\nemaNresUteG D\nEndOfInput X", "output": "get^userName\nGetTserNbme\nema_nres_ute_g\n"}, {"input": "get^user_name L\nembNresTteg U\nemaNresUteG D\nEndOfInput X", "output": "get^userName\nEmbNresTteg\nema_nres_ute_g\n"}, {"input": "get_user_nbme L\ngetUserOame U\nemaNresUteG D\...
code_stdio
[ { "content": "You are an expert Python programmer. 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$ integers, where $n$ is odd. You can make the following operation with it: ...
[{"input": "23 290352079\n162011045 845692742 774584765 103906675 222286673 251540072 1067675108 30856336 71306611 790640347 835976636 327687572 387722548 48938195 769656348 341889962 393959831 928029640 320443541 248114937 798473713 159552755 814528707\n", "output": "471308140\n"}, {"input": "23 290352079\n285170966 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\nNicholas, a painter is going to paint several new canvases. Nicholas is sure that the canvases will turn out ...
[{"input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp's workday lasts exactly $n$ minutes. He loves chocolate bars and can eat one bar in one minute. Toda...
[{"input": "100 19\n0011011110011111111010111101101100101111111111011011111111110111101111101111111101111011111011101110\n", "output": "10\n"}, {"input": "100 19\n0011011110011111111010111101101100101111111111011011111111110111101111101111111101111011111011101110\n", "output": "10\n"}, {"input": "100 89\n00110111100111...
code_stdio
[ { "content": "You are an expert Python programmer. 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 executive chef is trying to bring some competitive spirit into his kitchen. He wants to split the chefs i...
[{"input": "5\n6 2\n4 -1\n0 28\n3 1\n0 76", "output": "2\n3\n25\n28\n104\n"}, {"input": "5\n0 2\n0 -1\n12 11\n4 1\n5 25", "output": "2\n3\n10\n11\n34\n"}, {"input": "5\n0 2\n2 1\n12 20\n4 0\n13 11", "output": "2\n1\n17\n17\n28\n"}, {"input": "5\n6 1\n4 -1\n0 28\n0 1\n0 76", "output": "1\n2\n26\n29\n105\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 helped Dima to have a great weekend, but it's time to work. Naturally, Dima, as all other men who have gi...
[{"input": "50 10\n1 2 3 4 5 6 7 8 9 10 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1\n", "output": "2\n"}, {"input": "50 10\n1 2 3 4 5 4 7 8 9 10 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1\n", "output": "2\n"}, {"input": "50 10\n1 2 3 4 5 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\n**Principal Diagonal** -- The principal diagonal in a matrix identifies those elements of the matrix running ...
[{"input": "[[88, 2, 2, 5, 1, 1, 2, 2, 5, 1], [4, 1, 6, 1, 1, 1, 2, 2, 7, 1], [1, 8, 1, 6, 2, 1, 2, 1, 5, 1], [1, 5, 2, 7, 2, 1, 1, 2, 5, 1], [1, 8, 2, 6, 1, 1, 2, 2, 5, 1], [1, 2, 2, 5, 1, 1, 2, 2, 5, 1], [1, 2, 2, 1, 1, 1, 1, 2, 5, 1], [1, 2, 1, 5, 1, 1, 2, 1, 5, 1], [1, 1, 2, 5, 1, 1, 2, 2, 1, 1], [88, 2, 2, 5, 1, 1...
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\nThe Fair Nut lives in $n$ story house. $a_i$ people live on the $i$-th floor of the house. Every person uses ...
[{"input": "100\n95 81 40 82 80 78 4 86 37 94 1 46 85 6 41 87 100 69 100 87 12 61 55 81 81 32 40 54 22 32 24 73 61 68 76 16 83 76 73 77 41 37 88 46 72 63 2 37 14 49 45 81 75 56 10 101 73 85 41 17 5 2 16 75 28 53 35 77 66 53 69 82 50 95 2 12 35 62 84 46 29 95 91 49 78 14 88 75 58 52 49 31 56 43 55 39 10 72 23 60\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\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) toge...
[{"input": "20 20\n", "output": "-1\n"}, {"input": "33 106", "output": "-1\n"}, {"input": "5 10\n", "output": "-1\n"}, {"input": "1 11\n", "output": "-1\n"}, {"input": "20 1\n", "output": "-1\n"}, {"input": "11 3\n", "output": "-1\n"}, {"input": "3 14\n", "output": "-1\n"}, {"input": "16 4\n", "output": "-1\n"}, {"inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\nT...
[{"input": "19", "output": "[232792560]", "fn_name": "smallest"}, {"input": "20", "output": "[232792560]", "fn_name": "smallest"}, {"input": "17", "output": "[12252240]", "fn_name": "smallest"}, {"input": "18", "output": "[12252240]", "fn_name": "smallest"}, {"input": "13", "output": "[360360]", "fn_name": "smallest"},...
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\nThree years have passes and nothing changed. It is still raining in London, and Mr. Black has to close all th...
[{"input": "250\n1 0 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 1 0 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\nC: Prayer (Pray)\n\nSome twins are famous for praying before the contest.\n\nThere are four integers $ H, W, ...
[{"input": "-1 -1 -3 -1", "output": "Yes\n"}, {"input": "-2 -1 -3 -1", "output": "Yes\n"}, {"input": "-2 -1 -4 -1", "output": "Yes\n"}, {"input": "0 -1 -4 -1", "output": "Yes\n"}, {"input": "0 -1 -3 -1", "output": "Yes\n"}, {"input": "-1 -1 -2 0", "output": "Yes\n"}, {"input": "0 -1 -5 -1", "output": "Yes\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\nAfter seeing the \"ALL YOUR BASE ARE BELONG TO US\" meme for the first time, numbers X and Y realised that th...
[{"input": "10 40\n39 39 39 39 39 39 39 39 39 39\n10 39\n38 38 38 38 38 38 38 38 38 38\n", "output": ">\n"}, {"input": "10 40\n39 39 39 14 39 39 39 39 39 39\n10 39\n38 38 38 38 38 38 38 38 38 38\n", "output": ">\n"}, {"input": "10 38\n16 19 37 32 16 7 14 33 16 11\n10 39\n10 27 35 15 31 15 17 16 38 35\n", "output": ">\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\nX and A are integers between 0 and 9 (inclusive).\nIf X is less than A, print 0; if X is not less than A, pri...
[{"input": "11 -1", "output": "10\n"}, {"input": "10 -1", "output": "10\n"}, {"input": "19 -1", "output": "10\n"}, {"input": "-1 -1", "output": "10\n"}, {"input": "10 -2", "output": "10\n"}, {"input": "14 -2", "output": "10\n"}, {"input": "14 -1", "output": "10\n"}, {"input": "-2 -2", "output": "10\n"}, {"input": "7 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\nLittle beaver is a beginner programmer, so informatics is his favorite subject. Soon his informatics teacher ...
[{"input": "11 18 8\n4744 4993 1340 4982 4982 1437 2765 2200 6975 4989 10703\n", "output": "1358\n"}, {"input": "11 18 8\n4744 4993 7957 4982 4982 1437 2765 2200 6975 4989 10703\n", "output": "1455\n"}, {"input": "11 18 8\n4996 4993 4988 4982 4982 4982 4982 4982 4986 4989 4994\n", "output": "5000\n"}, {"input": "11 18 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nGiven a positive integer, `n`, return the number of possible ways such that `k` positive integers ...
[{"input": "1000000\n3", "output": "[784]", "fn_name": "multiply"}, {"input": "36\n4", "output": "[100]", "fn_name": "multiply"}, {"input": "100\n1", "output": "[1]", "fn_name": "multiply"}, {"input": "20\n3", "output": "[18]", "fn_name": "multiply"}, {"input": "24\n2", "output": "[8]", "fn_name": "multiply"}, {"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\nOn Children's Day, the child got a toy from Delayyy as a present. However, the child is so naughty that he ca...
[{"input": "10 30\n3 6 17 15 13 25 9 12 12 1\n3 8\n1 10\n4 7\n1 7\n3 7\n2 9\n8 10\n3 1\n3 4\n8 6\n10 3\n6 9\n2 3\n10 4\n2 10\n5 8\n9 5\n6 1\n2 1\n7 2\n7 6\n7 10\n4 8\n5 6\n3 6\n4 1\n8 9\n7 9\n4 2\n5 10\n", "output": "211\n"}, {"input": "10 30\n3 6 25 15 13 25 9 12 12 1\n3 8\n1 10\n4 7\n1 7\n3 7\n2 9\n8 10\n3 1\n3 4\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\nPaul hates palindromes. He assumes that string s is tolerable if each its character is one of the first p let...
[{"input": "302 4\nabdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdc...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEdo has got a collection of n refrigerator magnets!\n\nHe decided to buy a refrigerator and hang the magnets ...
[{"input": "20 5\n1 12 21 22\n9 10 15 20\n10 12 12 20\n1 1 25 29\n5 10 21 22\n4 9 20 25\n12 10 14 24\n3 3 19 27\n3 4 23 28\n9 1 11 31\n9 14 17 18\n8 12 14 20\n8 11 18 19\n12 3 14 29\n7 8 13 22\n6 4 16 30\n11 3 13 27\n9 16 15 18\n6 13 14 21\n9 12 15 22\n", "output": "4\n"}, {"input": "20 5\n1 12 21 22\n9 10 15 20\n10 12...
code_stdio
[ { "content": "You are an expert Python programmer. 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 sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers...
[{"input": "10 998244353\n10 10 10 9 5 12 0 4 7 0", "output": "559205848\n"}, {"input": "10 1051516890\n10 15 10 1 5 4 0 8 4 0", "output": "142815647\n"}, {"input": "10 918571889\n10 9 10 7 7 3 0 11 4 0", "output": "551061978\n"}, {"input": "10 1051516890\n10 9 10 7 5 5 0 4 4 0", "output": "818429624\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\nPetya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representat...
[{"input": "691900\n", "output": "4444477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
code_stdio
[ { "content": "You are an expert Python programmer. 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 G Rendezvous on a Tetrahedron\n\nOne day, you found two worms $P$ and $Q$ crawling on the surface of ...
[{"input": "CD 51 1\nDB 30 1", "output": "YES\n"}, {"input": "CD 51 1\nDB 55 1", "output": "YES\n"}, {"input": "CD 51 1\nDB 19 1", "output": "YES\n"}, {"input": "CD 30 1\nDB 30 2", "output": "YES\n"}, {"input": "CD 51 1\nDB 56 1", "output": "YES\n"}, {"input": "CD 20 1\nDB 103 0", "output": "NO\n"}, {"input": "CD 29 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\nPetya recieved a gift of a string s with length up to 10^5 characters for his birthday. He took two more empt...
[{"input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"}, {"input": "bababaaababaabbbbbabbbbbbaaabbabaaaaabbbbbaaaabbbbabaabaabababbbabbabbabaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nZane the wizard is going to perform a magic show shuffling the cups.\n\nThere are n cups, numbered from 1 to ...
[{"input": "203948 2 14\n203948 203947\n39 47\n4959 3030\n1 203947\n2929 12381\n203944 203948\n203947 203944\n203944 203922\n203922 203948\n2495 20495\n29419 5959\n12949 12\n49 29292\n1 94\n1 203\n", "output": "203947\n"}, {"input": "203948 2 14\n203948 203947\n39 38\n4959 3030\n1 203947\n2929 9292\n203944 203948\n2039...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAyoub had an array $a$ of integers of size $n$ and this array had two interesting properties: All the integ...
[{"input": "101149 1300011130 1476544836\n", "output": "156648241\n"}, {"input": "101149 686320621 1476544836\n", "output": "113944181\n"}, {"input": "120881 536336525 585696606\n", "output": "915864703\n"}, {"input": "121382 445163929 988375913\n", "output": "594431176\n"}, {"input": "126028 622192701 881885560\n", "o...
code_stdio