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\nStudent Andrey has been skipping physical education lessons for the whole term, and now he must somehow get a...
[{"input": "8 8\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n", "output": "NO\n"}, {"input": "8 8\n.#.#.#.#\n.#.#.#.#\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n", "output": "NO\n"}, {"input": "8 8\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\nIn Omkar's last class of math, he learned about the least common multiple, or $LCM$. $LCM(a, b)$ is the small...
[{"input": "10\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n", "output": "500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n50...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDanny, the local Math Maniac, is fascinated by circles, Omkar's most recent creation. Help him solve this cir...
[{"input": "41\n67695023 47580738 52676259 26530025 83455112 2392302 23011073 86422683 148437329 42852564 97383338 95729385 6219705 42027049 79082264 1205076 1191075 18025596 75651485 93690196 63851880 23817841 79285846 9296266 60979868 62770176 40911517 96687661 35967137 55930828 78662969 51939718 99402988 89044881 66...
code_stdio
[ { "content": "You are an expert Python programmer. 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, Tokitsukaze found an interesting game. Tokitsukaze had $n$ items at the beginning of this game. How...
[{"input": "1000000000000000000 20 365\n31881893160049984 103938857870698567 103962228223609431 140762820261865064 175962215264653912 239086305245565642 354522451098745823 383839975876242372 443471287955807705 478923027151493682 511195154588214957 619570919279066139 677571312513476877 705864797651447277 789633853044745...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a __moreZeros__ function which will __receive a string__ for input, and __return an array__ (or null t...
[{"input": "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_\"", "output": "[[\"a\", \"b\", \"d\", \"h\", \"p\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"H\", \"I\", \"J\", \"L\", \"P\", \"Q\", \"R\", \"T\", \"X\", \"0\"]]", "fn_name": "more_zeros"}, {"input": "\"THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG\...
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 a secret agent from the Intelligence Center of Peacemaking Committee. You've just sneaked into a secr...
[{"input": "10 1\n3\n1", "output": "Yes\n"}, {"input": "7 1\n6\n-1", "output": "Yes\n"}, {"input": "11 1\n3\n1", "output": "Yes\n"}, {"input": "6 2\n10\n3", "output": "Yes\n"}, {"input": "7 1\n6\n-2", "output": "Yes\n"}, {"input": "11 1\n2\n1", "output": "Yes\n"}, {"input": "17 1\n4\n0", "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\nUser ainta loves to play with cards. He has a cards containing letter \"o\" and b cards containing letter \"x...
[{"input": "29 89946\n", "output": "-269676073\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera loves his garden, where n fruit trees grow.\n\nThis year he will enjoy a great harvest! On the i-th tr...
[{"input": "24 1524\n16 934\n23 1940\n21 1447\n20 417\n24 1340\n22 1932\n13 775\n19 2918\n12 2355\n9 593\n11 2676\n3 1857\n16 868\n13 426\n18 1679\n22 991\n9 2728\n10 2497\n16 1221\n9 772\n23 2522\n24 982\n12 1431\n18 757\n", "output": "25893\n"}, {"input": "24 1524\n16 934\n23 1940\n21 1447\n20 417\n24 1340\n22 1932\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 recent All-Berland Olympiad in Informatics featured n participants with each scoring a certain amount of ...
[{"input": "100\n600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600...
code_stdio
[ { "content": "You are an expert Python programmer. 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 complete undirected graph. For each pair of vertices you are given the length of the edge tha...
[{"input": "10\n0 1 100 100 100 100 100 100 100 100\n1 0 1 100 100 100 100 100 100 100\n100 1 0 1 100 100 100 100 100 100\n100 100 1 0 1 100 100 100 100 100\n100 100 100 1 0 1 100 100 100 100\n100 100 100 100 1 0 1 100 100 100\n100 100 100 100 100 1 0 1 100 100\n100 100 100 100 100 100 1 0 1 100\n100 100 100 100 100 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\nHooray! Polycarp turned n years old! The Technocup Team sincerely congratulates Polycarp!\n\nPolycarp celebra...
[{"input": "6\n14\n2\n11\n100500\n23\n1000000000\n", "output": "10\n2\n10\n45\n11\n81\n"}, {"input": "6\n20\n1\n11\n100500\n57\n1000000000\n", "output": "10\n1\n10\n45\n14\n81\n"}, {"input": "6\n18\n1\n9\n100500\n65\n1000000000\n", "output": "10\n1\n9\n45\n14\n81\n"}, {"input": "6\n18\n2\n9\n100500\n33\n1000000000\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\nOn a clear night, a boy, Campanella looked up at the sky, there were many stars which have different colors s...
[{"input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 12 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 22 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 13 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"input": "8\n3 1 3 3 2 1 16 10\n7\n2 2 1 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\nValera's finally decided to go on holiday! He packed up and headed for a ski resort.\n\nValera's fancied a sk...
[{"input": "100\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n38 2 49 55 6 42 12 100 25 69 85 76 13 22 78 73 37 64 5 21 0 23 61 87 4 16 44 3 98 54 1 91 18 26 82 24 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSanta has to send presents to the kids. He has a large stack of $n$ presents, numbered from $1$ to $n$; the t...
[{"input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n2 1 7 3 4 5 6\n6 1\n", "output": "5\n14\n"}, {"input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n2 1 7 3 4 5 6\n4 1\n", "output": "5\n10\n"}, {"input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n4 1 7 3 2 5 4\n5 1\n", "output": "5\n12\n"}, {"input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n5 1 7 3 2 5 6\n3 2\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\nToday is the ticket release date for Aizu Entertainment's recommended idol group \"Akabeko & Koboushi\". Ther...
[{"input": "3 57\n1 4\n1 -2\n1 2", "output": "171000\n24000\n-12000\n12000\n"}, {"input": "3 57\n1 3\n1 -2\n1 2", "output": "171000\n18000\n-12000\n12000\n"}, {"input": "3 16\n1 4\n1 -2\n1 5", "output": "48000\n24000\n-12000\n30000\n"}, {"input": "3 16\n1 4\n1 -2\n1 2", "output": "48000\n24000\n-12000\n12000\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\nIn the speed skating badge test, grades are awarded when the time specified for two distances is exceeded. Fo...
[{"input": "70.02963720383003 94.72312922368101\n103.91489947609344 168.84078141503855", "output": "NA\nNA\n"}, {"input": "50.825010742906116 75.69989732783311\n82.26479437960049 146.33206365267094", "output": "D\nNA\n"}, {"input": "40.991466890252646 70.71729331330802\n73.89035215619808 141.43642793972484", "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\nImp is in a magic forest, where xorangles grow (wut?)\n\n [Image] \n\nA xorangle of order n is such a non-deg...
[{"input": "2500\n", "output": "700393\n"}, {"input": "1216\n", "output": "160822\n"}, {"input": "2140\n", "output": "614785\n"}, {"input": "1488\n", "output": "239580\n"}, {"input": "1040\n", "output": "145820\n"}, {"input": "1965\n", "output": "545494\n"}, {"input": "1703\n", "output": "352045\n"}, {"input": "1051\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, who works at DISCO, is standing before an iron bar. The bar has N-1 notches, which divide the bar ...
[{"input": "12\n101 104 102 187 103 176 110 117 104 102 104 111", "output": "125\n"}, {"input": "12\n001 104 102 187 191 176 110 117 104 102 104 011", "output": "139\n"}, {"input": "12\n001 104 102 187 191 176 110 117 104 102 132 011", "output": "167\n"}, {"input": "12\n100 104 102 105 103 103 100 117 104 102 104 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\nThe only difference between the easy and the hard versions is the maximum value of $k$.\n\nYou are given an i...
[{"input": "19\n1\n10\n100\n1000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n10000000000\n100000000000\n1000000000000\n10000000000000\n100000000000000\n1000000000000000\n10000000000000000\n100000000000000000\n1000000000000000000\n", "output": "1\n4\n1\n4\n9\n2\n6\n2\n6\n8\n1\n1\n9\n8\n3\n7\n6\n1\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\nCreate a program of the square picking method, which is one of the classical random number generation methods...
[{"input": "2\n387\n615", "output": "Case 1:\n1497\n2410\n8081\n3025\n1506\n2680\n1824\n3269\n6863\n1007\nCase 2:\n3782\n3035\n2112\n4605\n2060\n2436\n9340\n2356\n5507\n3270\n"}, {"input": "2\n210\n567", "output": "Case 1:\n441\n1944\n7791\n6996\n9440\n1136\n2904\n4332\n7662\n7062\nCase 2:\n3214\n3297\n8702\n7248\n5335...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInaka has a disc, the circumference of which is n units. The circumference is equally divided by n points num...
[{"input": "30000 28\n10601 1119\n11119 20601\n9493 25771\n14351 4869\n13101 3619\n23101 13619\n29869 9351\n6119 15601\n3101 23619\n1851 22369\n11851 2369\n8619 18101\n19579 12933\n18619 28101\n16851 7369\n8101 28619\n24869 4351\n24351 14869\n2690 6851\n9869 19351\n5601 26119\n3976 21301\n21851 12369\n25601 16119\n2449...
code_stdio
[ { "content": "You are an expert Python programmer. 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 need to execute several tasks, each associated with number of processors it needs, and the compute power ...
[{"input": "50\n83 43 73 75 11 53 10 43 67 38 83 12 70 27 60 13 9 79 61 30 29 71 10 11 95 87 26 26 19 99 13 47 66 93 91 47 90 75 68 3 22 29 59 12 44 41 64 3 99 100\n13 36 69 25 18 33 15 70 12 91 41 44 1 96 80 74 12 80 16 82 88 25 87 17 53 63 3 42 81 6 50 78 34 68 65 78 94 14 53 14 41 97 63 44 21 62 95 37 36 31\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\nVova has taken his summer practice this year and now he should write a report on how it went.\n\nVova has alr...
[{"input": "94 3\n4 2 1 6 1 1 1 5 1 3 3 3 6 1 6 6 3 5 3 1 4 1 3 6 4 5 3 4 6 5 5 2 1 5 4 5 6 5 2 2 6 5 4 6 1 3 5 1 2 5 5 2 1 3 4 5 6 4 3 1 4 4 1 5 4 4 2 2 2 4 4 3 6 2 6 1 5 6 1 3 5 5 1 3 5 3 5 2 6 1 3 6 1 5\n5 6 3 5 4 1 4 6 3 1 4 4 3 3 6 2 1 1 4 6 4 2 4 1 3 1 5 3 6 2 5 6 1 6 6 2 2 2 2 5 2 6 1 4 1 5 1 3 6 6 5 3 2 6 6 2 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\nIn this kata, your task is to identify the pattern underlying a sequence of numbers. For example, if the sequ...
[{"input": "[-67, -66, -64, -61, -57, -52, -46, -39, -31, -22, -12, -2, 7, 15, 22, 28, 33, 37, 40, 42, 43]", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]]", "fn_name": "find_pattern"}, {"input": "[4, 5, 7, 6, 4, 2, 3, 5, 4, 2, 3, 5, 4, 2, 0, 1, 3, 2, 0, 1, 3, 2, 0, -2, -1, 1, 0, -2]", "out...
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\nIt seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis. Each of t...
[{"input": "42\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n", "output": "83\n"}, {"input": "42\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\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\nDuff is addicted to meat! Malek wants to keep her happy for n days. In order to be happy in i-th day, she nee...
[{"input": "12\n70 11\n18 27\n32 11\n26 158\n91 18\n97 12\n75 43\n75 21\n84 29\n16 3\n133 124\n21 124\n", "output": "6758\n"}, {"input": "12\n70 11\n21 27\n32 11\n26 158\n91 18\n97 12\n75 43\n75 21\n84 29\n16 3\n133 124\n21 124\n", "output": "6791\n"}, {"input": "12\n70 11\n21 27\n32 11\n26 158\n91 18\n97 12\n75 30\n75...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConverting a normal (12-hour) time like \"8:30 am\" or \"8:30 pm\" to 24-hour time (like \"0830\" or \"2030\"...
[{"input": "12\n10\n\"am\"", "output": "[\"0010\"]", "fn_name": "to24hourtime"}, {"input": "12\n11\n\"am\"", "output": "[\"0011\"]", "fn_name": "to24hourtime"}, {"input": "12\n12\n\"am\"", "output": "[\"0012\"]", "fn_name": "to24hourtime"}, {"input": "12\n13\n\"am\"", "output": "[\"0013\"]", "fn_name": "to24hourtime"},...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n\"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no land...
[{"input": "205\n5 5 3 3 6 2 9 3 8 9 6 6 10 8 1 5 3 3 1 2 9 9 9 3 9 10 3 9 8 3 5 6 6 4 6 9 2 9 10 9 5 6 6 7 4 2 6 3 4 1 10 1 7 2 7 7 3 2 6 5 5 2 9 3 8 8 7 6 6 4 2 2 6 2 3 5 7 2 2 10 1 4 6 9 2 3 7 2 2 7 4 4 9 10 7 5 8 6 5 3 6 10 2 7 5 6 6 8 3 3 9 4 3 5 7 9 3 2 1 1 3 2 1 9 3 1 4 4 10 2 5 5 8 1 4 8 5 3 1 10 8 6 5 8 3 5 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 can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a ra...
[{"input": "6\n-10\n38\n2\n4\n-2\n8", "output": "48\n"}, {"input": "6\n-17\n38\n2\n4\n-2\n8", "output": "55\n"}, {"input": "6\n-17\n33\n2\n1\n-3\n8", "output": "50\n"}, {"input": "6\n-17\n61\n2\n1\n-3\n8", "output": "78\n"}, {"input": "6\n-17\n45\n2\n1\n-3\n8", "output": "62\n"}, {"input": "6\n-20\n17\n1\n0\n-2\n0", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRemember the game 2048?\n\nThe main part of this game is merging identical tiles in a row. \n\n* Implement a ...
[{"input": "[2, 2, 2, 2, 2]", "output": "[[4, 4, 2, 0, 0]]", "fn_name": "merge"}, {"input": "[8, 16, 16, 8]", "output": "[[8, 32, 8, 0]]", "fn_name": "merge"}, {"input": "[2, 0, 2, 2]", "output": "[[4, 2, 0, 0]]", "fn_name": "merge"}, {"input": "[2, 0, 2, 4]", "output": "[[4, 4, 0, 0]]", "fn_name": "merge"}, {"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\nIn JavaScript, ```if..else``` is the most basic condition statement,\nit consists of three parts:```condition...
[{"input": "100", "output": "[9000]", "fn_name": "sale_hotdogs"}, {"input": "10", "output": "[900]", "fn_name": "sale_hotdogs"}, {"input": "11", "output": "[990]", "fn_name": "sale_hotdogs"}, {"input": "1", "output": "[100]", "fn_name": "sale_hotdogs"}, {"input": "2", "output": "[200]", "fn_name": "sale_hotdogs"}, {"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\nIn this problem, we only consider strings consisting of lowercase English letters.\n\nStrings s and t are sai...
[{"input": "8", "output": "aaaaaaaa\naaaaaaab\naaaaaaba\naaaaaabb\naaaaaabc\naaaaabaa\naaaaabab\naaaaabac\naaaaabba\naaaaabbb\naaaaabbc\naaaaabca\naaaaabcb\naaaaabcc\naaaaabcd\naaaabaaa\naaaabaab\naaaabaac\naaaababa\naaaababb\naaaababc\naaaabaca\naaaabacb\naaaabacc\naaaabacd\naaaabbaa\naaaabbab\naaaabbac\naaaabbba\naaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSonya was unable to think of a story for this problem, so here comes the formal description.\n\nYou are given...
[{"input": "75\n392 593 98 1017 515 448 220 310 475 79 539 294 208 828 75 534 875 493 94 205 656 105 546 493 60 188 222 108 788 504 809 621 934 455 307 236 630 298 938 62 850 421 839 134 950 256 934 817 209 559 866 67 990 835 534 672 733 768 757 516 959 893 275 315 692 927 321 554 801 805 885 12 67 245 495\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\nConsider the following arithmetic progression with n terms:\n\n* x, x + d, x + 2d, \\ldots, x + (n-1)d\n\n\n\...
[{"input": "2\n12 1 5\n42764 449743 2019", "output": "524160\n165266\n"}, {"input": "2\n12 1 5\n42764 376063 2019", "output": "524160\n455865\n"}, {"input": "2\n12 1 5\n23772 376063 2019", "output": "524160\n755257\n"}, {"input": "2\n23 1 5\n23772 376063 2019", "output": "687573\n755257\n"}, {"input": "2\n23 0 5\n23772...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRabbits and cats are competing. The rules are as follows.\n\nFirst, each of the two animals wrote n2 integers...
[{"input": "3 0 6 11\n2 0 4\n3 0 16\n0 8 5\n1 2 3\n21 5 4\n7 4 7\n20\n11\n6\n9\n10\n18\n6\n2\n3\n8", "output": "USAGI\n"}, {"input": "3 0 6 11\n2 0 4\n3 0 16\n0 8 5\n1 2 3\n21 5 4\n7 4 7\n20\n11\n1\n9\n10\n18\n6\n2\n3\n8", "output": "USAGI\n"}, {"input": "3 0 6 11\n2 0 4\n3 0 16\n0 8 5\n1 2 3\n21 5 4\n7 4 7\n20\n11\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\nVova's family is building the Great Vova Wall (named by Vova himself). Vova's parents, grandparents, grand-gr...
[{"input": "20\n10 5 2 3 5 7 7 9 4 9 9 4 9 7 7 5 3 2 5 10\n", "output": "YES\n"}, {"input": "14\n7 7 7 4 3 3 4 5 4 4 5 7 7 7\n", "output": "YES\n"}, {"input": "14\n7 7 7 4 3 3 4 5 4 8 5 7 7 7\n", "output": "YES\n"}, {"input": "13\n5 2 2 1 1 2 5 2 1 1 2 2 5\n", "output": "NO\n"}, {"input": "13\n5 2 2 1 1 2 5 2 1 2 2 2 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\nDenis, after buying flowers and sweets (you will learn about this story in the next task), went to a date wit...
[{"input": "10 10\n1101001\n0110000\n0111010\n0010000\n1010000\n0111000\n1011011\n1010010\n1101011\n1111110\n", "output": "9941743758\n"}, {"input": "10 10\n0101111\n0000000\n1111011\n1011011\n1011011\n1111011\n0010010\n1010010\n1101111\n0000000\n", "output": "8993391761\n"}, {"input": "10 10\n1101001\n0110000\n0111010...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a programing contest named SnakeUp, 2n people want to compete for it. In order to attend this contes...
[{"input": "3\n1000000\n999999 999998\n999997 999996 999995\n999994 999993 999992 999991\n999990 999989 999988 999987 999986\n", "output": "2 1 4 3 6 5\n"}, {"input": "3\n1000000\n999999 999998\n999997 999996 999995\n999994 999993 999992 999991\n999990 999989 999988 999987 999986\n", "output": "2 1 4 3 6 5\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 two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n...
[{"input": "2500 3750\n", "output": "4691251\n"}, {"input": "2048 2806\n", "output": "3078045\n"}, {"input": "446 491\n", "output": "118173\n"}, {"input": "602 293\n", "output": "43365\n"}, {"input": "2500 7500\n", "output": "1\n"}, {"input": "1198 3594\n", "output": "1\n"}, {"input": "148 35\n", "output": "666\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\nAlex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, the...
[{"input": "100\n2\n3\n1\n2\n3\n3\n3\n1\n1\n1\n1\n3\n3\n3\n3\n1\n2\n3\n3\n3\n3\n3\n3\n3\n1\n2\n2\n2\n3\n1\n1\n3\n3\n3\n3\n3\n3\n3\n3\n1\n2\n3\n3\n3\n1\n1\n1\n1\n3\n3\n3\n3\n1\n2\n3\n1\n2\n2\n2\n3\n3\n2\n1\n3\n3\n1\n2\n3\n1\n1\n1\n2\n2\n2\n3\n1\n1\n1\n1\n1\n1\n3\n2\n2\n2\n2\n2\n2\n3\n1\n2\n2\n2\n2\n2\n3\n3\n2\n1\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\nGiven an integer $x$. Your task is to find out how many positive integers $n$ ($1 \\leq n \\leq x$) satisfy $...
[{"input": "1000002 1000002 1000003 1000000000000\n", "output": "999998\n"}, {"input": "1000002 1000002 1000003 1000000000000\n", "output": "999998\n"}, {"input": "693528 398514 1000003 1000000000000\n", "output": "999995\n"}, {"input": "693528 398514 1000003 1000000000000\n", "output": "999995\n"}, {"input": "812415 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nStudent Dima from Kremland has a matrix $a$ of size $n \\times m$ filled with non-negative integers.\n\nHe wa...
[{"input": "1 249\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 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\nImplement `String#ipv4_address?`, which should return true if given object is an IPv4 address - four numbers ...
[{"input": "\"255.255.255.255\"", "output": "[true]", "fn_name": "ipv4_address"}, {"input": "\"10.256.30.40\"", "output": "[false]", "fn_name": "ipv4_address"}, {"input": "\"10.20.030.40\"", "output": "[false]", "fn_name": "ipv4_address"}, {"input": "\"127.0.0.0.1\"", "output": "[false]", "fn_name": "ipv4_address"}, {"...
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\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.\nThe sequence A ne...
[{"input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"input": "314159265 358979323846264338\n", "output": "31\n"}, {"input": "275278675 992237867823568722\n", "output": "32\n"}, {"input": "10000 10995116277760000\n", "output": "41\n"}, {"input": "1 1000000000000000000\n", "output": "60\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\nMr. Frugal bought a new house. He feels deeply in love with his new house because it has a comfortable living...
[{"input": "4 3\n0 1 1 1\n1 1 1 1\n1 1 1 1\n8 5\n0 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n1 0 1 1 1 1 1 1\n1 1 0 0 1 1 1 1\n0 1 1 1 0 1 1 1\n8 8\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n10 10\n1 1 1 1 1 1 1 1 1 1\n1 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\nA Narcissistic Number is a number of length n in which the sum of its digits to the power of n is equal to th...
[{"input": "115132219018763992565095597973971522401", "output": "[true]", "fn_name": "is_narcissistic"}, {"input": "4679307774", "output": "[true]", "fn_name": "is_narcissistic"}, {"input": "146511208", "output": "[true]", "fn_name": "is_narcissistic"}, {"input": "472335975", "output": "[true]", "fn_name": "is_narcissi...
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\nDima and his friends have been playing hide and seek at Dima's place all night. As a result, Dima's place got...
[{"input": "100\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 5 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 2 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 2 1 2 1 2\n", "output": "5\n"}, {"input": "100\n2 1 1 3 5 4 4 2 3 4 3 4 5 4 5 4 2 4 5 3 4 5 4 1 1 4 4 1 1 2 5 4 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a tree with N vertices numbered 1 through N.\nThe i-th edge connects Vertex x_i and y_i.\nEach verte...
[{"input": "20\n2 19\n5 13\n6 4\n15 6\n12 19\n13 19\n3 11\n12 3\n3 20\n16 13\n7 14\n3 17\n7 13\n10 20\n20 9\n12 18\n8 3\n10 1\n6 13\nWBWBWBBWWWBBWWBBBBBW", "output": "21\n"}, {"input": "20\n2 19\n5 13\n6 4\n15 6\n12 19\n13 19\n3 11\n12 3\n3 20\n16 13\n7 14\n3 17\n7 13\n10 20\n11 9\n8 18\n8 2\n10 1\n6 13\nWBWBWBBWWWBBWW...
code_stdio
[ { "content": "You are an expert Python programmer. 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 a multiset s consisting of n integer numbers. Vasya calls some number x nice if it appears in the m...
[{"input": "100\n92 90 95 93 93 96 93 94 96 97 96 100 93 93 90 95 94 99 100 93 100 98 91 90 90 96 97 94 93 98 90 97 96 100 100 95 99 99 92 96 98 90 92 97 91 94 100 100 99 91 91 97 93 92 97 94 91 91 100 100 94 95 100 100 100 92 92 90 97 93 96 92 91 97 100 96 94 96 97 95 96 90 100 95 95 94 93 99 97 91 93 93 93 99 94 93 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\nJust in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny tho...
[{"input": "1000 1000 1000\n", "output": "850431726\n"}, {"input": "1984 1847 1992\n", "output": "345702953\n"}, {"input": "2000 2000 2000\n", "output": "321179016\n"}, {"input": "1999 2000 2000\n", "output": "675798323\n"}, {"input": "1000 1000 1010\n", "output": "524700271\n"}, {"input": "2000 2000 2872\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\nWe all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the ...
[{"input": "123 54564\n38 44 41 42 59 3 95 15 45 32 44 69 35 83 94 57 65 85 64 47 24 20 34 86 26 91 98 12 36 96 80 4 70 40 95 38 70 22 58 50 34 84 80 45 14 60 61 43 11 56 19 59 50 63 35 15 97 98 27 13 9 71 32 18 90 10 2 99 75 87 74 83 79 37 89 3 49 27 92 95 49 1 26 82 72 75 81 37 60 98 28 28 10 93 99 63 14 26 69 51 47 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Berland each high school student is characterized by academic performance — integer value between 1 and 5....
[{"input": "100\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\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 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays...
[{"input": "100 3\n.*.\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\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\nDo you know the story about the three musketeers? Anyway, you must help them now.\n\nRichelimakieu is a cardi...
[{"input": "30\n34938093 71279712 25853338\n29827587 21741565 52179990 30235076 83272806 10815432 98887688 94542207 99870240 97586453 21739186 30460781 75347784 50711354 12162179 74306503 97398492 88466481 52489587 67579359 53177356 75077523 86044366 14405531 73916272 78242091 49321886 41937821 89258359 51438752\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\nIn this problem at each moment you have a set of intervals. You can move from interval (a, b) from our set to...
[{"input": "20\n1 1208 1583\n1 -258 729\n1 -409 1201\n1 194 1938\n1 -958 1575\n1 -1466 1752\n2 1 2\n2 1 2\n2 6 5\n1 -1870 1881\n1 -2002 2749\n1 -2002 2984\n1 -2002 3293\n2 2 4\n2 8 10\n2 9 6\n1 -2002 3572\n1 -2002 4175\n1 -2002 4452\n1 -2002 4605\n", "output": "YES\nYES\nYES\nYES\nYES\nNO\n"}, {"input": "20\n1 1208 158...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequentl...
[{"input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. 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, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D i...
[{"input": "-1000000000000000 1000000000000000 1000000000000000\n", "output": "1000000000000000\n"}, {"input": "1000000000000000 1000000000000000 1000000000000000\n", "output": "1000000000000000\n"}, {"input": "1000000000000000 1000100000000000 1000000000000000", "output": "1000000000000000\n"}, {"input": "110111010000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarpus got an internship in one well-known social network. His test task is to count the number of unique...
[{"input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14:34:59\n14:40:06\n14:53:13\n", "output": "6\n1\n2\n3\n3\n3\n3\n4\n5\n6\n6\n"}, {"input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14:34:59\n14:40:06\n14:53:13\n", "output": "6\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\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digi...
[{"input": "-1 3 13 -1", "output": "NO\n"}, {"input": "-1 2 13 -1", "output": "NO\n"}, {"input": "-1 2 17 -1", "output": "NO\n"}, {"input": "-1 2 -1 24", "output": "NO\n"}, {"input": "-1 2 17 -2", "output": "NO\n"}, {"input": "-1 1 -1 24", "output": "NO\n"}, {"input": "-1 4 17 -2", "output": "NO\n"}, {"input": "-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\nYou are given two strings $s$ and $t$, both consisting only of lowercase Latin letters.\n\nThe substring $s[l...
[{"input": "11 3 66\nssszzzzsssz\nsss\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n1 5\n2 5\n3 5\n4 5\n5 5\n1 6\n2 6\n3 6\n4 6\n5 10\n6 6\n1 7\n2 7\n3 7\n4 7\n5 7\n6 7\n7 7\n1 8\n2 8\n3 8\n4 8\n5 8\n6 8\n7 8\n8 8\n1 9\n2 9\n3 9\n4 9\n5 9\n6 9\n7 9\n8 9\n9 9\n1 10\n2 10\n3 10\n4 10\n5 10\n6 10\n7 10\n8 10\n9 10\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\nWhile Vasya finished eating his piece of pizza, the lesson has already started. For being late for the lesson...
[{"input": "100 2 1\n1 2 2 2 1 2 1 2 2 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 2 1 1 2 1 2 2 2 2 2 1 1 1 2 1 2 1 2 1 2 1 2 2 1 2 2 2 1 1 1 2 2 1 1 2 2 1 1 1 1 1 1 2 2 1 1 2 2 1 2 2 1 2 1 2 2 1 2 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 1\n", "output": "5200\n"}, {"input": "100 2 1\n1 2 2 2 1 2 1 2 2 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 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\nLittle Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother....
[{"input": "100\n42 23 48 88 36 6 18 70 96 1 34 40 46 22 39 55 85 93 45 67 71 75 59 9 21 3 86 63 65 68 20 38 73 31 84 90 50 51 56 95 72 33 49 19 83 76 54 74 100 30 17 98 15 94 4 97 5 99 81 27 92 32 89 12 13 91 87 29 60 11 52 43 35 58 10 25 16 80 28 2 44 61 8 82 66 69 41 24 57 62 78 37 79 77 53 7 14 47 26 64\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\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open ...
[{"input": "??p??d??\nabc\n", "output": "UNRESTORABLE\n"}, {"input": "?tc??@?\ncoder", "output": "UNRESTORABLE\n"}, {"input": "?tc??@?\ncnder", "output": "UNRESTORABLE\n"}, {"input": "?tc??@?\nendcr", "output": "UNRESTORABLE\n"}, {"input": "@tc??@?\nendcr", "output": "UNRESTORABLE\n"}, {"input": "@tc??@?\nendcq", "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\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 12 17 15 13 15 6 12 9 1\n3 8\n1 10\n4 7\n1 7\n3 7\n2 9\n8 10\n3 1\n3 4\n8 6\n10 3\n3 9\n2 3\n10 4\n2 10\n5 8\n9 5\n6 1\n2 1\n5 2\n7 6\n7 10\n4 8\n5 6\n3 6\n4 1\n8 9\n7 9\n4 2\n5 10\n", "output": "209\n"}, {"input": "10 30\n3 6 17 15 13 15 6 12 9 1\n3 8\n1 10\n4 7\n1 7\n3 7\n2 9\n8 10\n3 1\n3 4\n8 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\nToday we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are jus...
[{"input": "3\n4 6\n.R....\n......\n......\n.W....\n4 4\nR..W\n....\n....\n....\n5 1\nR\nW\nR\nW\nR\n", "output": "YES\nWRWRWR\nRWRWRW\nWRWRWR\nRWRWRW\nYES\nRWRW\nWRWR\nRWRW\nWRWR\nYES\nR\nW\nR\nW\nR\n"}, {"input": "3\n4 6\n.R....\n......\n......\n.W....\n4 4\n.R.W\n....\n....\n....\n5 1\nR\nW\nR\nW\nR\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\nGood evening, contestants.\n\nIf a and d are relatively prime positive integers, the arithmetic sequence begi...
[{"input": "367 186 151\n179 10 203\n271 37 39\n103 230 1\n27 104 285\n253 50 85\n1 1 1\n9075 337 210\n307 40 79\n331 221 177\n259 170 40\n269 75 102\n0 0 0", "output": "92809\n6709\n12037\n103\n153739\n14503\n2\n899429\n10667\n412717\n22699\n38669\n"}, {"input": "367 186 104\n179 10 203\n271 37 39\n73 230 2\n19 104 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\nTattah's youngest brother, Tuftuf, is new to programming.\n\nSince his older brother is such a good programme...
[{"input": "220\n10 6 6 2 8 6 6 5 6 2 10 3 9 10 10 2 3 5 2 2 4 7 6 6 7 5 6 2 10 10 1 1 2 2 3 2 4 4 8 1 1 2 1 10 9 2 1 4 2 1 7 4 8 4 2 9 7 7 6 6 8 3 1 9 10 6 3 5 9 5 1 1 8 3 10 8 10 3 7 9 2 4 8 2 8 4 10 5 7 10 6 8 3 5 7 9 4 2 6 2 2 7 7 2 10 1 1 8 7 4 8 8 9 1 1 9 5 5 5 3 5 5 3 2 6 4 7 9 10 9 3 1 10 1 7 8 8 7 6 5 1 5 6 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\n# Task\n CodeBots decided to make a gift for CodeMaster's birthday. They got a pack of candies of various siz...
[{"input": "[2, 4, 8, 1, 1, 32, 8, 8, 64, 30, 30, 15, 15, 7, 7]", "output": "[128]", "fn_name": "obtain_max_number"}, {"input": "[2, 4, 8, 1, 1, 15, 15, 7, 7, 7, 7, 7, 7, 7]", "output": "[30]", "fn_name": "obtain_max_number"}, {"input": "[2, 4, 8, 1, 1, 119, 30, 30, 15, 15, 7, 7]", "output": "[119]", "fn_name": "obtain...
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\nConsider the string `\"adfa\"` and the following rules: \n```Pearl\na) each character MUST be changed either ...
[{"input": "\"kxbkwgyydkcbtjcosgikfdyhuuprubpwthgflucpyylbofvqxkkvqthmdnywpaunfihvupbwpruwfybdmgeuocltdaidyyewmbzm\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"abaazaba\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"ababbaba\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"abccba\"", "...
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 statement\n\nN first-year students of the Faculty of Information Science and Technology of R Universi...
[{"input": "89 111", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111\n"}, {"input": "85 110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA palindrome is a string $t$ which reads the same backward as forward (formally, $t[i] = t[|t| + 1 - i]$ for ...
[{"input": "11\n4\n0\n1\n1\n0\n2\n0001000\n0000000000000\n2\n1\n0\n1\n1\n1\n0\n2\n11\n00\n2\n111\n000\n2\n111\n00\n2\n00\n111\n2\n11111\n00\n2\n00000100000\n000\n", "output": "4\n2\n2\n1\n1\n2\n2\n2\n2\n2\n2\n"}, {"input": "11\n4\n0\n1\n1\n0\n2\n0001000\n0000000000000\n2\n1\n0\n1\n1\n1\n0\n2\n11\n00\n2\n111\n000\n2\n11...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSearch trees are data structures that support dynamic set operations including insert, search, delete and so ...
[{"input": "8\ninsert 30\ninsert 113\ninsert 18\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint", "output": " 1 17 18 20 25 30 113\n 30 18 1 17 20 25 113\n"}, {"input": "8\ninsert 30\ninsert 166\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 19\nprint", "output": " 1 12 17 19 20 30 166\n 30 12 1 20 17 19 166\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\nTaro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he...
[{"input": "47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 7\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13", "output": "S 1\nH 3\nH 5\nC 12\nD 8\n"}, {"input": "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\nJust in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny tho...
[{"input": "1984 1110 1992\n", "output": "102579360\n"}, {"input": "1984 1847 1992\n", "output": "345702953"}, {"input": "1000 1000 1000\n", "output": "850431726"}, {"input": "1999 2000 2000\n", "output": "675798323"}, {"input": "2000 2000 2000\n", "output": "321179016"}, {"input": "331 1999 1234\n", "output": "9203825...
code_stdio
[ { "content": "You are an expert Python programmer. 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 string and returns an array of the repeated characters (letters, numbers, white...
[{"input": "\"limbojackassin the garden\"", "output": "[[\"a\", \"s\", \"i\", \" \", \"e\", \"n\"]]", "fn_name": "remember"}, {"input": "\"kamehameha\"", "output": "[[\"a\", \"m\", \"e\", \"h\"]]", "fn_name": "remember"}, {"input": "\"11 pinguin\"", "output": "[[\"1\", \"i\", \"n\"]]", "fn_name": "remember"}, {"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\nThe sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] ...
[{"input": "5\n834472 -373089 441294 -633071 -957672\n", "output": "3\n1 2 3\n"}, {"input": "5\n834472 -373089 441294 -633071 -1240121\n", "output": "3\n1 2 3"}, {"input": "5\n834472 -373089 441294 -401384 -1240121\n", "output": "3\n1 2 3"}, {"input": "5\n834472 -373089 28898 -401384 -1240121\n", "output": "3\n1 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\nIt can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2^{k} - 1 + ...
[{"input": "100\n1 1 1 1 1 1 1 2 2 2 2 2 2 2 4 4 4 4 4 4 4 6 8 8 8 8 8 8 8 10 16 16 16 16 16 16 16 17 22 24 24 30 32 32 32 32 32 32 48 62 64 64 65 65 67 70 74 88 89 98 99 101 101 109 121 127 128 128 137 143 152 153 155 156 160 161 170 183 186 196 196 214 220 226 228 230 238 240 241 245 249 249 250 253 254 256 256 512 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\nSchool holidays come in Berland. The holidays are going to continue for n days. The students of school №N are...
[{"input": "100 50\n1 8\n9 12\n13 19\n20 22\n23 27\n28 31\n32 36\n36 40\n40 43\n47 47\n48 51\n51 55\n62 63\n69 77\n77 84\n85 90\n98 99\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwo players play a game. The game is played on a rectangular board with n × m squares. At the beginning of th...
[{"input": "100 100 1 1 100 100\n", "output": "Second\n"}, {"input": "100 100 10 10 13 14\n", "output": "Second\n"}, {"input": "000 100 1 1 100 100\n", "output": "Second\n"}, {"input": "100 32 71 12 71 22\n", "output": "Second\n"}, {"input": "37 100 33 13 32 30\n", "output": "Second\n"}, {"input": "60 100 28 80 26 85\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\nIn this kata you will be given a random string of letters and tasked with returning them as a string of comma...
[{"input": "\"ZpglnRxqenU\"", "output": "[\"Eeeee,Ggggggg,Llllllllllll,Nnnnnnnnnnnnnn,Nnnnnnnnnnnnnn,Pppppppppppppppp,Qqqqqqqqqqqqqqqqq,Rrrrrrrrrrrrrrrrrr,Uuuuuuuuuuuuuuuuuuuuu,Xxxxxxxxxxxxxxxxxxxxxxxx,Zzzzzzzzzzzzzzzzzzzzzzzzzz\"]", "fn_name": "alpha_seq"}, {"input": "\"MjtkuBovqrU\"", "output": "[\"Bb,Jjjjjjjjjj,Kkkk...
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\nDima has a hamsters farm. Soon N hamsters will grow up on it and Dima will sell them in a city nearby.\n\nHam...
[{"input": "1998451655 50\n977141206 956777871 186433588 538218068 28363231 327484438 88827268 266300062 670616672 756092978 414181331 913675814 898008516 343057716 99416265 255545168 76528140 550467703 684435578 844649988 1024428164 550467703 493542638 33869647 414181331 198095018 913675814 99416265 550467703 67955390...
code_stdio
[ { "content": "You are an expert Python programmer. 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 hero is on his way to the castle to complete his mission. However, he's been told that the castle is surrou...
[{"input": "1500\n751", "output": "[false]", "fn_name": "hero"}, {"input": "100\n40", "output": "[true]", "fn_name": "hero"}, {"input": "10\n5", "output": "[true]", "fn_name": "hero"}, {"input": "7\n4", "output": "[false]", "fn_name": "hero"}, {"input": "4\n5", "output": "[false]", "fn_name": "hero"}, {"input": "0\n1",...
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 N consisting of lowercase English letters.\nProcess Q queries of the follo...
[{"input": "7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n", "output": "3\n1\n5\n"}, {"input": "7\nabcdbbd\n6\n2 6 6\n1 4 z\n2 1 -1\n1 4 a\n1 7 d\n2 1 7", "output": "1\n0\n4\n"}, {"input": "7\nabcdbbd\n6\n2 6 6\n1 4 z\n2 1 -1\n1 4 a\n1 7 d\n2 1 6", "output": "1\n0\n3\n"}, {"input": "7\nabcdbbd\n6\n2 6 6\n1 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\nGiven the integer $n$ — the number of available blocks. You must use all blocks to build a pedestal.\n\nThe p...
[{"input": "17\n58512\n46568\n77983\n60262\n48767\n75002\n79520\n52911\n42089\n38692\n71175\n51960\n33754\n36367\n67108\n79100\n78009\n", "output": "19504 19505 19503\n15523 15524 15521\n25995 25996 25992\n20088 20089 20085\n16256 16257 16254\n25001 25002 24999\n26507 26508 26505\n17637 17638 17636\n14030 14031 14028\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\nTruncate the given string (first argument) if it is longer than the given maximum length (second argument). R...
[{"input": "\"Seems like you have passed the final test. Congratulations\"\n53", "output": "[\"Seems like you have passed the final test. Congrat...\"]", "fn_name": "truncate_string"}, {"input": "\"A-tisket a-tasket A green and yellow basket\"\n43", "output": "[\"A-tisket a-tasket A green and yellow basket\"]", "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\nDuring one of the space missions, humans have found an evidence of previous life at one of the planets. They ...
[{"input": "4\n3 13\n5 8\n8 9\n8 10\n", "output": "8 3\n"}, {"input": "4\n3 13\n5 8\n6 9\n8 10\n", "output": "6 3\n"}, {"input": "4\n3 4\n4 5\n4 6\n8 10\n", "output": "4 2\n"}, {"input": "4\n3 4\n4 8\n4 6\n8 10\n", "output": "4 2\n"}, {"input": "4\n3 8\n4 8\n4 9\n8 10\n", "output": "4 3\n"}, {"input": "4\n3 9\n4 8\n6 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\nPetya has got an interesting flower. Petya is a busy person, so he sometimes forgets to water it. You are giv...
[{"input": "4\n3\n1 0 0\n3\n0 0 1\n4\n1 0 0 1\n1\n1\n", "output": "-1\n-1\n-1\n2\n"}, {"input": "4\n3\n0 0 1\n3\n0 0 1\n4\n1 0 0 1\n1\n0\n", "output": "-1\n-1\n-1\n1\n"}, {"input": "4\n3\n0 0 1\n3\n0 0 1\n4\n0 1 1 1\n1\n0\n", "output": "-1\n-1\n12\n1\n"}, {"input": "4\n3\n1 1 1\n3\n0 0 0\n4\n1 1 1 0\n1\n0\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\nIn Conway's Game of Life, cells in a grid are used to simulate biological cells.\nEach cell is considered to ...
[{"input": "4\n00000101\n000\n010101\n11100", "output": "11011000\nMultiple solutions\nMultiple solutions\n01000\n"}, {"input": "4\n00000101\n000\n011011\n10010", "output": "11011000\nMultiple solutions\nMultiple solutions\n01100\n"}, {"input": "4\n00010101\n000\n100011\n00010", "output": "00001110\nMultiple solutions\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAND gates and OR gates are basic components used in building digital circuits. Both gates have two input line...
[{"input": "4\n\n1\n0\n\n3\n0\n0\n2 1 2\n\n3\n0\n0\n1 2 1\n\n1\n0\n0\n-1\n2 1 3\n1 4 3", "output": "0.50000\n0.70711\n0.29289\n0.50000\n"}, {"input": "4\n\n1\n0\n\n3\n0\n0\n2 1 2\n\n3\n0\n0\n2 2 2\n\n1\n0\n-1\n0\n2 0 2\n1 3 3", "output": "0.50000\n0.70711\n0.70711\n0.50000\n"}, {"input": "4\n\n1\n0\n\n3\n0\n0\n1 1 2\n\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLucy had recently learned the game, called Natural Numbers.\nThe rules of the game are really simple. There a...
[{"input": "2\n5\nKouta 0\nYuka 1\nMayu 3\nLucy 2\nNana 5\n2\nLucy 2\nOana 2", "output": "Kouta\nNobody wins.\n"}, {"input": "2\n5\natuoK 0\nYukb 1\nM`yu 2\nuLcy 4\nNana 5\n2\nLucy 1\nOana 1", "output": "atuoK\nNobody wins.\n"}, {"input": "2\n5\nKauto 0\nYuka 1\nuayL 3\nyucK 2\nNana 5\n2\nLucy 2\nNana 2", "output": "Ka...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCheck if it is a vowel(a, e, i, o, u,) on the ```n``` position in a string (the first argument). Don't forget...
[{"input": "\"Amanda\"\n-2", "output": "[false]", "fn_name": "check_vowel"}, {"input": "\"Amanda\"\n0", "output": "[true]", "fn_name": "check_vowel"}, {"input": "\"Amanda\"\n2", "output": "[true]", "fn_name": "check_vowel"}, {"input": "\"cat\"\n0", "output": "[false]", "fn_name": "check_vowel"}, {"input": "\"cat\"\n4",...
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\nAn infinitely long railway has a train consisting of n cars, numbered from 1 to n (the numbers of all the car...
[{"input": "50\n10 37 3 46 45 29 36 13 21 25 35 5 18 33 12 19 50 16 30 47 20 42 39 28 2 6 38 8 7 31 22 27 26 9 15 14 34 48 4 32 40 43 44 24 11 1 23 17 49 41\n", "output": "46"}, {"input": "50\n1 2 3 4 5 6 7 8 43 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 50 33 34 35 36 37 38 39 40 41 42 9 44 45 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\nРодители Васи хотят, чтобы он как можно лучше учился. Поэтому если он получает подряд три положительные оценк...
[{"input": "250\n4 4 2 5 1 5 5 4 5 4 4 4 4 4 4 5 5 4 4 5 4 5 1 5 5 4 1 5 5 4 5 5 4 4 4 4 5 4 4 5 5 5 5 5 4 5 4 5 5 4 5 4 4 4 4 4 4 5 5 4 5 5 1 4 4 4 5 1 5 3 4 5 4 4 4 4 4 5 5 4 4 4 4 4 5 4 5 5 5 4 4 5 4 4 4 5 5 5 5 4 5 4 5 4 5 5 5 5 4 4 4 4 5 5 5 5 5 5 4 4 3 4 4 5 5 3 5 4 4 4 4 4 4 5 5 5 4 5 4 4 4 2 4 5 5 5 5 5 5 5 4 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\nYou are given a positive integer $n$ greater or equal to $2$. For every pair of integers $a$ and $b$ ($2 \\le...
[{"input": "100000\n", "output": "12898363344"}, {"input": "100000\n", "output": "12898363344"}, {"input": "88077\n", "output": "10005839736\n"}, {"input": "88853\n", "output": "10182812524\n"}, {"input": "93365\n", "output": "11243148040\n"}, {"input": "92775\n", "output": "11101694484"}, {"input": "90783\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 string S and T consisting of lowercase English letters.\nDetermine if S equals T after rotation...
[{"input": "pgykichjtpukfnlxfcevkjezqsmeycanjlbessrfazdprcomdpjimsfbuslksyveergcgmonctcsvypolplcgsqyfkilrixodiwq\nfnlxfcevkjezqsmeycanjlbessrfazdprcomdpjimsfbuslksyveergcgmonctcsvypolplcgsqyfkilrixodiwqpgykichjtpuk\n", "output": "Yes\n"}, {"input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. 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 palindromic number `595` is interesting because it can be written as the sum of consecutive squares: `6^2...
[{"input": "10000000", "output": "[110]", "fn_name": "values"}, {"input": "1000000", "output": "[59]", "fn_name": "values"}, {"input": "5000000", "output": "[78]", "fn_name": "values"}, {"input": "9000000", "output": "[98]", "fn_name": "values"}, {"input": "100000", "output": "[30]", "fn_name": "values"}, {"input": "10...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya goes to visit his classmate Petya. Vasya knows that Petya's apartment number is $n$. \n\nThere is only ...
[{"input": "7\n7 3\n1 3\n18 6\n1865 4\n12 2\n2 10\n22 5\n", "output": "3\n1\n4\n467\n6\n1\n5\n"}, {"input": "7\n7 3\n1 3\n18 6\n987 4\n12 2\n2 10\n22 12\n", "output": "3\n1\n4\n248\n6\n1\n3\n"}, {"input": "7\n7 3\n1 3\n18 6\n1865 4\n12 2\n4 10\n22 5\n", "output": "3\n1\n4\n467\n6\n2\n5\n"}, {"input": "7\n2 3\n1 3\n18 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\nA Little Elephant and his friends from the Zoo of Lviv like candies very much.\n\nThere are N elephants in th...
[{"input": "2\n2 1\n2 2\n3 13\n-1 2 2", "output": "No\nYes\n"}, {"input": "2\n2 1\n4 2\n3 13\n-1 2 2", "output": "No\nYes\n"}, {"input": "2\n2 1\n4 2\n3 13\n-1 2 1", "output": "No\nYes\n"}, {"input": "2\n2 0\n4 2\n3 13\n-1 2 1", "output": "No\nYes\n"}, {"input": "2\n2 1\n2 0\n3 13\n-1 2 2", "output": "No\nYes\n"}, {"in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhile walking down the street Vanya saw a label \"Hide&Seek\". Because he is a programmer, he used & as a bit...
[{"input": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLately, a national version of a bingo game has become very popular in Berland. There are n players playing th...
[{"input": "40\n2 12 19\n4 10 7 1 3\n2 15 17\n1 6\n3 17 8 20\n4 8 16 11 18\n2 2 7\n4 12 13 8 7\n3 6 1 15\n3 19 11 13\n1 2\n2 16 14\n5 1 17 8 9 5\n1 2\n3 15 17 12\n4 20 4 19 18\n1 10\n4 12 1 17 16\n4 5 10 8 11\n1 10\n1 13\n1 17\n2 19 18\n1 3\n2 6 20\n1 8\n2 3 14\n3 17 3 1\n2 4 3\n1 12\n1 15\n1 2\n2 13 9\n2 1 14\n1 1\n5 ...
code_stdio