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\nEasy and hard versions are actually different problems, so we advise you to read both statements carefully.\n...
[{"input": "4\n4 18\n2 1 9 2\n3 2 4 1\n4 1 1 2\n3 20\n2 1 8 1\n3 1 7 2\n5 50\n1 3 100 1\n1 5 10 2\n2 3 123 2\n5 4 55 1\n2 000\n1 2 409 2\n", "output": "0\n0\n11\n18\n"}, {"input": "4\n4 18\n2 1 18 2\n3 2 4 1\n4 1 2 2\n3 20\n2 1 2 1\n3 1 8 2\n5 50\n1 3 100 1\n1 5 10 2\n2 3 123 2\n5 4 55 2\n1 100\n1 2 409 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\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n* 1 \...
[{"input": "743", "output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n0\n0\n0\n1\n6\n0\n3\n0\n0\n0\n0\n0\n3\n3\n6\n0\n0\n3\n0\n0\n0\n0\n3\n3\n6\n0\n6\n0\n0\n0\n3\n0\n0\n1\n6\n0\n6\n6\n0\n0\n6\n0\n0\n0\n0\n3\n3\n3\n6\n0\n6\n3\n6\n0\n0\n0\n6\n0\n0\n0\n3\n3\n9\n0\n6\n3\n6\n0\n3\n6\n0\n0\n0\n0\n6\n1\n6\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 already know that Valery's favorite sport is biathlon. Due to your help, he learned to shoot without miss...
[{"input": "20 20 2\nbaaaaaaaaaaaaaaaaaaa\nbfffffffacfffffffffa\nbgggggggaccgggggggga\nbhhhhhhhaccchhhhhhha\nbiiiiiiiacccciiiiiia\nbjjjjjjjacccccjjjjja\nbkkkkkkkacccccckkkka\nblllllllacccccccllla\nbbbbbbbbSccccccccmma\nbddddddddddcccccccna\nbodddddddcccccccccca\nbppddddddddTaaaaaaaa\nbqqqdddddddbqqqqqqqa\nbrrrrddddddbr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuick sort is based on the Divide-and-conquer approach. In QuickSort(A, p, r), first, a procedure Partition(A...
[{"input": "12\n40 19 12 2 12 7 0 5 21 -1 10 22", "output": "19 12 2 12 7 0 5 21 -1 10 [22] 40\n"}, {"input": "12\n40 19 12 2 12 11 0 5 21 -1 1 37", "output": "19 12 2 12 11 0 5 21 -1 1 [37] 40\n"}, {"input": "12\n40 19 22 2 12 11 0 5 21 -1 1 37", "output": "19 22 2 12 11 0 5 21 -1 1 [37] 40\n"}, {"input": "12\n40 19 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\nSanta Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his plac...
[{"input": "10000 10000 199999999\n", "output": "10000 10000 L\n"}, {"input": "10000 10000 200000000\n", "output": "10000 10000 R\n"}, {"input": "10000 10000 199999999\n", "output": "10000 10000 L\n"}, {"input": "10000 10000 200000000\n", "output": "10000 10000 R\n"}, {"input": "10000 16759 186450844\n", "output": "556...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ points on a coordinate axis $OX$. The $i$-th point is located at the integer point $x_i$ and ha...
[{"input": "5\n2 1 4 3 5\n2 2 2 3 4\n", "output": "19\n"}, {"input": "5\n2 1 4 3 5\n0 2 2 3 4\n", "output": "18\n"}, {"input": "5\n2 1 4 3 5\n2 2 2 3 4\n", "output": "19\n"}, {"input": "3\n1 3 2\n-100 2 10\n", "output": "3\n"}, {"input": "3\n1 3 2\n-100 2 3\n", "output": "3\n"}, {"input": "3\n1 3 2\n-100 2 6\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nSometimes mysteries happen. Chef found a direc...
[{"input": "12 7\n1 2 \n4 2\n3 4\n7 12\n2 2\n9 9\n10 1", "output": "-1\n"}, {"input": "12 7\n1 2 \n4 2\n3 4\n8 12\n2 2\n9 9\n10 1", "output": "-1\n"}, {"input": "12 7\n1 2 \n4 2\n3 4\n7 7\n2 1\n11 2\n11 1", "output": "-1\n"}, {"input": "12 7\n1 2 \n4 2\n3 4\n7 7\n3 1\n11 2\n11 1", "output": "-1\n"}, {"input": "12 7\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\nYou are walking through a parkway near your house. The parkway has $n+1$ benches in a row numbered from $1$ t...
[{"input": "1\n100 7773\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSlime has a sequence of positive integers $a_1, a_2, \\ldots, a_n$.\n\nIn one operation Orac can choose an ar...
[{"input": "5\n5 3\n1 5 2 6 1\n1 6\n6\n3 2\n1 2 3\n4 3\n3 1 2 3\n10 3\n1 2 3 4 5 6 7 8 9 10\n", "output": "no\nyes\nyes\nno\nyes\n"}, {"input": "5\n5 3\n1 5 2 6 1\n1 6\n6\n3 2\n1 2 3\n4 3\n3 1 2 3\n10 3\n1 2 3 4 8 6 7 8 9 10\n", "output": "no\nyes\nyes\nno\nyes\n"}, {"input": "5\n5 3\n1 5 2 6 1\n1 6\n6\n3 2\n1 2 3\n4 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.\n\nOne day,...
[{"input": "500\n1000\n0", "output": "850\n1520\n"}, {"input": "500\n1100\n0", "output": "850\n1950\n"}, {"input": "500\n2200\n0", "output": "850\n3390"}, {"input": "500\n0000\n-12", "output": "850\n"}, {"input": "500\n0000\n119", "output": "850\n"}, {"input": "500\n0000\n-16", "output": "850\n"}, {"input": "500\n0000\...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nGiven $ N $ different natural numbers $ a_i $. I decided to make a pair by choosing a different na...
[{"input": "5\n0 2 11 13 37", "output": "13 37\n"}, {"input": "5\n1 -1 6 11 22", "output": "-1 11\n"}, {"input": "5\n-2 0 1 10 41", "output": "-2 10\n"}, {"input": "5\n1 2 11 13 35", "output": "1 13\n"}, {"input": "5\n1 2 11 4 35", "output": "11 35\n"}, {"input": "5\n2 8 11 13 28", "output": "8 28\n"}, {"input": "5\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\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\nLet A_i be the inte...
[{"input": "6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n", "output": "2\n"}, {"input": "6 5\n1 2 1\n2 3 2\n1 6 3\n4 5 4\n1 4 5", "output": "1\n"}, {"input": "6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n3 6 5", "output": "2\n"}, {"input": "6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n1 6 5", "output": "2\n"}, {"input": "6 5\n1 2 1\n2 3 2\n1 6 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\nThe famous joke programming language HQ9+ has only 4 commands. In this problem we will explore its subset — a...
[{"input": "HQQQQQQQHQQQQHQHQQQHHQHHHQQHQQQQHHQHHQHHHHHHQQQQQQQQHHQQQQQHHQQQQHHHQQQQQQQQHQQQHQHQQQQQQHHHQHHQHQHHQQQQQHQQHQHQQQHQHQHHHHQQHQHQQQQQHQQQHQQQHQQHQHQQHQQQQQQ\n", "output": "No\n"}, {"input": "HQQQQQQQHQQQQHQHQQQHHQHHHQQHQQQQHHQHHQHHHHHHQQQQQQQQHHQQQQQHHQQQQHHHQQQQQQQQHQQQHQHQQQQQQHHHQHHQHQHHQQQQQHQQHQHQQQHQHQ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis problem is same as the next one, but has smaller constraints.\n\nShiro's just moved to the new house. Sh...
[{"input": "10\n30518 30518 30518 30518 30518 30518 30518 30518 30518 30518\n", "output": "10\n"}, {"input": "10\n30518 96518 74071 59971 50121 4862 43967 73607 19138 90754\n", "output": "10\n"}, {"input": "10\n63649 14562 779 31060 84730 3390 1402 70955 27426 79066\n", "output": "10\n"}, {"input": "10\n4131 4373 75721...
code_stdio
[ { "content": "You are an expert Python programmer. 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 simplified version of the problem used on the original contest. The original problem seems to have to...
[{"input": "10 2 1\n14 15 15 14 14 15 14 15 14 15\n", "output": "50\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 5 5 5 5 5 5 5 6 7 7 7 7 7 7 7 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 \n"}, {"input": "10 2 1\n14 15 15 14 15 14 15 14 15 15\n", "output": "50\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 5 5 5 5 5 5 5 7 7 7 7 7 7 7 7 9 9 9 9 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\nProblem statement\n\nThere is an unsigned $ 2 $ decimal integer $ X $ with $ N $ in digits including Leading-...
[{"input": "5\n00001\n4", "output": "11111\n"}, {"input": "5\n00000\n3", "output": "11100\n"}, {"input": "5\n00001\n1", "output": "10001\n"}, {"input": "5\n10001\n1", "output": "11001\n"}, {"input": "5\n10001\n2", "output": "11101\n"}, {"input": "5\n10001\n4", "output": "11110\n"}, {"input": "5\n10000\n1", "output": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two strings $s$ and $t$. The string $s$ consists of lowercase Latin letters and at most one wil...
[{"input": "5 102\neyw*y\neywsnxcwslfyiqbbeoaawtmioksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqguyfk\n", "output": "NO\n"}, {"input": "5 102\neyw*y\neywsnxcwslfyiqbbeoaawtmioksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqguyfk\n", "output": "NO\n"}, {"input": "5 102\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nExample\n\nInput\n\nACM\n\n\nOutput\n\n0### Format: Read the inputs from stdin solve the problem and write th...
[{"input": "ABM", "output": "0\n"}, {"input": "BIB", "output": "2\n"}, {"input": "1MI", "output": "1\n"}, {"input": "MCA", "output": "0\n"}, {"input": "MAC", "output": "0\n"}, {"input": "M@C", "output": "0\n"}, {"input": "C@M", "output": "0\n"}, {"input": "@MC", "output": "0\n"}, {"input": "?MC", "output": "0\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\nThe programming competition season has already started and it's time to train for ICPC. Sereja coaches his te...
[{"input": "100\n56 22 13 79 28 73 16 55 34 0 97 19 22 36 22 80 30 19 36 92 9 38 24 10 61 43 19 12 18 34 21 36 1 17 0 97 72 37 74 70 51 34 33 87 27 33 45 97 38 56 2 32 88 92 64 51 74 94 86 98 57 62 83 3 87 61 9 65 57 13 64 10 50 35 7 75 41 3 70 66 6 55 69 42 91 75 14 22 68 93 2 53 22 98 45 2 78 58 18 13\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\nLittle penguin Polo loves his home village. The village has n houses, indexed by integers from 1 to n. Each h...
[{"input": "1000 8\n", "output": "339760446\n"}, {"input": "1000 1\n", "output": "760074701\n"}, {"input": "1000 2\n", "output": "675678679\n"}, {"input": "1000 3\n", "output": "330155123\n"}, {"input": "1000 4\n", "output": "660270610\n"}, {"input": "1000 5\n", "output": "583047503\n"}, {"input": "1000 6\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\nJzzhu has invented a kind of sequences, they meet the following property:$f_{1} = x ; f_{2} = y ; \\forall i(...
[{"input": "-1000000000 1000000000\n2000000000\n", "output": "1000000000\n"}, {"input": "-1000000000 1000000000\n2000000000\n", "output": "1000000000\n"}, {"input": "-1030333966 -143148799\n1287886520\n", "output": "856851208\n"}, {"input": "-1048223347 -1308375581\n154879215\n", "output": "739847773\n"}, {"input": "-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\nAfter you had helped George and Alex to move in the dorm, they went to help their friend Fedor play a new com...
[{"input": "13 27 7\n1893\n370\n7320\n5753\n4418\n2146\n2702\n5013\n5959\n1929\n7611\n7013\n540\n3454\n4271\n2887\n4724\n3520\n2111\n5845\n1868\n7659\n3040\n3775\n6507\n4917\n7506\n2515\n", "output": "20\n"}, {"input": "13 27 7\n1893\n370\n7320\n5753\n4418\n2146\n2702\n5013\n5959\n1929\n7611\n7013\n540\n3454\n4271\n288...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNowadays the one-way traffic is introduced all over the world in order to improve driving safety and reduce t...
[{"input": "50\n30 34 48\n11 30 15\n11 5 179\n4 5 57\n43 4 21\n14 43 74\n14 19 52\n45 19 60\n45 28 52\n24 28 94\n24 26 2\n48 26 34\n48 13 53\n13 42 7\n42 37 23\n37 17 70\n17 7 29\n20 7 93\n33 20 21\n33 2 53\n21 2 83\n49 21 33\n46 49 28\n18 46 1\n36 18 99\n47 36 52\n47 29 41\n41 29 40\n31 41 45\n31 38 25\n38 25 41\n25 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\nCatherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she sta...
[{"input": "100\n1 2 3 4 5 6 7 15 11 10 11 5 13 14 15 16 17 18 19 20 3 22 23 24 16 26 27 28 29 29 43 32 33 34 35 36 37 38 39 40 41 76 43 44 45 46 47 48 41 50 51 52 53 54 55 97 57 58 59 60 61 62 63 64 65 66 67 68 30 70 71 72 73 74 75 76 77 78 79 80 81 88 83 84 85 86 87 88 265 90 91 92 93 94 95 96 97 98 99 100\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Petya loves inequations. Help him find n positive integers a1, a2, ..., an, such that the following tw...
[{"input": "45678 783917268558 931068\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\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\nYou have the `radius` of a circle with the center in point `(0,0)`.\n\nWrite a function that calculates the n...
[{"input": "1000", "output": "[3141549]", "fn_name": "points"}, {"input": "99", "output": "[30757]", "fn_name": "points"}, {"input": "55", "output": "[9477]", "fn_name": "points"}, {"input": "33", "output": "[3409]", "fn_name": "points"}, {"input": "42", "output": "[5525]", "fn_name": "points"}, {"input": "15", "output...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 d...
[{"input": "-17 -91 -17 -27 -81 -27 -81 -91\n-48 -21 -12 -57 -48 -93 -84 -57\n", "output": "YES\n"}, {"input": "-17 -91 -17 -27 -81 -27 -81 -91\n-48 -21 -12 -57 -48 -93 -84 -57\n", "output": "YES\n"}, {"input": "-100 -100 -100 -99 -99 -99 -99 -100\n-10 -10 -9 -9 -10 -8 -11 -9\n", "output": "NO\n"}, {"input": "-100 -100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMr. Chanek gives you a sequence a indexed from 1 to n. Define f(a) as the number of indices where a_i = i. \n...
[{"input": "7\n2 1 4 2 5 3 7\n", "output": "3\n"}, {"input": "4\n4 3 3 1\n", "output": "1\n"}, {"input": "4\n4 2 3 1\n", "output": "2\n"}, {"input": "1\n200000\n", "output": "0\n"}, {"input": "1\n69861\n", "output": "0\n"}, {"input": "1\n70524\n", "output": "0\n"}, {"input": "1\n46702\n", "output": "0\n"}, {"input": "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\nWe're giving away nice huge bags containing number tiles! A bag we want to present to you contains n tiles. E...
[{"input": "214\n1 2 2 1 1 1 2 2 2 2 1 1 1 2 2 2 2 2 2 1 2 1 1 2 2 1 1 2 2 2 2 1 2 2 2 1 1 2 2 2 1 1 2 2 1 2 2 2 1 1 2 1 1 2 1 1 1 2 2 2 2 1 2 2 2 1 2 1 2 1 1 2 2 1 1 2 1 2 2 2 2 2 2 2 1 2 1 2 2 1 2 2 2 1 2 2 1 2 2 1 2 2 2 2 1 2 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 1 1 1 2 2 2 1 2 1 2 1 1 2 1 1 1 2 2 2 1 2 2 2 2 2 2 2 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\nproblem\n\nThere is a mysterious device $ M $, and if you put Tanuki and Fox in this device, one animal will ...
[{"input": "3\nF S T", "output": "T\n"}, {"input": "3\nF R T", "output": "T\n"}, {"input": "3\nG S T", "output": "T\n"}, {"input": "3\nG R T", "output": "T\n"}, {"input": "3\nH R T", "output": "T\n"}, {"input": "3\nF U T", "output": "T\n"}, {"input": "3\nE S T", "output": "T\n"}, {"input": "3\nE T T", "output": "T\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 an integer $x$ and an array of integers $a_1, a_2, \\ldots, a_n$. You have to determine if the ...
[{"input": "79 6\n2 2 4 3 5 1 2 2 1 5 5 3 2 1 3 4 2 1 2 1 2 2 3 1 6 6 6 3 1 3 6 3 4 5 1 2 2 3 1 5 3 4 1 3 1 3 1 1 5 2 3 3 2 2 3 1 3 5 5 1 1 3 3 4 3 1 5 4 1 4 4 1 3 1 2 1 1 1 1\n", "output": "Yes\n"}, {"input": "10 5\n4 3 2 1 4 3 2 4 3 4\n", "output": "No\n"}, {"input": "2 500000\n499999 499999\n", "output": "No\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have array a_1, a_2, ..., a_{n}. Segment [l, r] (1 ≤ l ≤ r ≤ n) is good if a_{i} = a_{i} - 1 + a_{i} - 2,...
[{"input": "51\n1 -1 1 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 -1 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0\n", "output": "16\n"}, {"input": "51\n1 -1 1 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 -1 0 -1 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0\n", "output": "16\n"}, {"input": "51\n1 -1 1 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\nChef is very fond of horses. He enjoys watching them race. As expected, he has a stable full of horses. He, a...
[{"input": "1\n5\n16 10 -2 29 41", "output": "6\n"}, {"input": "1\n5\n16 7 -1 29 41", "output": "8\n"}, {"input": "1\n5\n16 7 -2 29 41", "output": "9\n"}, {"input": "1\n5\n1 13 -1 12 14", "output": "1\n"}, {"input": "1\n5\n1 13 -2 12 14", "output": "1\n"}, {"input": "1\n5\n11 7 0 29 24", "output": "4\n"}, {"input": "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 a permutation p_1, p_2, ... , p_n (an array where each integer from 1 to n appears exactly once...
[{"input": "6\n2 6 1 4 3 5\n4 1 1 1 1 13\n", "output": "1\n"}, {"input": "6\n3 5 6 1 2 4\n10 5 4 5 9 2\n", "output": "2\n"}, {"input": "6\n2 6 1 4 3 5\n4 1 1 1 1 18\n", "output": "1\n"}, {"input": "6\n3 5 6 1 2 4\n7 5 4 5 9 2\n", "output": "2\n"}, {"input": "6\n2 6 1 4 3 5\n4 1 1 1 1 9\n", "output": "1\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\nGeorge decided to prepare a Codesecrof round, so he has prepared m problems for the round. Let's number the p...
[{"input": "29 100\n20 32 41 67 72 155 331 382 399 412 465 644 484 511 515 529 690 637 679 715 733 763 826 843 862 903 276 979 989\n15 15 15 17 18 22 19 20 21 21 22 8 25 26 26 27 28 31 32 32 37 42 38 39 39 40 41 42 43 43 35 45 46 47 49 49 50 50 50 51 52 53 53 55 56 57 24 59 59 60 60 62 62 63 63 64 64 64 66 67 69 69 70 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string s, consisting of small Latin letters. Let's denote the length of the string as |s|. Th...
[{"input": "xxxxxxxxxxfxxxxxxxxxxxxxxxxxxxxxxxxxxxrxtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxexxxxmxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxxxxxxxxexxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxuxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Chef's birthday. His mom decided to surprise him with a truly fantastic gift: his favourite binary s...
[{"input": "2\n101\n011\n1111\n1010", "output": "Lucky Chef\n1\nUnlucky Chef\n"}, {"input": "2\n001\n111\n1111\n1010", "output": "Lucky Chef\n2\nUnlucky Chef\n"}, {"input": "2\n111\n110\n1111\n1010", "output": "Unlucky Chef\nUnlucky Chef\n"}, {"input": "2\n110\n110\n1111\n1010", "output": "Lucky Chef\n0\nUnlucky Chef\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\nI have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Studen...
[{"input": "4 6\n0 0 1 0 1 1\n2 2 0 1 0 0\n1 1 2 0 2 1\n1 0 1 -1 1 0\n4 6\n1 0 1 0 1 1\n0 1 -1 2 -1 0\n1 1 1 0 -1 0\n1 0 1 0 1 0\n0 0", "output": "1 3 5 2 6 4\n1 2 3 4 6 5\n"}, {"input": "4 6\n1 0 1 0 1 1\n2 2 0 1 0 0\n1 1 2 0 2 1\n1 0 1 -1 0 0\n4 6\n1 0 1 0 1 1\n0 1 -1 2 -1 0\n1 1 1 0 -1 0\n1 0 1 0 1 0\n0 0", "output"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi has a string S of length N consisting of lowercase English letters. On this string, he will perform...
[{"input": "10 2\nbbbabbbaaa", "output": "aaaaaaaaaa\n"}, {"input": "10 3\nbbaabbbaab", "output": "aaaaaaaabb\n"}, {"input": "10 2\nbaabbbaabb", "output": "aaaabbbaab\n"}, {"input": "10 2\nbaabbaaabb", "output": "aaaaaabbbb\n"}, {"input": "10 2\nbbaaabbbab", "output": "aaaaaabbba\n"}, {"input": "10 2\nbabbbbaabb", "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\nIt's another Start[c]up finals, and that means there is pizza to order for the onsite contestants. There are ...
[{"input": "25 6\n1 10 5\n1 8 4\n1 8 2\n4 8 9\n3 2 8\n1 9 5\n2 10 10\n1 9 6\n3 5 4\n2 7 8\n2 3 2\n2 6 8\n3 7 8\n4 3 7\n1 8 1\n3 6 4\n3 2 8\n2 2 1\n4 8 8\n4 13 4\n3 10 2\n3 6 6\n2 2 5\n1 6 2\n4 1 5\n", "output": "451\n"}, {"input": "25 6\n1 10 5\n1 8 4\n1 5 2\n4 8 9\n3 2 8\n1 9 5\n2 10 10\n1 9 6\n3 5 4\n2 7 8\n2 3 2\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\nPolycarp plans to conduct a load testing of its new project Fakebook. He already agreed with his friends that...
[{"input": "100\n9997 9615 4045 2846 7656 2941 2233 9214 837 3312 5832 578 6146 8773 164 7303 3260 8684 1732 6608 9061 9224 7263 7279 1361 1823 8075 5946 2236 6529 6783 7494 510 1217 1135 8745 6517 141 8180 1948 6827 6091 2730 897 1254 705 1990 1806 1957 2571 8355 5542 5536 1527 886 2093 1532 4868 2348 7387 5218 3181 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\nSuppose you are living with two cats: A and B. There are $n$ napping spots where both cats usually sleep.\n\n...
[{"input": "7\n2 1\n2 2\n3 1\n3 2\n3 3\n5 5\n69 1337\n", "output": "\n1\n2\n1\n3\n2\n2\n65\n"}, {"input": "7\n2 1\n2 2\n3 1\n3 2\n3 3\n5 5\n69 1337\n", "output": "1\n2\n1\n3\n2\n2\n65\n"}, {"input": "7\n2 1\n2 2\n3 1\n3 2\n3 3\n5 5\n69 1154\n", "output": "1\n2\n1\n3\n2\n2\n14\n"}, {"input": "7\n2 1\n2 2\n3 1\n3 2\n5 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\nOne day Mr. Takahashi picked up a dictionary containing all of the N! permutations of integers 1 through N. T...
[{"input": "10\n0 3 0 0 1 0 6 0 0 0", "output": "422479810\n"}, {"input": "10\n0 5 0 0 1 0 6 0 0 0", "output": "248297410\n"}, {"input": "10\n0 3 0 0 1 0 2 0 0 0", "output": "509059163\n"}, {"input": "10\n0 3 0 0 1 0 8 0 0 0", "output": "891629577\n"}, {"input": "10\n0 3 0 0 2 0 4 0 0 0", "output": "688254850\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 are N squares arranged in a row from left to right.\nThe height of the i-th square from the left is H_i...
[{"input": "9449\n43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482505 43482...
code_stdio
[ { "content": "You are an expert Python programmer. 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 sequences $a_1, a_2, \\dots, a_n$ and $b_1, b_2, \\dots, b_n$. Each element of both sequenc...
[{"input": "1\n45094381 58629867 47778466\n33028864 48902149 69571701\n", "output": "46602292\n"}, {"input": "1\n45094381 58629867 47778466\n33028864 48902149 69571701\n", "output": "46602292\n"}, {"input": "3\n2 3 2\n3 3 1\n4 0 1\n2 3 0\n0 0 1\n0 0 1\n", "output": "4\n2\n0\n"}, {"input": "3\n2 3 2\n3 3 1\n4 0 1\n3 3 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\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame ...
[{"input": "5 7\n2 1\n17 12\n0 0", "output": "#######\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\nYou are given string s. Let's call word any largest sequence of consecutive symbols without symbols ',' (comm...
[{"input": ";.,;,.;,.;,.;,.,,.,.,,,,,....;;...;..,,;,aa,00a,01a,0,0.,.,,.0.;10.1;1b1,A,A.n,000000;00,0000.0,0.0000;;;;;;;;...\n", "output": "\"0\"\n\",.,,,.,,.,,.,,.,,.,.,,,,,....,,...,..,,,,aa,00a,01a,0.,.,,.0.,10.1,1b1,A,A.n,000000,00,0000.0,0.0000,,,,,,,,...\"\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\nWrite a program to find the remainder when an integer A is divided by an integer B.\n\n-----Input-----\n\nThe...
[{"input": "3 \n1 4\n111 1167\n12 36", "output": "1\n111\n12\n"}, {"input": "3 \n1 4\n111 1167\n20 36", "output": "1\n111\n20\n"}, {"input": "3 \n2 4\n111 1167\n20 65", "output": "2\n111\n20\n"}, {"input": "3 \n0 2\n100 200\n10 40", "output": "0\n100\n10\n"}, {"input": "3 \n1 2\n100 136\n10 40", "output": "1\n100\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\nYou are given an integer N. Consider all possible segments on the coordinate axis with endpoints at integer p...
[{"input": "100\n", "output": "2550\n"}, {"input": "100\n", "output": "2550\n"}, {"input": "63\n", "output": "1024\n"}, {"input": "64\n", "output": "1056\n"}, {"input": "65\n", "output": "1089\n"}, {"input": "66\n", "output": "1122\n"}, {"input": "67\n", "output": "1156\n"}, {"input": "68\n", "output": "1190\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\nLet there be an array $b_1, b_2, \\ldots, b_k$. Let there be a partition of this array into segments $[l_1; r...
[{"input": "30\n1\n0\n2\n0 0\n2\n0 1\n2\n1 0\n1\n1000000000\n2\n1000000000 1000000000\n2\n999999999 1000000000\n2\n1000000000 999999999\n5\n0 1 2 3 4\n5\n4 3 2 1 0\n5\n1 0 0 0 2\n1\n0\n5\n0 0 0 3 0\n1\n1\n1\n0\n1\n0\n1\n1\n2\n2 2\n5\n4 4 5 5 3\n4\n2 1 1 1\n5\n2 1 2 0 2\n1\n0\n1\n0\n4\n0 1 0 0\n2\n0 0\n4\n1 0 0 0\n4\n0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Fire City, there are n intersections and m one-way roads. The i-th road goes from intersection a_i to b_i ...
[{"input": "4 4\n1 2 0\n2 3 1\n3 1 2\n1 4 3\n3\n1 1 2\n1 2 1\n4 0 1\n", "output": "YES\nYES\nYES\n"}, {"input": "4 4\n1 2 1\n2 3 1\n3 1 2\n1 4 3\n3\n1 1 3\n1 2 4\n4 0 1\n", "output": "\nYES\nNO\nYES\n"}, {"input": "4 4\n1 2 1\n2 3 1\n3 1 2\n1 4 3\n3\n1 1 2\n1 2 1\n4 0 1\n", "output": "NO\nYES\nYES\n"}, {"input": "4 4\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet be `n` an integer prime with `10` e.g. `7`. \n\n`1/7 = 0.142857 142857 142857 ...`.\n\nWe see that the de...
[{"input": "1234567", "output": "[34020]", "fn_name": "cycle"}, {"input": "218713", "output": "[9744]", "fn_name": "cycle"}, {"input": "221193", "output": "[3510]", "fn_name": "cycle"}, {"input": "38127", "output": "[6230]", "fn_name": "cycle"}, {"input": "431541", "output": "[726]", "fn_name": "cycle"}, {"input": "181...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\nThe i-th house is built at ...
[{"input": "20 3\n5 10 15\n", "output": "10\n"}, {"input": "37 3\n-1 0 91", "output": "-54\n"}, {"input": "10 3\n-2 9 50", "output": "-31\n"}, {"input": "10 3\n-2 5 50", "output": "-35\n"}, {"input": "10 3\n0 1 110", "output": "-99\n"}, {"input": "10 3\n0 1 100", "output": "-89\n"}, {"input": "7 3\n-1 14 54", "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\nYour math teacher gave you the following problem:\n\nThere are $n$ segments on the $x$-axis, $[l_1; r_1], [l_...
[{"input": "1\n10\n132182352 630066892\n906984407 923129673\n100213482 882571434\n191064823 398771294\n243750814 1483105037\n322757488 608184251\n241900265 682732740\n197067927 815099563\n17475338 866870249\n271628366 729808874\n", "output": "508213113\n"}, {"input": "1\n10\n132182352 57732154\n323711215 923129673\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\nLet's denote a $k$-step ladder as the following structure: exactly $k + 2$ wooden planks, of which\n\n two p...
[{"input": "4\n4\n1 12 1 3\n3\n1 3 1\n5\n2 1 3 1 2\n3\n1 1 2\n", "output": "2\n0\n1\n0\n"}, {"input": "4\n4\n1 12 1 3\n3\n1 3 1\n5\n2 1 3 4 2\n3\n1 1 2\n", "output": "2\n0\n2\n0\n"}, {"input": "4\n4\n1 3 1 3\n3\n3 3 2\n5\n2 3 3 4 2\n3\n1 1 2\n", "output": "2\n1\n2\n0\n"}, {"input": "4\n4\n1 4 1 3\n3\n3 3 2\n5\n2 3 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\n# Task\nJohn is an orchard worker. \n\nThere are `n` piles of fruits waiting to be transported. Each pile of ...
[{"input": "[11, 9, 20, 10, 21, 35, 15, 34, 48, 76, 94, 28, 79, 16, 4, 41, 98, 30, 35, 92, 93, 33, 100, 93, 64, 23, 37, 6, 86, 27, 48, 16, 66, 99, 61, 83, 3, 5, 95]", "output": "[9056]", "fn_name": "comb"}, {"input": "[87, 84, 42, 34, 24, 81, 60, 48, 75]", "output": "[1663]", "fn_name": "comb"}, {"input": "[4, 3, 5, 6,...
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\nRead problems statements in Mandarin Chinese and Russian. \n\nChef wants to hire a new assistant. He publish...
[{"input": "2\n109\n1", "output": "110\n1\n"}, {"input": "2\n185\n1", "output": "228\n1\n"}, {"input": "2\n15\n12", "output": "24\n28\n"}, {"input": "2\n208\n1", "output": "434\n1\n"}, {"input": "2\n78\n3", "output": "168\n4\n"}, {"input": "2\n84\n3", "output": "224\n4\n"}, {"input": "2\n84\n2", "output": "224\n3\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 have a fraction $\\frac{a}{b}$. You need to find the first occurrence of digit c into decimal notation of...
[{"input": "99999 100000 13\n", "output": "-1\n"}, {"input": "69168 84860 4\n", "output": "107\n"}, {"input": "25102 31579 2\n", "output": "174\n"}, {"input": "13805 15538 3\n", "output": "164\n"}, {"input": "38790 39359 0\n", "output": "212\n"}, {"input": "47117 78718 0\n", "output": "213\n"}, {"input": "99999 100000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOhana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is ...
[{"input": "20\n10101011101000011010\n11111010001100110101\n01011100010000001111\n10110100000101010011\n11010001110111101101\n00100110011011101010\n01000110101011001100\n01101100111101101101\n10111010010100111100\n00010010110001101110\n10111110010000101010\n10010111110100100100\n11010111001111110100\n111101111011000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 likes letters. She studied the definition of the lexicographical order at school and plays with it.\n\nA...
[{"input": "100 1 92\nxwcbimztwcyuckyappbkrddnxgnxqvmobveinzvvnseqxooecwrrdeuwzfzxvfkvguqrsofbbnhfcscxggpxzmruycgqfmnnoovd\n", "output": "a\nb\nb\nb\nb\nb\nc\nc\nc\nc\nc\nc\nc\nd\nd\nd\nd\ne\ne\ne\ne\nf\nf\nf\nf\nf\ng\ng\ng\ng\ng\nh\ni\ni\nk\nk\nk\nm\nm\nm\nm\nn\nn\nn\nn\nn\nn\nn\no\no\no\no\no\no\np\np\np\nq\nq\nq\nq\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRalph has a magic field which is divided into n × m blocks. That is to say, there are n rows and m columns on...
[{"input": "1319740251273561528 1167937824526374114 1\n", "output": "855801178\n"}, {"input": "999999999999999999 1000000000000000000 1\n", "output": "102810659\n"}, {"input": "999999999999999999 1000000000000000000 1\n", "output": "102810659\n"}, {"input": "987654321987654321 1167937824526374114 1\n", "output": "18645...
code_stdio
[ { "content": "You are an expert Python programmer. 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 and should process m queries. Each query is described by two 1-based indices l_{i}, ...
[{"input": "tcpyttzcpo\n10\n2 3 6\n2 4 1\n2 6 9\n7 10 5\n2 3 5\n4 10 6\n3 4 5\n7 9 4\n9 10 7\n2 10 8\n", "output": "ttcyopztcp\n"}, {"input": "tcpyzttcpo\n10\n2 3 6\n4 4 1\n2 6 9\n2 10 5\n2 3 5\n4 5 11\n3 4 5\n7 9 4\n9 10 7\n1 10 8\n", "output": "pccozptytt\n"}, {"input": "tcpyzttcpo\n10\n2 3 6\n2 4 1\n2 6 9\n7 10 5\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\nDue to the increase in the number of students of Berland State University it was decided to equip a new compu...
[{"input": "37 80 100\n31\n901706521 USB\n555265160 PS/2\n547038505 PS/2\n644436873 PS/2\n105558073 USB\n915082057 PS/2\n913113815 USB\n953413471 PS/2\n252912707 PS/2\n830344497 USB\n781593007 USB\n610659875 PS/2\n177755858 PS/2\n496444729 PS/2\n617569418 USB\n304908147 PS/2\n188649950 PS/2\n705737216 USB\n473915286 US...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Red Kingdom is attacked by the White King and the Black King!\n\nThe Kingdom is guarded by $n$ castles, t...
[{"input": "10\n6 3 4 5\n2 3 2 3 1 3\n1 5 4 3\n10\n4 4 2 3\n0 10 14 5\n2 2 1 4\n8 5\n3 5 3 5\n9 2 10\n4 5 5 5\n2 10 2 2\n2 3 1 4\n1 10\n3 1 5 3\n11 8 7\n2 5 4 5\n8 8\n3 5 1 4\n5 2 10\n", "output": "0\n2\n3\n2\n5\n12\n5\n0\n0\n2\n"}, {"input": "10\n6 3 4 5\n2 3 2 3 1 3\n1 5 4 3\n10\n4 4 2 3\n0 10 14 5\n2 2 1 4\n8 3\n3 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\nChef likes rectangles. Among all possible rectangles, he loves rectangles that can be drawn like a grid, such...
[{"input": "3\n1 10 2\n4 2 2\n1 9 -2", "output": "2\n1\n-2\n"}, {"input": "3\n2 14 2\n4 2 2\n1 9 -2", "output": "1\n1\n-2\n"}, {"input": "3\n2 18 2\n4 2 3\n1 4 -1", "output": "1\n2\n-1\n"}, {"input": "3\n2 2 1\n3 1 2\n1 5 12", "output": "1\n2\n12\n"}, {"input": "3\n2 2 2\n3 2 2\n1 5 12", "output": "1\n1\n12\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\nThere are just some things you can't do on television. In this case, you've just come back from having a \"de...
[{"input": "\"I don't know if this will work without watering it first.\"", "output": "[\"sludge\"]", "fn_name": "bucket_of"}, {"input": "\"you know what, i don't know what was in that Barth burger\"", "output": "[\"slime\"]", "fn_name": "bucket_of"}, {"input": "\"i'm just going to wash my hands of this\"", "output": "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is an infinite sequence consisting of all positive integers in the increasing order: p = {1, 2, 3, ...}...
[{"input": "30\n1 200000\n2 199999\n3 199998\n4 199997\n5 199996\n200001 399996\n200002 399997\n200003 399998\n200004 399999\n200005 400000\n400001 599998\n400002 599999\n400003 600000\n400004 599996\n400005 599995\n600001 800000\n600002 799999\n600003 799998\n600004 799997\n600005 799996\n600001 799998\n600002 799999\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a garden consisting entirely of grass and weeds. Your garden is described by an n × m grid, with row...
[{"input": "3 150\nGGGWGGGGWWGGGGGGGGGGGGGWGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGGGGGGWGGGGGGGGGGGGGGGGGWGGGGGGGGGGGGGGGGGGW\nGGGGGGGGGGGGWGGGGGGGGGWGGGGGGGGGGGGWGGGGGWGGGGGGGWGGGGGGGWGGGGGWGGGGGGGGGGGGGGGGGGGGGGGGWGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGWGG...
code_stdio
[ { "content": "You are an expert Python programmer. 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<image>\n\nInput\n\nThe input contains two integers row, col (0 ≤ row, col ≤ 63), separated by a single space...
[{"input": "27 36\n", "output": "OUT\n"}, {"input": "0 45\n", "output": "OUT\n"}, {"input": "53 27\n", "output": "IN\n"}, {"input": "0 18\n", "output": "OUT\n"}, {"input": "51 1\n", "output": "OUT\n"}, {"input": "0 13\n", "output": "OUT\n"}, {"input": "51 0\n", "output": "OUT\n"}, {"input": "1 13\n", "output": "OUT\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\nGildong has a square board consisting of n rows and n columns of square cells, each consisting of a single di...
[{"input": "5\n3\n000\n122\n101\n2\n57\n75\n4\n0123\n5469\n3401\n2340\n1\n9\n8\n42987101\n91120855\n77861569\n87599023\n92834718\n83917348\n19823743\n38947912\n", "output": "4 4 1 0 0 0 0 0 0 0\n0 0 0 0 0 1 0 1 0 0\n9 6 9 9 4 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n18 49 49 49 49 30 15 35 42 42\n"}, {"input": "5\n3\n000\n122\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 an integer $n$ and an array $a_1, a_2, \\ldots, a_n$. You should reorder the elements of the ar...
[{"input": "1\n100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a program which reads an integer n and identifies the number of combinations of a, b, c and d (0 ≤ a, b...
[{"input": "35\n011", "output": "4\n348\n"}, {"input": "35\n010", "output": "4\n282\n"}, {"input": "35\n15", "output": "4\n592\n"}, {"input": "35\n26", "output": "4\n282\n"}, {"input": "35\n13", "output": "4\n480\n"}, {"input": "35\n29", "output": "4\n120\n"}, {"input": "35\n22", "output": "4\n540\n"}, {"input": "35\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\nAoki loves numerical sequences and trees.\n\nOne day, Takahashi gave him an integer sequence of length N, a_1...
[{"input": "10\n-1 0 -2 6 1 -4 0 0 0 -1", "output": "Impossible\n"}, {"input": "10\n-1 0 -2 6 1 -4 0 0 1 -1", "output": "Impossible\n"}, {"input": "10\n-1 1 -2 6 2 -1 2 0 0 2", "output": "Impossible\n"}, {"input": "10\n-1 2 -2 6 2 -1 2 0 0 2", "output": "Impossible\n"}, {"input": "10\n-1 2 -2 6 2 -1 2 0 0 0", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJamie is preparing a Codeforces round. He has got an idea for a problem, but does not know how to solve it. H...
[{"input": "10 19228\n", "output": "Yes\n-10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -10 -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\nA penguin Rocher has $n$ sticks. He has exactly one stick with length $i$ for all $1 \\le i \\le n$.\n\nHe ca...
[{"input": "4\n1\n2\n3\n20\n", "output": "1\n1\n2\n10\n"}, {"input": "4\n1\n3\n3\n20\n", "output": "1\n2\n2\n10\n"}, {"input": "4\n3\n2\n12\n15\n", "output": "2\n1\n6\n8\n"}, {"input": "4\n1\n3\n1\n20\n", "output": "1\n2\n1\n10\n"}, {"input": "4\n3\n2\n15\n15\n", "output": "2\n1\n8\n8\n"}, {"input": "4\n1\n3\n1\n36\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\nFind the longest substring in alphabetical order.\n\nExample: the longest alphabetical substring in `\"asdfaa...
[{"input": "\"asdfaaaabbbbcttavvfffffdf\"", "output": "[\"aaaabbbbctt\"]", "fn_name": "longest"}, {"input": "\"asdfbyfgiklag\"", "output": "[\"fgikl\"]", "fn_name": "longest"}, {"input": "\"abcdeapbcdef\"", "output": "[\"abcde\"]", "fn_name": "longest"}, {"input": "\"asd\"", "output": "[\"as\"]", "fn_name": "longest"},...
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\nPak Chanek has a grid that has $N$ rows and $M$ columns. Each row is numbered from $1$ to $N$ from top to bot...
[{"input": "1000000000 1000000000\n", "output": "999999999000000000\n"}, {"input": "767928735 1000000000\n", "output": "767928734232071265\n"}, {"input": "1000000000 906523442\n", "output": "906523441000000000\n"}, {"input": "647242241 921242095\n", "output": "596266797424092654\n"}, {"input": "2 1000000000\n", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA brave princess in a poor country's tomboy is married to another country for a political marriage. However, ...
[{"input": "3 2 10\n1 2 13 6\n2 3 10 3\n3 2 10\n1 2 3 16\n2 3 9 7\n3 3 10\n1 3 17 6\n1 2 2 4\n2 3 9 19\n4 4 5\n1 3 13 5\n1 4 7 25\n2 3 8 2\n2 4 9 3\n0 0 0", "output": "6\n7\n4\n10\n"}, {"input": "3 2 10\n1 2 8 5\n2 3 10 0\n3 2 10\n1 2 3 8\n2 3 7 7\n3 3 10\n1 3 17 6\n1 2 2 4\n2 3 15 13\n4 4 5\n2 3 9 3\n1 4 7 25\n2 3 8 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\nIvan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. A...
[{"input": "37\n52 52 66 149 149 130 47 47 26 110 185 -1 73 73 65 -1 -1 130 -1 -1 -1 94 97 190 -1 -1 49 49 54 -1 92 92 5 25 48 79 79\n", "output": "903952722\n"}, {"input": "37\n52 52 66 149 149 130 47 47 17 110 185 -1 73 73 65 -1 -1 130 -1 -1 -1 94 97 190 -1 -1 49 49 54 -1 92 92 5 25 48 79 79\n", "output": "903952722\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDreamoon likes sequences very much. So he created a problem about the sequence that you can't find in OEIS: \...
[{"input": "10\n1 1000000000\n2 999999999\n3 39238314\n2 14233839\n3 1308869\n6 99995\n13 14099\n8 474\n9 146\n10 2\n", "output": "1\n3\n5\n3\n5\n23\n209\n59\n89\n1\n"}, {"input": "10\n1 1000000000\n2 999999999\n3 99999998\n4 9999997\n5 999996\n6 99995\n7 9994\n12 993\n15 92\n10 1\n", "output": "1\n3\n5\n11\n17\n23\n29...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle girl Margarita is a big fan of competitive programming. She especially loves problems about arrays and...
[{"input": "10\n449347852 741090797\n541919355 938202256\n442458747 465872502\n463474612 789217678\n146477812 390217056\n302933612 477640295\n48191125 1417399529\n173202385 374432789\n78807265 428215825\n194590462 1318087870\n", "output": "-145871473\n198141451\n11706878\n626346145\n268347434\n-87353342\n-732795327\n-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\nWe have A apples and P pieces of apple.\nWe can cut an apple into three pieces of apple, and make one apple p...
[{"input": "100 100\n", "output": "200\n"}, {"input": "1052 1", "output": "1578\n"}, {"input": "1829 1", "output": "2744\n"}, {"input": "3156 1", "output": "4734\n"}, {"input": "1450 1", "output": "2175\n"}, {"input": "74 28\n", "output": "125\n"}, {"input": "39 85\n", "output": "101\n"}, {"input": "93 70\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 want to encode a given string $S$ to a binary string. Each alphabet character in $S$ should be mapped to a...
[{"input": "aaabbcccdeeegfg", "output": "41\n"}, {"input": "aaadbcccbeedgfg", "output": "42\n"}, {"input": "gegdeebcccbeaaa", "output": "38\n"}, {"input": "aeaaacccbeedgeg", "output": "36\n"}, {"input": "gegdeebccdaaaea", "output": "37\n"}, {"input": "gegdfebccdaaaea", "output": "40\n"}, {"input": "abadbcccbeedhfg", "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\nMost football fans love it for the goals and excitement. Well, this Kata doesn't.\nYou are to handle the refe...
[{"input": "[\"A4R\", \"A2R\", \"A3R\", \"A6R\", \"A8R\", \"A10R\", \"A11R\"]", "output": "[[6, 11]]", "fn_name": "men_still_standing"}, {"input": "[\"A4Y\", \"A5R\", \"B5R\", \"A4Y\", \"B6Y\"]", "output": "[[9, 10]]", "fn_name": "men_still_standing"}, {"input": "[\"A4R\", \"A4R\", \"A4R\"]", "output": "[[10, 11]]", "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\nThere are three horses living in a horse land: one gray, one white and one gray-and-white. The horses are rea...
[{"input": "10 10\n4 8 4 10 2 10 8 10 4 6\n", "output": " 25\n"}, {"input": "10 10\n9 3 6 6 3 3 6 3 6 9\n", "output": " 25\n"}, {"input": "5 20\n11 11 11 11 11\n", "output": " ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPetya organized a strange birthday party. He invited $n$ friends and assigned an integer $k_i$ to the $i$-th ...
[{"input": "6\n6 6\n2 3 1 5 6 6\n629717071 992393438 995305242 999968259 999970082 999971487\n6 6\n2 5 2 2 4 3\n756869732 979591024 993778447 1268827656 999873038 999943064\n6 6\n5 1 4 5 6 4\n733550952 979779220 979918868 983712198 991976436 995169050\n6 6\n4 2 2 3 2 4\n257971677 920812339 981000482 998142568 999902643...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPlease note the non-standard memory limit.\n\nThere are n problems numbered with integers from 1 to n. i-th p...
[{"input": "5\n4\n3 0 1 14\n10 10 87 16\n4\n1 1 0 1\n5 3 56 24\n4\n4 0 6 1\n0 2 19 2\n2\n-1 1\n1 18\n1\n1\n666\n", "output": "160\n104\n40\n17\n0\n"}, {"input": "5\n4\n3 0 1 14\n10 10 87 16\n4\n1 1 0 1\n5 3 56 24\n4\n4 0 6 1\n0 2 22 2\n2\n-1 1\n1 18\n1\n1\n666\n", "output": "160\n104\n46\n17\n0\n"}, {"input": "5\n4\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\nE: Jam\n\nproblem\n\nThere are N cities in a country, numbered 1, \\ 2, \\ ..., \\ N. These cities are connec...
[{"input": "4 4 3\n3 12 1 6\n1 1 2 3\n10 1 9 5\n1 2 1\n2 3 1\n1 3 1\n1 4 1", "output": "20\n18\n13\n"}, {"input": "4 4 3\n3 12 1 6\n1 1 2 3\n10 1 9 5\n1 2 0\n2 3 1\n1 3 1\n1 4 1", "output": "22\n19\n15\n"}, {"input": "4 4 3\n3 12 1 6\n1 1 2 3\n10 1 9 2\n1 2 0\n2 3 1\n1 3 1\n1 4 1", "output": "22\n19\n12\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\nRemainder of Big Integers\n\nGiven two integers $A$ and $B$, compute the remainder of $\\frac{A}{B}$.\n\nInpu...
[{"input": "10 16", "output": "10\n"}, {"input": "11 12", "output": "11\n"}, {"input": "12 47", "output": "12\n"}, {"input": "14 28", "output": "14\n"}, {"input": "18 11", "output": "7\n"}, {"input": "0 100", "output": "0\n"}, {"input": "0 110", "output": "0\n"}, {"input": "1 110", "output": "1\n"}, {"input": "1 111", ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 triangle is called an equable triangle if its area equals its perimeter. Return `true`, if it is an equable...
[{"input": "120\n109\n13", "output": "[false]", "fn_name": "equable_triangle"}, {"input": "17\n17\n30", "output": "[false]", "fn_name": "equable_triangle"}, {"input": "25\n25\n45", "output": "[false]", "fn_name": "equable_triangle"}, {"input": "13\n37\n30", "output": "[false]", "fn_name": "equable_triangle"}, {"input":...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp has an array $a$ consisting of $n$ integers.\n\nHe wants to play a game with this array. The game co...
[{"input": "2\n1000000 1000000\n", "output": "1000000\n"}, {"input": "2\n1000010 1001000\n", "output": "1000010\n"}, {"input": "2\n1000110 1001000\n", "output": "1000110\n"}, {"input": "2\n1000110 1000000\n", "output": "1000000\n"}, {"input": "2\n1100010 1111100\n", "output": "1100010\n"}, {"input": "2\n1110100 1011000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA string is binary, if it consists only of characters \"0\" and \"1\".\n\nString v is a substring of string w...
[{"input": "94\n111111111111010111100111111111111011011111111011111111111011111111111111101111101111110111011111111110011111111001111101111\n", "output": "17\n"}, {"input": "94\n111111111111010111100111111111111011011111111011111111111011111111111111101111101111110111010111111110011111111001111101111\n", "output": "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\nN persons are standing in a row. The height of the i-th person from the front is A_i.\nWe want to have each p...
[{"input": "5\n49 10 1 -4 -1", "output": "190\n"}, {"input": "5\n49 10 2 -4 -1", "output": "189\n"}, {"input": "5\n49 10 0 -4 -1", "output": "191\n"}, {"input": "5\n4 -1 107 3 0", "output": "216\n"}, {"input": "5\n4 -1 107 2 0", "output": "217\n"}, {"input": "5\n8 -1 107 2 0", "output": "221\n"}, {"input": "5\n8 -1 107...
code_stdio
[ { "content": "You are an expert Python programmer. 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 s kilometer long auto race takes place in Berland. The track is represented by a straight line as long ...
[{"input": "9 81812\n8 31 410 547 18 22 77 449 5 491 8 10 382 746 21 61 523\n1 452 181\n1 724 113\n1 113 724\n1 226 362\n46 5 257 2 126 373 6 6 491 9 7 137 23 93 73 163 13 17 106 3 100 5 415 270 2 7 723 597 4 176 3 274 18 1 852 334 14 7 25 163 1 3 199 29 140 32 32 191 2 583 3 23 11 22 23 250 1 79 3 33 83 8 433 59 11 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou all know the Dirichlet principle, the point of which is that if n boxes have no less than n + 1 items, th...
[{"input": "10000 1 1000000000\n", "output": "Masha\n\n"}, {"input": "1010 1 1000000000\n", "output": "Masha\n\n"}, {"input": "2635 2 1000000000\n", "output": "Masha\n\n"}, {"input": "1 30 1000000000\n", "output": "Missing\n\n"}, {"input": "10000 2 1000000000\n", "output": "Stas\n\n"}, {"input": "1000 2 1000000000\n", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point...
[{"input": "-1000000000 -1000000000\n", "output": "-2000000000 0 0 -2000000000\n"}, {"input": "-1000000000 -1000000000\n", "output": "-2000000000 0 0 -2000000000 "}, {"input": "-1000000000 -999999999\n", "output": "-1999999999 0 0 -1999999999\n"}, {"input": "-999999999 -1000000000\n", "output": "-1999999999 0 0 -199999...
code_stdio
[ { "content": "You are an expert Python programmer. 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 written on a piece of paper an array of n positive integers a[1], a[2], ..., a[n] and m good pairs o...
[{"input": "20 19\n512 524288 268435456 2048 16384 8192 524288 16777216 128 536870912 256 1 32768 2097152 131072 268435456 262144 134217728 8388608 16\n3 20\n5 12\n19 20\n10 15\n3 18\n3 4\n6 19\n3 14\n3 16\n5 10\n3 12\n5 20\n12 17\n8 9\n13 18\n2 11\n7 12\n6 11\n2 15\n", "output": "106\n"}, {"input": "20 19\n512 524288 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 You are given n rectangular boxes, the ith box has the length lengthi, the width widthi and the heig...
[{"input": "[5, 7, 4, 1, 2]\n[4, 10, 3, 1, 4]\n[6, 5, 5, 1, 2]", "output": "[true]", "fn_name": "boxes_packing"}, {"input": "[4, 10, 3, 1, 4]\n[5, 7, 4, 1, 2]\n[6, 5, 5, 1, 2]", "output": "[true]", "fn_name": "boxes_packing"}, {"input": "[10, 8, 6, 4, 1]\n[7, 7, 6, 3, 2]\n[9, 6, 3, 2, 1]", "output": "[true]", "fn_name"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJzzhu has a big rectangular chocolate bar that consists of n × m unit squares. He wants to cut this bar exact...
[{"input": "1000000000 1000000000 999999999\n", "output": "1000000000\n"}, {"input": "1000000000 1000000000 1\n", "output": "500000000000000000\n"}, {"input": "1000000000 1000000000 123456\n", "output": "8099000000000\n"}, {"input": "1000000000 1000000000 220000000\n", "output": "4000000000\n"}, {"input": "1000000000 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBerland, 2016. The exchange rate of currency you all know against the burle has increased so much that to sim...
[{"input": "4314752277691991627730686134692292422155753465948025897701703862445837045929984759093775762579123919\n", "output": "9314752277691991627730686134692292422155753465948025897701703862445837045929984759093775762579123914\n"}, {"input": "431475227769199162773068613469229242215575346594802589770170386244583704592...
code_stdio