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\nThere are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy ... | [{"input": "-465", "output": "107880\n"}, {"input": "-792", "output": "313236\n"}, {"input": "-937", "output": "438516\n"}, {"input": "-845", "output": "356590\n"}, {"input": "-647", "output": "208981\n"}, {"input": "-164", "output": "13366\n"}, {"input": "-152", "output": "11476\n"}, {"input": "-299", "output": "44551... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 kindergarten teacher Natalia Pavlovna has invented a new ball game. This game not only develops the childre... | [{"input": "102\n", "output": "2 4 7 11 16 22 29 37 46 56 67 79 92 4 19 35 52 70 89 7 28 50 73 97 20 46 73 101 28 58 89 19 52 86 19 55 92 28 67 5 46 88 29 73 16 62 7 55 2 52 1 53 4 58 11 67 22 80 37 97 56 16 79 41 4 70 35 1 70 38 7 79 50 22 97 71 46 22 101 79 58 38 19 1 86 70 55 41 28 16 5 97 88 80 73 67 62 58 55 53 52... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's call a string a phone number if it has length 11 and fits the pattern \"8xxxxxxxxxx\", where each \"x\"... | [{"input": "100\n10073026040057460848727605087211482331696312132261702754626166388448133087167204984955299978572844873\n", "output": "9\n"}, {"input": "100\n12214470388509637187316171407185732399094381485438987303313809772379863936872280956215437122989955784\n", "output": "9\n"}, {"input": "100\n88202862851852449384524... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 heroes fighting in the arena. Initially, the i-th hero has a_i health points.\n\nThe fight in the... | [{"input": "371 306\n", "output": "512015273\n"}, {"input": "222 500\n", "output": "382157018\n"}, {"input": "124 212\n", "output": "806210307\n"}, {"input": "300 500\n", "output": "567125736\n"}, {"input": "224 375\n", "output": "555865043\n"}, {"input": "365 500\n", "output": "552203508\n"}, {"input": "444 500\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\nOne day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came ... | [{"input": "101628400788615604 30\n", "output": "999999999999995905\n"}, {"input": "101628400798615604 31\n", "output": "981546175132942729\n"}, {"input": "101628400798615604 31\n", "output": "981546175132942729\n"}, {"input": "101628400788615604 30\n", "output": "999999999999995905\n"}, {"input": "10000000000000000 35... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 full control over a robot that walks around in a rectangular field paved with square tiles like a ch... | [{"input": "11 5\nFORWARD 3\nRIGHT\nFORWARD 10\nLEFT\nBACKWARD 3\nSTOP\n3 1\nFORWARD 2\nSTOP\n0 0", "output": "11 1\n1 1\n"}, {"input": "14 5\nFORWARD 3\nRIGHT\nFORWARD 8\nLEFT\nBACKWARD 2\nSTOP\n3 1\nFORVARD 5\nSTOP\n0 0", "output": "9 2\n1 1\n"}, {"input": "1 10\nFORDARW 1\nRIGHT\nFORWARD 5\nLEFT\nBACKWARD 1\nSTOP\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\nIn this Kata we are passing a number (n) into a function. \n\nYour code will determine if the number passed i... | [{"input": "222222221", "output": "[false]", "fn_name": "is_even"}, {"input": "500000000", "output": "[true]", "fn_name": "is_even"}, {"input": "0.5", "output": "[false]", "fn_name": "is_even"}, {"input": "15", "output": "[false]", "fn_name": "is_even"}, {"input": "220", "output": "[true]", "fn_name": "is_even"}, {"inp... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a 3×3 square grid, where each square contains a lowercase English letters.\nThe letter in the square ... | [{"input": "ant\nobe\nrec\n", "output": "abc\n"}, {"input": "edu\ncat\nion\n", "output": "ean\n"}, {"input": "ant\nobe\nrfc", "output": "abc\n"}, {"input": "ddu\ncat\nion", "output": "dan\n"}, {"input": "ant\nobe\nrcf", "output": "abf\n"}, {"input": "ddu\ncat\nioo", "output": "dao\n"}, {"input": "ddu\ncat\nooi", "outpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Resistance is trying to take control over as many planets of a particular solar system as possible. Princ... | [{"input": "24\n19 14\n8 15\n13 4\n18 16\n1 17\n10 3\n22 21\n10 14\n6 11\n9 12\n15 22\n11 3\n21 7\n2 12\n7 4\n4 19\n16 9\n24 17\n5 15\n8 2\n23 10\n20 12\n18 24\n", "output": "1 20 21 22 23 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24\n"}, {"input": "24\n19 14\n8 15\n13 4\n18 16\n1 17\n10 3\n22 21\n10 14\n6 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp is very careful. He even types numeric sequences carefully, unlike his classmates. If he sees a sequ... | [{"input": ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\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 survived several months of exam wars and were able to enter ICPC University on a sunny day. On the day of... | [{"input": "9\n315\n0", "output": "2\n11\n"}, {"input": "9\n256\n0", "output": "2\n0\n"}, {"input": "9\n160\n0", "output": "2\n1\n"}, {"input": "9\n213\n0", "output": "2\n3\n"}, {"input": "9\n200\n0", "output": "2\n2\n"}, {"input": "9\n135\n0", "output": "2\n7\n"}, {"input": "9\n350\n0", "output": "2\n5\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 an integer array $a_1, a_2, \\ldots, a_n$.\n\nThe array $b$ is called to be a subsequence of $a... | [{"input": "50\n170081 797965 40736 224325 102476 20832 954026 923972 391400 247099 95141 927386 79799 749285 104039 200818 623552 872203 355273 838168 352783 850365 389351 930945 847154 608047 727586 549184 520573 608953 338849 536466 345479 589848 882827 771475 874283 787115 992590 128903 97800 74550 674140 282514 51... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLimak can repeatedly remove one of the first two characters of a string, for example abcxyx \\rightarrow acxy... | [{"input": "3\nabcxyx\ncyx\nabb", "output": "1\n"}, {"input": "3\nabxxyc\ncyx\nabb", "output": "0\n"}, {"input": "6\nb\na\nabb\nc\nd\nab", "output": "5\n"}, {"input": "6\nb\na\nabb\nc\nd\nba", "output": "4\n"}, {"input": "3\naxxbyc\ncyx\nabb", "output": "0\n"}, {"input": "3\naxxbyc\ncyx\naab", "output": "0\n"}, {"input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp is very fond of playing the game Minesweeper. Recently he found a similar game and there are such ru... | [{"input": "3\n\n5 0\n0 0 1\n-1 1 4\n1 1 2\n1 0 3\n2 2 9\n\n5 2\n0 -1 1\n0 1 4\n2 0 2\n1 1 3\n2 2 9\n\n6 1\n1 -1 3\n0 -1 9\n0 1 7\n-1 0 1\n0 1 14\n-1 -1 11\n", "output": "2\n1\n1"}, {"input": "3\n\n5 0\n0 0 1\n-1 1 4\n1 0 2\n1 0 3\n2 2 11\n\n5 2\n0 0 0\n0 1 4\n3 0 2\n1 1 3\n2 2 15\n\n6 1\n1 -1 3\n0 -1 9\n0 1 9\n-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\nLet's call a list of positive integers $a_0, a_1, ..., a_{n-1}$ a power sequence if there is a positive integ... | [{"input": "100\n881 479 355 759 257 497 690 598 275 446 439 787 257 326 436 713 322 5 253 781 434 307 164 154 241 381 38 942 680 906 240 11 431 478 628 1203 346 74 493 964 455 746 950 41 585 549 892 687 264 41 487 676 63 453 861 980 477 901 80 907 285 506 619 748 773 743 56 925 651 685 845 313 419 504 770 324 2 559 40... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEverybody knows that the m-coder Tournament will happen soon. m schools participate in the tournament, and on... | [{"input": "100 10 1\n62 68 24 82 66 47 73 43 85 23 78 13 94 14 84 17 27 5 72 48 59 46 97 81 88 9 76 69 11 15 12 61 130 7 91 34 99 52 54 57 56 64 55 67 40 38 74 25 30 4 22 92 33 3 86 45 37 26 150 53 75 71 58 96 98 20 36 1 95 63 10 49 19 41 89 21 39 100 93 42 32 90 28 83 6 29 60 65 44 35 18 16 8 50 80 31 51 2 146 79\n6 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMemory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilatera... | [{"input": "100000 25000\n", "output": "5\n"}, {"input": "100000 25000\n", "output": "5\n"}, {"input": "167552 16353\n", "output": "7\n"}, {"input": "113151 20996\n", "output": "6\n"}, {"input": "141391 23890\n", "output": "6\n"}, {"input": "100100 25000\n", "output": "5\n"}, {"input": "119562 71629\n", "output": "3\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have an undirected graph G with N vertices numbered 1 to N and N edges as follows:\n - For each i=1,2,...,... | [{"input": "2000 999 1001\n", "output": "2000\n1999\n1998\n1997\n1996\n1995\n1994\n1993\n1992\n1991\n1990\n1989\n1988\n1987\n1986\n1985\n1984\n1983\n1982\n1981\n1980\n1979\n1978\n1977\n1976\n1975\n1974\n1973\n1972\n1971\n1970\n1969\n1968\n1967\n1966\n1965\n1964\n1963\n1962\n1961\n1960\n1959\n1958\n1957\n1956\n1955\n195... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 that converts the date expressed in the Christian era to the Japanese calendar using the era... | [{"input": "3559 9 5\n2425 12 2\n2980 9 14", "output": "heisei 1571 9 5\nheisei 437 12 2\nheisei 992 9 14\n"}, {"input": "3559 9 5\n2425 12 2\n2980 9 7", "output": "heisei 1571 9 5\nheisei 437 12 2\nheisei 992 9 7\n"}, {"input": "3080 6 3\n2027 12 3\n3210 9 1", "output": "heisei 1092 6 3\nheisei 39 12 3\nheisei 1222 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\nDwarfs have planted a very interesting plant, which is a triangle directed \"upwards\". This plant has an amu... | [{"input": "1000000000000000000\n", "output": "899770636\n"}, {"input": "148049062285906746\n", "output": "913927498\n"}, {"input": "615812227854199662\n", "output": "357939938\n"}, {"input": "585335721566249104\n", "output": "301383716\n"}, {"input": "791809296233191092\n", "output": "369199735\n"}, {"input": "5228421... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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_1, a_2, \\dots, a_n$, consisting of $n$ positive integers. \n\nInitially you are st... | [{"input": "4\n5 4 0\n1 5 4 3 2\n5 4 1\n1 5 7 3 2\n5 4 4\n10 20 30 40 78\n10 7 3\n4 6 12 2 9 12 14 4 10 9\n", "output": "15\n25\n178\n71\n"}, {"input": "4\n5 4 0\n1 5 4 3 2\n5 4 1\n1 5 7 3 2\n5 4 4\n10 20 30 40 50\n10 7 3\n4 6 8 2 9 12 14 4 10 9\n", "output": "15\n25\n150\n67\n"}, {"input": "4\n5 4 0\n1 5 4 3 2\n5 4 1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMake a program that takes a value (x) and returns \"Bang\" if the number is divisible by 3, \"Boom\" if it is... | [{"input": "41535", "output": "[\"BangBoom\"]", "fn_name": "multiple"}, {"input": "10003823", "output": "[\"Miss\"]", "fn_name": "multiple"}, {"input": "30", "output": "[\"BangBoom\"]", "fn_name": "multiple"}, {"input": "15", "output": "[\"BangBoom\"]", "fn_name": "multiple"}, {"input": "45", "output": "[\"BangBoom\"]"... | 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\nTashizan Hikizan (Calculation Training)\n\nsquare1001 You gave E869120 two numbers, $ A $ and $ B $, as birth... | [{"input": "3\n-2 -10", "output": "10 -2\n"}, {"input": "3\n-2 -15", "output": "15 -2\n"}, {"input": "3\n-2 -21", "output": "21 -2\n"}, {"input": "3\n-2 -27", "output": "27 -2\n"}, {"input": "3\n-1 -27", "output": "27 -1\n"}, {"input": "3\n-1 -21", "output": "21 -1\n"}, {"input": "3\n-1 -24", "output": "24 -1\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFind the least common multiple (LCM) of given n integers.\n\nConstraints\n\n* 2 ≤ n ≤ 10\n* 1 ≤ ai ≤ 1000\n* ... | [{"input": "3\n12 39 11", "output": "1716\n"}, {"input": "4\n1 2 5 24", "output": "120\n"}, {"input": "3\n3 37 10", "output": "1110\n"}, {"input": "4\n1 2 5 44", "output": "220\n"}, {"input": "3\n9 37 10", "output": "3330\n"}, {"input": "4\n1 3 5 44", "output": "660\n"}, {"input": "3\n9 39 10", "output": "1170\n"}, {"i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did s... | [{"input": "abcdefghijklmnopqrytuvwzsx", "output": "abcdefghijklmnopqrytuvwzx\n"}, {"input": "abcpefghijklmnodqrytuvwzsx", "output": "abcpefghijklmnodqrytuvwzx\n"}, {"input": "azcdefghijklmnopqrstuvwbyx", "output": "azcdefghijklmnopqrstuvwx\n"}, {"input": "abcdefghijklmnopqrstuvwzyx", "output": "abcdefghijklmnopqrstuvx... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 pair of numbers has a unique LCM but a single number can be the LCM of more than one possible\npairs. For e... | [{"input": "101101291", "output": "[5]", "fn_name": "lcm_cardinality"}, {"input": "12345676", "output": "[68]", "fn_name": "lcm_cardinality"}, {"input": "30858025", "output": "[63]", "fn_name": "lcm_cardinality"}, {"input": "1251562", "output": "[41]", "fn_name": "lcm_cardinality"}, {"input": "9801", "output": "[23]", ... | 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 consider a special type of an auction, which is called the second-price auction. As in reg... | [{"input": "100\n2515 3324 7975 6171 4240 1217 4829 5203 8603 6900 3031 4699 4732 6070 4221 3228 6497 7359 9130 4346 4619 1109 3945 5442 3271 16 9711 2045 6410 2301 3406 8125 6003 1892 1260 9661 3940 6692 4708 7027 4930 6925 1979 5361 4263 3144 867 8639 6230 5562 9714 3676 4231 3347 4733 4920 4881 3431 1059 7313 8912 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\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the oth... | [{"input": "119\n", "output": "991\n"}, {"input": "999\n", "output": "111\n"}, {"input": "191\n", "output": "919\n"}, {"input": "111\n", "output": "999\n"}, {"input": "191\n", "output": "919\n"}, {"input": "199\n", "output": "911\n"}, {"input": "911\n", "output": "199\n"}, {"input": "919\n", "output": "191\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\nLee tried so hard to make a good div.2 D problem to balance his recent contest, but it still doesn't feel goo... | [{"input": "7\n2\n2\n6\n8\n5\n110\n1478999\n", "output": "0\n0\n24\n96\n12\n782548134\n793574295\n"}, {"input": "7\n3\n2\n5\n8\n5\n101\n2000000\n", "output": "4\n0\n12\n96\n12\n981997171\n804665184\n"}, {"input": "3\n1234567\n1268501\n1268499\n", "output": "788765312\n999997375\n999999350\n"}, {"input": "3\n1234567\n12... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 robot is located on a checkered rectangular board of size $n \\times m$ ($n$ rows, $m$ columns). The rows... | [{"input": "4\n1 1\nL\n12 2\nL\n3 3\nUULDRR\n10 3\nUULLLDRRDUUL\n", "output": "1 1\n1 2\n3 2\n3 3\n"}, {"input": "4\n1 1\nL\n12 2\nL\n3 3\nUULDRR\n11 3\nUULLLDRRDUUL\n", "output": "1 1\n1 2\n3 2\n3 3\n"}, {"input": "4\n1 1\nL\n12 2\nL\n5 3\nUULDRR\n10 3\nUULLLDRRDUUL\n", "output": "1 1\n1 2\n3 2\n3 3\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\nA famous gang of pirates, Sea Dogs, has come back to their hideout from one of their extravagant plunders. Th... | [{"input": "1000000000 3\n30490 19232\n45250 999980767\n264372930 1\n", "output": "-1"}, {"input": "1000000000 3\n30490 19232\n45250 999980767\n264372930 1\n", "output": "-1"}, {"input": "221407444 1\n999999999 999999999\n", "output": "-1\n"}, {"input": "300 4\n1 200\n2 200\n50 100\n70 100\n", "output": "-1"}, {"input"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the spirit of the holidays, Saitama has given Genos two grid paths of length n (a weird gift even by Saita... | [{"input": "200\nNESENEESEESWWWNWWSWSWNWNNWNNESWSWNNWNWNENESENNESSWSESWWSSSEEEESSENNNESSWWSSSSESWSWWNNEESSWWNNWSWSSWWNWNNEENNENWWNESSSENWNESWNESWNESEESSWNESSSSSESESSWNNENENESSWWNNWWSWWNESEENWWWWNWWNWWNENESESSWWSWWSES\nNWNESESSENNNESWNWWSWWWNWSESSSWWNWWNNWSENWSWNENNNWWSWWSWNNNESWWWSSESSWWWSSENWSENWWNENESESWNENNESWNWNNEN... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour task is to write a program which reads a text and prints two words. The first one is the word which is a... | [{"input": "Thank you for your mail amd your lectures", "output": "your lectures\n"}, {"input": "ahTnk you for your mail and your serutcel", "output": "your serutcel\n"}, {"input": "Uhank you for your mail mad your lrctuees", "output": "your lrctuees\n"}, {"input": "ahTnk you for your mail and your leeturcs", "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\nComplete the function that accepts a string parameter, and reverses each word in the string. **All** spaces i... | [{"input": "\"The quick brown fox jumps over the lazy dog.\"", "output": "[\"ehT kciuq nworb xof spmuj revo eht yzal .god\"]", "fn_name": "reverse_words"}, {"input": "\"double spaced words\"", "output": "[\"elbuod decaps sdrow\"]", "fn_name": "reverse_words"}, {"input": "\"stressed desserts\"", "output": "[\"desser... | 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\nAnna and Maria are in charge of the math club for junior students. When the club gathers together, the studen... | [{"input": "96 70\n30 37\n47 56\n19 79\n15 28\n2 43\n43 54\n59 75\n42 22\n38 18\n18 14\n47 41\n60 29\n35 11\n90 4\n14 41\n11 71\n41 24\n68 28\n45 92\n14 15\n34 63\n77 32\n67 38\n36 8\n37 4\n58 95\n68 84\n69 81\n35 23\n56 63\n78 91\n35 44\n66 63\n80 19\n87 88\n28 14\n62 35\n24 23\n83 37\n54 89\n14 40\n9 35\n94 9\n56 46\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 takes part in the \"Field of Wonders\" TV show. The participants of the show have to guess a hidde... | [{"input": "42\n*****o*******t********************oo******\n10\nvcrccobltkeidtxhsxhccaslkjhfyeqsetoowaemso\nuimjsoxifamvctkgqmrwhyjrgmlydczzqjoobnnwch\nuvmjsoqizfavctkxemrpaycngmlyemzzqjoobszwbh\nusmjsoviskzvctkljmrlmylugmlydfzzqvoobzawgh\nfeqweodinkhiatqmfokaxwcmlmbmvskssyookgcrax\ntackfosjhxeqftkgjynbbedrczegtimuvooo... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 to simulate rolling a dice, which can be constructed by the following net.\n\n\n<image>\n<ima... | [{"input": "-1 4 13 -2 100 13\nES", "output": "100\n"}, {"input": "0 2 0 16 25 35\nEESWN", "output": "35\n"}, {"input": "0 2 0 16 25 38\nEESWN", "output": "38\n"}, {"input": "0 2 4 12 16 14\nEESWN", "output": "14\n"}, {"input": "1 2 4 14 24 30\nEESWN", "output": "30\n"}, {"input": "1 2 1 14 24 30\nEESWN", "output": "30... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Berland the opposition is going to arrange mass walking on the boulevard. The boulevard consists of n tile... | [{"input": "250\n5 3 5 1 3 5 3 4 4 3 1 5 2 2 1 1 5 2 3 3 2 5 4 3 2 4 2 3 5 4 1 2 3 5 2 2 5 4 1 3 3 5 4 4 4 4 4 2 4 2 3 5 1 4 3 3 2 3 5 3 3 4 4 2 3 1 3 4 1 4 5 4 1 2 3 4 1 5 3 3 2 3 5 4 2 5 2 2 3 5 4 3 5 4 2 1 4 1 4 1 1 3 5 1 1 2 1 3 4 5 4 3 2 5 1 3 5 1 1 3 3 5 1 4 5 1 2 1 1 5 5 3 5 1 4 1 4 4 4 4 4 1 4 3 4 5 4 1 2 2 5 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\nPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal r... | [{"input": "50\n44747747774474747747747447777447774747447477444474\n", "output": "YES"}, {"input": "50\n44444444444444444444444444444444444444444444444444\n", "output": "YES"}, {"input": "50\n77777777777777777777777777777777777777777777777777\n", "output": "YES"}, {"input": "50\n4099666333439734310852914372075143390351... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 string S consisting of uppercase English letters. Additionally, an integer N will be given.\nShift ... | [{"input": "26\nYIHVXVZROUSFCUXIOGFIOUSIYDBTQLMECEEHARRBWUDXRITQZSTXNECYMODBOSODWDSWEFEXTVVPENGERSVLYSBDSJOKYSGTJQPEDQWMLFZANYYWWHRHPCOYXLEEBUPOBJMZVUTWCPXQEEHRPSUKCMIDRSBGHBRBAYXUGTZGFRSZTHEVFCFOOTPWYQMXJICOFMXDLCBINVZCPVWRKWDVGBDTDCWRNKPOXANOHOOCKXCSZBSHXXTGCKTSKBRZZTFAAQYFKZGNIZJJZSYTBOKKMTSHMXUPAMANKSBOPRGAAVHRNWCH... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJoisino is about to compete in the final round of a certain programming competition.\nIn this contest, there ... | [{"input": "5\n7 5 1 10 5\n3\n4 3\n1 11\n3 12", "output": "21\n32\n39\n"}, {"input": "5\n7 5 1 10 5\n3\n4 3\n2 11\n3 12", "output": "21\n34\n39\n"}, {"input": "5\n7 8 1 10 11\n3\n4 3\n0 11\n3 7", "output": "30\n37\n43\n"}, {"input": "5\n7 2 3 8 5\n3\n4 2\n1 7\n4 13\n", "output": "19\n25\n30\n"}, {"input": "5\n7 2 3 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\nWhile purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. \nI... | [{"input": "3 \n100 120\n10 20\n1200 20\n", "output": "12000.000000\n200.000000\n21600.000000\n"}, {"input": "3 \n100 120\n10 20\n1200 40", "output": "12000.000000\n200.000000\n43200.000000\n"}, {"input": "3 \n100 215\n10 20\n1200 40", "output": "21500.000000\n200.000000\n43200.000000\n"}, {"input": "3 \n100 215\n10 20... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access t... | [{"input": "1000000000\n", "output": "512\n"}, {"input": "999999999\n", "output": "511\n"}, {"input": "121212121\n", "output": "511\n"}, {"input": "101010101\n", "output": "341\n"}, {"input": "901556123\n", "output": "511\n"}, {"input": "312410141\n", "output": "511\n"}, {"input": "111111111\n", "output": "511\n"}, {"i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given $n$ lengths of segments that need to be placed on an infinite axis with coordinates.\n\nThe fir... | [{"input": "6\n2\n1 3\n3\n1 2 3\n4\n1 2 3 14\n4\n6 12 4 14\n7\n1 2 4 9 7 10 3\n8\n8 6 0 3 3 4 3 6\n", "output": "3\n3\n14\n16\n12\n8\n"}, {"input": "6\n2\n1 3\n3\n1 2 3\n4\n1 2 3 14\n4\n6 8 4 14\n7\n1 2 4 9 13 10 3\n8\n8 6 0 3 3 4 3 6\n", "output": "3\n3\n14\n14\n13\n8\n"}, {"input": "6\n2\n1 3\n3\n1 2 3\n4\n1 2 3 14\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\nHere is a very simple variation of the game backgammon, named “Minimal Backgammon”. The game is played by onl... | [{"input": "10 1 0 0\n7 1 0 0\n13 0 0 0\n6 11 1 1\n2\n5\n7 1 0 6\n1\n1\n3\n4\n5\n6\n0 0 0 0", "output": "0.000000\n0.000000\n0.000000\n0.829031\n0.000000\n"}, {"input": "6 1 0 0\n7 1 0 0\n7 2 0 0\n12 3 1 1\n2\n5\n8 10 0 6\n1\n3\n4\n4\n5\n6\n0 0 0 0", "output": "0.166667\n0.000000\n0.166667\n0.106481\n0.229136\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\nThere is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0. Durin... | [{"input": "12814", "output": "160\n"}, {"input": "19710", "output": "199\n"}, {"input": "36877", "output": "272\n"}, {"input": "49568", "output": "315\n"}, {"input": "44971", "output": "300\n"}, {"input": "34941", "output": "264\n"}, {"input": "27935", "output": "236\n"}, {"input": "43035", "output": "293\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 only difference between the easy and the hard versions is constraints.\n\nA subsequence is a string that ... | [{"input": "100 1000000000100\ndjgykfqaywhkhpocyxcpvbiiouyielmighclnuopadzuvrirbecucwnzwahahagvfstbxxaednajfauscxwttiglbbxtomnnalcl\n", "output": "8854753826235\n"}, {"input": "100 1000000000000\ndjgykfqaywhkhpocyxcpvbiiouyielmighclnuopadzuvrirbecucwnzwahahagvfstbxxaednajfauscxwttiglbbxtomnnalcl\n", "output": "88547538... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInput\n\nThe input is given from standard input in the following format.\n\n\n> $H \\ W$ $a_{1, 1} \\ a_{1, 2... | [{"input": "4 6\n2 3 3 8 2 3\n11 8 9 0 2 0\n0 1 0 1 8 5\n3 10 3 5 9 27\n0 1 1 -1 2 4\n2 19 1 12 1 15", "output": "107\n"}, {"input": "4 6\n2 3 3 7 1 3\n11 8 9 0 2 0\n0 1 4 1 8 5\n3 10 3 5 9 14\n0 1 1 0 2 2\n2 19 1 12 1 10", "output": "96\n"}, {"input": "6 6\n2 2 3 4 3 3\n8 8 9 -1 4 0\n0 1 14 1 5 9\n2 6 2 2 5 9\n2 15 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\nPolar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got ... | [{"input": "53 3\n1 3 4 4 5 7 10 14 19 25 32 40 23 59 70 82 148 109 124 140 157 175 194 214 235 257 280 304 329 355 382 410 439 469 500 532 565 599 634 670 388 745 784 824 865 907 950 994 1039 1085 1132 1180 1229\n1 2 40\n", "output": "0\n"}, {"input": "53 3\n1 3 4 4 5 7 10 14 19 10 32 40 23 59 70 82 148 109 124 140 15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA new innovative ticketing systems for public transport is introduced in Bytesburg. Now there is a single tra... | [{"input": "10\n13\n45\n46\n60\n103\n115\n126\n150\n256\n516\n", "output": "20\n20\n10\n0\n20\n0\n0\n20\n20\n10\n"}, {"input": "10\n11\n45\n46\n60\n103\n115\n126\n150\n256\n516\n", "output": "20\n20\n10\n0\n20\n0\n0\n20\n20\n10\n"}, {"input": "10\n13\n45\n46\n60\n103\n115\n126\n150\n256\n516\n", "output": "20\n20\n10\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDuring the winter holidays, the demand for Christmas balls is exceptionally high. Since it's already 2018, th... | [{"input": "1000000000 1000000000\n1000000000 1000000000 1000000000\n", "output": "5000000000\n"}, {"input": "1000000000 1000000000\n1000000000 1000000000 1000000000\n", "output": "5000000000\n"}, {"input": "1000000000 1000000000\n1000100000 1000000000 1000000000\n", "output": "5000200000\n"}, {"input": "1000000000 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\n# The Invitation\n\nMost of us played with toy blocks growing up. It was fun and you learned stuff. So what e... | [{"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]", "output": "[true]", "fn_name": "build_square"}, {"input": "[1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1]", "output": "[false]", "fn_name": "build_square"}, {"input": "[2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]", "output": "[false]", "fn_name": "build_square"}, {"input": "[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\nWe have a sandglass consisting of two bulbs, bulb A and bulb B. These bulbs contain some amount of sand.\nWhe... | [{"input": "100\n5\n48 141 231 554 425\n7\n0 19\n50 98\n143 30\n231 55\n342 0\n365 100\n600 10", "output": "19\n52\n91\n10\n100\n100\n100\n"}, {"input": "100\n5\n48 179 142 554 425\n7\n0 19\n50 98\n143 30\n231 55\n342 0\n365 100\n600 9", "output": "19\n52\n95\n100\n100\n100\n100\n"}, {"input": "100\n5\n48 179 142 554 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\nEncryption System\n\nA programmer developed a new encryption system. However, his system has an issue that tw... | [{"input": "enw\nabc\nabcdefghijklmnopqrst\ny\n#", "output": "1\nfox\n5\nacc\nacd\nbbd\nbcc\nbcd\n17711\nacceeggiikkmmooqqssu\nacceeggiikkmmooqqstt\nacceeggiikkmmooqqstu\nacceeggiikkmmooqrrtt\nacceeggiikkmmooqrrtu\nbcdefghijklmnopqrrtt\nbcdefghijklmnopqrrtu\nbcdefghijklmnopqrssu\nbcdefghijklmnopqrstt\nbcdefghijklmnopqr... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAstronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life ... | [{"input": "2 420\n412 363\n", "output": "420\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 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\nWe have N bags numbered 1 through N and N dishes numbered 1 through N.\nBag i contains a_i coins, and each di... | [{"input": "3\n1\n10\n2\n1 2\n21\n476523737 103976339 266993 706803678 802362985 892644371 953855359 196462821 817301757 409460796 773943961 488763959 405483423 616934516 710762957 239829390 55474813 818352359 312280585 185800870 255245162\n", "output": "Second\nFirst\nSecond\n"}] | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two integers A and B as the input. Output the value of A + B.\nHowever, if A + B is 10 or great... | [{"input": "-169 -1", "output": "-170\n"}, {"input": "-169 -2", "output": "-171\n"}, {"input": "-279 -2", "output": "-281\n"}, {"input": "-279 -1", "output": "-280\n"}, {"input": "-433 -1", "output": "-434\n"}, {"input": "-408 -1", "output": "-409\n"}, {"input": "-347 -1", "output": "-348\n"}, {"input": "-1 -139", "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 have an array a[1], a[2], ..., a[n], containing distinct integers from 1 to n. Your task is to sort this ... | [{"input": "100\n100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\n", "output... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a chessboard of size 1 × n. It is guaranteed that n is even. The chessboard is painted like thi... | [{"input": "100\n93 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 58 100 83 92 89 56 99 88 59 95 72 81 51 85 71 97 60 91 63 65 98 79 84 53 62 87 55 52 78\n", "output": "1225\n"}, {"input": "100\n93 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 58 100 83 92 89 56 99 88 59 95 72 81 51 85 71 97... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 are playing a game. The game is played on a sequence of positive integer pairs. The players make ... | [{"input": "3\n1\n2 5\n2\n4 10\n5 10\n2\n2 3\n1 5", "output": "YES\nYES\nYES\n"}, {"input": "3\n1\n1 5\n2\n4 10\n5 10\n2\n2 3\n1 5", "output": "YES\nYES\nYES\n"}, {"input": "3\n1\n1 3\n2\n4 10\n5 10\n2\n4 3\n3 5", "output": "YES\nYES\nYES\n"}, {"input": "3\n1\n2 4\n2\n10 5\n5 6\n1\n2 6\n5 0", "output": "YES\nYES\nYES\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\nYour task is to find the number couple with the greatest difference from a given array of number-couples. \n\... | [{"input": "[\"45896-2354\", \"4654-556767\", \"2455-423522\", \"3455-355\", \"34-34\", \"2524522-0\"]", "output": "[\"2524522-0\"]", "fn_name": "diff"}, {"input": "[\"43-45\", \"1021-55\", \"000-18888\", \"92-34\", \"76-32\", \"99-1\", \"1020-54\"]", "output": "[\"000-18888\"]", "fn_name": "diff"}, {"input": "[\"1-100... | 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\nAssume that a, b, and n are all positive integers. Let f (i) be the i-th fraction of the fraction a / b (0 ≤ ... | [{"input": "2 3 2\n2 7 3\n13 3 5\n4 6 2", "output": "12\n15\n15\n12\n"}, {"input": "1 3 2\n2 7 3\n13 3 5\n4 6 2", "output": "6\n15\n15\n12\n"}, {"input": "2 3 2\n2 7 3\n13 3 5\n4 4 2", "output": "12\n15\n15\n0\n"}, {"input": "2 3 2\n2 7 2\n13 3 5\n4 4 2", "output": "12\n10\n15\n0\n"}, {"input": "0 4 1\n2 3 2\n10 4 3\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\nA tree is a connected graph that doesn't contain any cycles.\n\nThe distance between two vertices of a tree i... | [{"input": "50 3\n2 1\n3 2\n4 3\n5 4\n6 5\n7 6\n8 7\n9 8\n10 9\n11 10\n12 11\n13 12\n14 13\n15 14\n16 15\n17 16\n18 17\n19 18\n20 19\n21 20\n22 21\n23 22\n24 23\n25 24\n26 25\n27 26\n28 27\n29 28\n30 29\n31 30\n32 31\n33 32\n34 33\n35 34\n36 35\n37 36\n38 37\n39 38\n40 39\n41 40\n42 41\n43 42\n44 43\n45 44\n46 45\n47 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\nAt regular competition Vladik and Valera won a and b candies respectively. Vladik offered 1 his candy to Vale... | [{"input": "1000000000 1000000000\n", "output": "Vladik\n"}, {"input": "1000000000 1000000000\n", "output": "Vladik\n"}, {"input": "1000000000 1387445955\n", "output": "Vladik\n"}, {"input": "1000000000 1000000001\n", "output": "Vladik\n"}, {"input": "1000000000 1214716107\n", "output": "Vladik\n"}, {"input": "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\nJohnny has just found the new, great tutorial: \"How to become a grandmaster?\". The tutorial tells many stra... | [{"input": "1\n71 2\n100 99 98 97 96 95 94 93 92 91 90 87 86 82 79 78 76 71 70 69 68 66 64 63 62 56 55 53 52 51 50 46 43 42 39 38 37 35 33 31 30 29 22 20 19 18 11 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "999999985\n"}, {"input": "1\n71 2\n100 99 98 97 96 95 94 93 92 91 90 87 86 82 79 78 36 71 70 6... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or ab... | [{"input": "30\n", "output": "Yes\n"}, {"input": "40\n", "output": "Yes\n"}, {"input": "-40\n", "output": "No\n"}, {"input": "-29\n", "output": "No\n"}, {"input": "-30\n", "output": "No\n"}, {"input": "31\n", "output": "Yes\n"}, {"input": "-36\n", "output": "No\n"}, {"input": "32\n", "output": "Yes\n"}, {"input": "32\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwo beavers, Timur and Marsel, play the following game.\n\nThere are n logs, each of exactly m meters in leng... | [{"input": "1000000000 1000000000 1000000000\n", "output": "Marsel\n"}, {"input": "1000000000 1000000000 1100000000\n", "output": "Marsel\n"}, {"input": "999999999 1000000000 1000000000\n", "output": "Marsel\n"}, {"input": "999999999 1000000000 1000000100\n", "output": "Marsel\n"}, {"input": "1262564090 1000000000 5000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAt the first holiday in spring, the town Shortriver traditionally conducts a flower festival. Townsfolk wear ... | [{"input": "100 15 6 10\n12 9 1 7 6 4 1 9 3 2 4 6 2 5 3 8 9 2 9 1 6 5 6 2 3 10 7 10 7 4 5 4 4 4 4 7 1 10 8 4 8 3 10 10 7 4 4 10 6 1 8 5 4 6 2 4 10 3 2 5 7 5 6 10 10 3 4 5 4 3 3 1 7 8 10 10 10 10 8 3 7 4 2 1 8 6 5 6 5 8 7 9 2 1 9 2 4 6 10 8\n6 9 7 8 7 1 4 5 5 8\n", "output": "9\n18 19 23 24 25 26 28 32 33 "}, {"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\nBakry faced a problem, but since he's lazy to solve it, he asks for your help.\n\nYou are given a tree of $n$... | [{"input": "5\n2 2\n1 3\n1 2\n5 5\n3 3 3 3 3\n1 2\n2 3\n1 4\n4 5\n5 2\n1 7 2 3 5\n1 2\n2 3\n1 4\n4 5\n5 3\n1 6 4 1 2\n1 2\n2 3\n1 4\n4 5\n3 3\n1 7 4\n1 2\n2 3\n", "output": "NO\nYES\nNO\nYES\nNO\n"}, {"input": "1\n9 3\n2 2 1 1 3 2 1 1 2\n1 2\n2 3\n2 4\n1 5\n1 6\n6 7\n6 8\n6 9\n", "output": "NO\n"}, {"input": "1\n8 3\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\nOn a chessboard with a width of $10^9$ and a height of $10^9$, the rows are numbered from bottom to top from ... | [{"input": "0 5\n1 192023486 84774294\n243235878 312125306 50510976\n326016273 338641867 50510976\n570999440 445224816 125759940\n456157384 569789185 50510976\n", "output": "0\n"}, {"input": "0 5\n1 192023486 50510976\n243235878 312125306 50510976\n326016273 338641867 50510976\n570999440 445224816 50510976\n456157384 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\nWrite a program which counts and reports the number of each alphabetical letter. Ignore the case of character... | [{"input": "This is ` pen.", "output": "a : 0\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\ni : 2\nj : 0\nk : 0\nl : 0\nm : 0\nn : 1\no : 0\np : 1\nq : 0\nr : 0\ns : 2\nt : 1\nu : 0\nv : 0\nw : 0\nx : 0\ny : 0\nz : 0\n"}, {"input": "This si a pen.", "output": "a : 1\nb : 0\nc : 0\nd : 0\ne : 1\nf : 0\ng : 0\nh : 1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe string $s$ is given, the string length is odd number. The string consists of lowercase letters of the Lat... | [{"input": "5\nabcde\nc\nabcde\nb\nx\ny\naaaaaaaaaaaaaaa\na\ncontest\nt\n", "output": "YES\nNO\nNO\nYES\nYES\n"}, {"input": "5\nabcde\nc\nabcde\nb\nx\ny\nabobobussss\ns\ncontest\nt\n", "output": "YES\nNO\nNO\nYES\nYES\n"}, {"input": "1\nqwertyuioppoiuytrewqplkmnjiuhbs\nz\n", "output": "NO\n"}, {"input": "1\nadsfdxvxvsd... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAndi and Budi were given an assignment to tidy up their bookshelf of $n$ books. Each book is represented by t... | [{"input": "5 2\nAA\nAB\nBB\nBA\nAZ\n", "output": "5 2 1 3 4 \n"}, {"input": "5 2\nAA\nAB\nBB\nBA\nAZ\n", "output": "5 2 1 3 4\n"}, {"input": "5 2\nAA\nAB\nBB\nBA\nZA\n", "output": "2 1 3 4 5\n"}, {"input": "5 2\nAA\nAB\nCB\nBA\nAZ\n", "output": "5 2 1 4 3\n"}, {"input": "5 2\nAA\nAB\nBC\nBA\nAZ\n", "output": "5 2 1 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\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some... | [{"input": "14\n0\n15028", "output": "1074\n"}, {"input": "14\n0\n19420", "output": "1388\n"}, {"input": "14\n0\n25749", "output": "1840\n"}, {"input": "14\n0\n16704", "output": "1194\n"}, {"input": "14\n1\n20917", "output": "1495\n"}, {"input": "14\n2\n28787", "output": "2057\n"}, {"input": "14\n4\n25994", "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\nThree companies decided to order a billboard with pictures of their logos. A billboard is a big square board.... | [{"input": "17 100 100 22 61 100\n", "output": "100\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHr0d1y has $q$ queries on a binary string $s$ of length $n$. A binary string is a string containing only char... | [{"input": "2\n6 3\n001000\n2 4\n1 3\n3 5\n4 2\n1111\n1 4\n2 3\n", "output": "\nYES\nNO\nYES\nNO\nYES\n"}, {"input": "2\n6 3\n001000\n2 4\n1 3\n3 5\n4 2\n1111\n1 4\n2 3\n", "output": "YES\nNO\nYES\nNO\nYES\n"}, {"input": "2\n6 3\n001000\n2 4\n1 3\n3 5\n4 2\n1111\n1 4\n1 3\n", "output": "YES\nNO\nYES\nNO\nYES\n"}, {"inp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTo write a research paper, you should definitely follow the structured format. This format, in many cases, is... | [{"input": "5\n1 2 1 4 11\n3\n12 28 16\n0", "output": "1-2 1 4 11\n12 28 16\n"}, {"input": "5\n1 2 1 4 9\n3\n12 28 16\n0", "output": "1-2 1 4 9\n12 28 16\n"}, {"input": "5\n1 2 1 4 0\n3\n12 28 16\n0", "output": "1-2 1 4 0\n12 28 16\n"}, {"input": "5\n1 2 4 4 9\n3\n13 14 14\n0", "output": "1-2 4 4 9\n13-14 14\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\nTakahashi has a maze, which is a grid of H \\times W squares with H horizontal rows and W vertical columns.\n... | [{"input": "20 20\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\nFor given an integer $n$, print all permutations of $\\\\{1, 2, ..., n\\\\}$ in lexicographic order.\n\nConst... | [{"input": "5", "output": "1 2 3 4 5\n1 2 3 5 4\n1 2 4 3 5\n1 2 4 5 3\n1 2 5 3 4\n1 2 5 4 3\n1 3 2 4 5\n1 3 2 5 4\n1 3 4 2 5\n1 3 4 5 2\n1 3 5 2 4\n1 3 5 4 2\n1 4 2 3 5\n1 4 2 5 3\n1 4 3 2 5\n1 4 3 5 2\n1 4 5 2 3\n1 4 5 3 2\n1 5 2 3 4\n1 5 2 4 3\n1 5 3 2 4\n1 5 3 4 2\n1 5 4 2 3\n1 5 4 3 2\n2 1 3 4 5\n2 1 3 5 4\n2 1 4 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\nToday an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya... | [{"input": "519325240668210886 776112702001665034 360568516809443669 1272711703453279586 994594983925273138\n", "output": "256787461333454149\n"}, {"input": "519325240668210886 776112702001665034 360568516809443669 875594219634943179 994594983925273138\n", "output": "256787461333454149\n"}, {"input": "51932524066821088... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N. Determine if it is possible ... | [{"input": "6\n0 0 1 2 3 12\n0 2 14 6 2 3", "output": "Yes\n"}, {"input": "6\n1 0 1 2 3 12\n0 2 14 6 2 3", "output": "Yes\n"}, {"input": "6\n1 0 1 2 3 12\n0 4 14 6 2 3", "output": "Yes\n"}, {"input": "6\n1 0 1 2 3 12\n1 4 14 6 2 3", "output": "Yes\n"}, {"input": "6\n0 0 1 2 3 6\n1 2 14 6 2 3", "output": "Yes\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\nA special type of prime is generated by the formula `p = 2^m * 3^n + 1` where `m` and `n` can be any non-nega... | [{"input": "1000000\n1500000", "output": "[2]", "fn_name": "solve"}, {"input": "750000\n1000000", "output": "[3]", "fn_name": "solve"}, {"input": "500000\n1000000", "output": "[5]", "fn_name": "solve"}, {"input": "300000\n900000", "output": "[6]", "fn_name": "solve"}, {"input": "100\n1000000", "output": "[32]", "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\nThe Little Elephant has got a problem — somebody has been touching his sorted by non-decreasing array a of le... | [{"input": "128\n1 2 4 6 8 17 20 20 23 33 43 49 49 49 52 73 74 75 82 84 85 87 90 91 102 103 104 105 111 111 401 142 142 152 155 160 175 176 178 181 183 184 101 188 191 193 326 202 202 214 224 225 236 239 240 243 246 247 249 249 257 257 261 264 265 271 277 281 284 284 286 289 290 296 297 303 305 307 307 317 318 320 322 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMonocarp is the coach of the Berland State University programming teams. He decided to compose a problemset f... | [{"input": "2\n4\n2 4\n3 4\n2 1\n1 3\n5\n1 5\n2 4\n3 3\n4 2\n5 1\n", "output": "3\n10\n"}, {"input": "2\n4\n2 4\n3 4\n2 1\n2 3\n5\n1 5\n2 4\n3 3\n4 2\n5 1\n", "output": "2\n10\n"}, {"input": "2\n4\n2 4\n3 3\n2 2\n1 3\n5\n1 5\n2 4\n3 3\n4 2\n5 1\n", "output": "4\n10\n"}, {"input": "2\n4\n4 4\n3 3\n2 2\n2 3\n5\n1 5\n2 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\nShortest Common Non-Subsequence\n\nA subsequence of a sequence $P$ is a sequence that can be derived from the... | [{"input": "0101\n1101001", "output": "0000\n"}, {"input": "0101\n1101000", "output": "0001\n"}, {"input": "0101\n0011001", "output": "1000\n"}, {"input": "0101\n0110001", "output": "0010\n"}, {"input": "0101\n1001001", "output": "0110\n"}, {"input": "0101\n0101001", "output": "1110\n"}, {"input": "0101\n0100101", "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\nVasya has become interested in wrestling. In wrestling wrestlers use techniques for which they are awarded po... | [{"input": "131\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n0\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\n-1\n1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFurik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a goo... | [{"input": "1000 1010\n", "output": "0\n"}, {"input": "1000 1000\n", "output": "0"}, {"input": "1190 225\n", "output": "0\n"}, {"input": "1190 315\n", "output": "0\n"}, {"input": "1491 512\n", "output": "0\n"}, {"input": "247 438\n", "output": "0\n"}, {"input": "529 780\n", "output": "0\n"}, {"input": "120 433\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 a given a list of integers $a_1, a_2, \\ldots, a_n$ and $s$ of its segments $[l_j; r_j]$ (where $1 \\... | [{"input": "5 10 1 1\n1000000000 1000000000 1000000000 1 1000000000\n1 1\n1 3\n5 5\n1 1\n2 3\n3 3\n3 4\n1 2\n2 2\n3 3\n", "output": "1\n"}, {"input": "5 10 1 1\n1000000000 1000000000 1000000000 1 1000000000\n1 1\n1 3\n5 5\n1 1\n2 3\n3 3\n3 4\n1 2\n2 2\n3 3\n", "output": "1\n"}, {"input": "5 10 1 1\n1000000000 100000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSeiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aizu for a long time in ... | [{"input": "16\n10 8\n2 2\n2 6\n2 7\n6 6\n4 8\n4 2\n5 5\n4 8\n10 2\n6 7\n7 7\n7 8\n8 1\n5 4\n9 1\n10 3\n4 3\n8\n6 4\n2 2\n2 1\n2 4\n3 4\n4 2\n5 3\n1 1\n3 2\n3 3\n0", "output": "5\n5\n"}, {"input": "16\n10 9\n2 4\n2 6\n2 7\n6 6\n4 8\n4 2\n5 5\n4 8\n6 4\n6 7\n7 6\n7 8\n8 0\n8 4\n9 1\n10 3\n1 3\n8\n6 13\n1 2\n2 1\n2 4\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\nproblem\n\nThere are many $ N $ colored balls of different weights in the queue. The queue is in ascending or... | [{"input": "8 4\n46 70 57 10 174 41 130 43", "output": "193\n"}, {"input": "8 4\n46 70 57 10 174 33 130 43", "output": "201\n"}, {"input": "8 7\n46 70 57 3 174 25 130 43", "output": "1302\n"}, {"input": "8 4\n46 70 57 10 174 38 130 43", "output": "196\n"}, {"input": "8 4\n46 105 57 3 174 25 130 60", "output": "251\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\nOne not particularly beautiful evening Valera got very bored. To amuse himself a little bit, he found the fol... | [{"input": "10 60\n6 7\n2 4\n3 6\n1 4\n8 7\n2 8\n5 7\n6 4\n5 10\n1 7\n3 9\n3 4\n9 2\n7 1\n3 8\n10 7\n9 7\n9 1\n5 5\n4 7\n5 8\n4 2\n2 2\n9 4\n3 3\n7 5\n7 4\n7 7\n8 2\n8 1\n4 5\n1 10\n9 6\n3 1\n1 3\n3 2\n10 10\n4 6\n5 4\n7 3\n10 1\n3 7\n5 1\n10 9\n4 10\n6 10\n7 10\n5 9\n5 6\n1 2\n7 8\n3 5\n9 8\n9 5\n8 10\n4 3\n10 6\n9 10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is constraints.\n\nNauuo is a girl who loves random pictur... | [{"input": "100 3000\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 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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\n10 8 1 9 7 5 12 9 15 7 16 5 17 5 17 21 11 3 4 4 30 17 3 84 12 30 2 8 2 2 22 24 15 11 15 13 7 17 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\nThis is a simplified version of the task Toy Train. These two versions differ only in the constraints. Hacks ... | [{"input": "5000 1\n4008 1126\n", "output": "6125 6124 6123 6122 6121 6120 6119 6118 6117 6116 6115 6114 6113 6112 6111 6110 6109 6108 6107 6106 6105 6104 6103 6102 6101 6100 6099 6098 6097 6096 6095 6094 6093 6092 6091 6090 6089 6088 6087 6086 6085 6084 6083 6082 6081 6080 6079 6078 6077 6076 6075 6074 6073 6072 6071 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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. Each character of S is uppercase or lowercase English letter.\nDetermine if S satis... | [{"input": "AccccCcccc\n", "output": "AC\n"}, {"input": "AmvlkweClF\n", "output": "WA\n"}, {"input": "AcCCCCCCCc\n", "output": "WA\n"}, {"input": "zzzzzzzzzz\n", "output": "WA\n"}, {"input": "abcarCagc\n", "output": "WA\n"}, {"input": "ApproaCh\n", "output": "AC\n"}, {"input": "AcCepted\n", "output": "AC\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\nImplement a function which takes a string, and returns its hash value.\n\nAlgorithm steps:\n\n* `a` := sum of... | [{"input": "\"int main(int argc, char *argv[]) { return 0; }\"", "output": "[188]", "fn_name": "string_hash"}, {"input": "\"; -----> end of hash <-----\"", "output": "[-7136]", "fn_name": "string_hash"}, {"input": "\"int hash(const char *str);\"", "output": "[-9232]", "fn_name": "string_hash"}, {"input": "\" Yo - What'... | 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\nThose days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gend... | [{"input": "yufkkfwyhhvcjntsgsvpzbhqtmtgyxifqoewmuplphykmptfdebjxuaxigomjtwgtljwdjhjernkitifbomifbhysnmadtnyn\n", "output": "CHAT WITH HER!\n"}, {"input": "yufkkfwyhhvcjntsgsvpzbhqtmtgyxifqoewmuplphykmptfdebjxuaxigomjtwgtljwdjhjernkitifbomifbhysnmadtnyn\n", "output": "CHAT WITH HER!\n"}, {"input": "yufkkfwyhhvcjntsgsvp... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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$ children numbered from $1$ to $n$ in a kindergarten. Kindergarten teacher gave $a_i$ ($1 \\leq ... | [{"input": "50\n0 0 2 3 2 4 4 4 0 5 5 10 4 6 6 13 13 13 3 14 14 7 15 7 7 7 5 8 8 8 22 22 3 23 6 24 10 25 25 10 10 3 28 28 0 29 8 4 14 32\n0 0 7 29 2 10 10 10 0 9 9 22 5 8 8 19 19 19 1 18 18 7 17 7 7 7 4 6 6 6 10 10 1 9 3 8 4 7 7 4 4 1 4 4 0 3 1 0 0 0\n", "output": "YES\n50 50 41 18 46 36 36 36 50 36 36 18 41 36 36 18 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSimple interest on a loan is calculated by simply taking the initial amount (the principal, p) and multiplyin... | [{"input": "100\n0.1\n10", "output": "[[200, 259]]", "fn_name": "interest"}, {"input": "100\n0.1\n1", "output": "[[110, 110]]", "fn_name": "interest"}, {"input": "100\n0.1\n2", "output": "[[120, 121]]", "fn_name": "interest"}, {"input": "100\n0.1\n0", "output": "[[100, 100]]", "fn_name": "interest"}, {"input": "100\n0\... | 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*Based on this Numberphile video: https://www.youtube.com/watch?v=Wim9WJeDTHQ*\n\n---\n\nMultiply all the dig... | [{"input": "277777788888899", "output": "[[4996238671872, 438939648, 4478976, 338688, 27648, 2688, 768, 336, 54, 20, 0]]", "fn_name": "per"}, {"input": "3778888999", "output": "[[438939648, 4478976, 338688, 27648, 2688, 768, 336, 54, 20, 0]]", "fn_name": "per"}, {"input": "2379", "output": "[[378, 168, 48, 32, 6]]", "f... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChefs from all over the globe gather each year for an international convention. Each chef represents some cou... | [{"input": "2 2\nNewton Englaod\nEuclid Greece\nNewton\nEuclid", "output": "Englaod\nEuclid\n"}, {"input": "2 1\nNewton Englaod\nEuclid Greece\nNewton\nEuclid", "output": "Englaod\nNewton\n"}, {"input": "2 1\nNewton England\nEuclid Greece\nNewton\nEuclid", "output": "England\nNewton\n"}, {"input": "2 1\nNewton dnalgnE\... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.