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\nThe Little Elephant very much loves sums on intervals.\n\nThis time he has a pair of integers l and r (l ≤ r)...
[{"input": "100000000000000000 1000000000000000000\n", "output": "90000000000000000\n"}, {"input": "779547115376367013 980561039207670775\n", "output": "20101392383130376\n"}, {"input": "458985985498001244 985458425544874008\n", "output": "52647244004687276\n"}, {"input": "645762257531682046 885295120956158518\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\nOnce upon a time in the Kingdom of Far Far Away lived Sam the Farmer. Sam had a cow named Dawn and he was dee...
[{"input": "1987385827\n", "output": "3123034907 15899086625\n"}, {"input": "1286843196\n", "output": "1286843244 10294745577\n"}, {"input": "1600010311\n", "output": "1936854671 12800082497\n"}, {"input": "1856589245\n", "output": "1007862841 14852713969\n"}, {"input": "1207747990\n", "output": "1328522831 9661983929\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAshish and Vivek play a game on a matrix consisting of $n$ rows and $m$ columns, where they take turns claimi...
[{"input": "4\n2 2\n0 0\n0 0\n2 2\n1 0\n0 0\n2 3\n0 0 0\n1 1 0\n3 3\n1 0 0\n0 0 0\n1 0 0\n", "output": "Vivek\nAshish\nAshish\nAshish\n"}, {"input": "4\n2 2\n1 0\n0 0\n2 2\n0 0\n0 1\n2 3\n1 0 1\n1 1 0\n3 3\n1 0 0\n0 0 0\n1 0 0\n", "output": "Ashish\nAshish\nVivek\nAshish\n"}, {"input": "4\n2 2\n0 0\n0 0\n2 2\n1 0\n0 0\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical r...
[{"input": "100 100\n", "output": "9801\n"}, {"input": "91 61\n", "output": "5400\n"}, {"input": "-33 13", "output": "-408\n"}, {"input": "-36 13", "output": "-444\n"}, {"input": "-36 17", "output": "-592\n"}, {"input": "-1 -105", "output": "212\n"}, {"input": "-2 -105", "output": "318\n"}, {"input": "-2 -162", "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\nLevko loves array a_1, a_2, ... , a_{n}, consisting of integers, very much. That is why Levko is playing with...
[{"input": "97 29\n2 78 82 356152\n2 14 29 430177\n1 59 84 3680\n1 49 89 -2247\n1 92 96 3701\n2 54 89 377271\n1 62 70 -507\n2 94 97 431563\n1 46 55 -9257\n1 51 83 1627\n1 10 20 6633\n1 17 34 -9263\n2 66 92 383251\n1 12 82 3884\n1 78 96 -5379\n2 13 35 424798\n1 68 91 2939\n2 80 84 214725\n1 61 85 -4390\n1 85 96 3106\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\nThe only difference between easy and hard versions is the constraints.\n\nPolycarp has to write a coursework....
[{"input": "100 10000\n93 99 95 105 94 108 104 104 102 112 106 82 114 104 88 107 105 104 93 96 103 109 105 82 107 95 83 93 120 115 96 104 96 86 87 102 103 108 97 84 108 117 109 107 80 87 102 107 88 97 96 101 101 114 106 103 99 101 105 102 85 94 98 101 115 100 91 92 108 105 94 110 91 89 119 119 93 103 101 84 87 81 105 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 have probably registered on Internet sites many times. And each time you should enter your invented passw...
[{"input": "c7jqaudcqmv8o7zvb5x_gp6zcgl6nwr7tz5or!28.tj8s1m2.wxz5a4id03!rq07?662vy.7.p5?vk2f2mc7ag8q3861rgd0rmbr\n", "output": "Too weak\n"}, {"input": "i6a.,8jb,n0kv4.1!7h?p.96pnhhgy6cl7dg7e4o6o384ys3z.t71kkq,,w,oqi4?u,,m5!rzu6wym_4hm,ohjy!.vvksl?pt,,1\n", "output": "Too weak\n"}, {"input": "M10V_MN_1K8YX2LA!89EYV7!5V...
code_stdio
[ { "content": "You are an expert Python programmer. 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 computer science and discrete mathematics, an [inversion](https://en.wikipedia.org/wiki/Inversion_%28discr...
[{"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0]", "fn_name": "count_inversion"}, {"input": "[14, 12, 17, 124, 1, -12, 21, -24]", "output": "[18]", "fn_name": "count_inversion"}, {"input": "[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]", "output": "[55]", "fn_name": "count_inversion"}, {"input": "[324, 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\nThere is a string S consisting of digits 1, 2, ..., 9.\nLunlun, the Dachshund, will take out three consecutiv...
[{"input": "1111111111\n", "output": "642\n"}, {"input": "2432423234\n", "output": "321\n"}, {"input": "8889998899\n", "output": "135\n"}, {"input": "1234567876\n", "output": "34\n"}, {"input": "6945248811\n", "output": "58\n"}, {"input": "1110111111", "output": "642\n"}, {"input": "1011001000", "output": "643\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\nRead problems statements in Mandarin Chinese and Russian. \n\nAlice and Bob, both have to drink water. But t...
[{"input": "3\n17 13\n3 12\n5 3", "output": "110/221\n1/2\n7/15\n"}, {"input": "3\n17 11\n3 5\n5 3", "output": "93/187\n7/15\n7/15\n"}, {"input": "3\n17 11\n3 6\n5 3", "output": "93/187\n1/2\n7/15\n"}, {"input": "3\n1 2\n11 11\n2 1", "output": "1/2\n60/121\n1/2\n"}, {"input": "3\n17 11\n1 5\n1 3", "output": "93/187\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\nTokitsukaze is one of the characters in the game \"Kantai Collection\". In this game, every character has a c...
[{"input": "100\n", "output": "1 A\n"}, {"input": "100\n", "output": "1 A\n"}, {"input": "101\n", "output": "0 A\n"}, {"input": "130\n", "output": "1 B\n"}, {"input": "121\n", "output": "0 A\n"}, {"input": "118\n", "output": "1 B\n"}, {"input": "112\n", "output": "1 A\n"}, {"input": "109\n", "output": "0 A\n"}, {"input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he h...
[{"input": "100\n4116 4116 4117 4117 4117 4117 4118 4119 4119 4119 4119 4120 4120 4120 4120 4121 4122 4123 4123 4123 4123 4124 4124 4124 4124 4125 4126 4126 4126 4126 4127 4127 4127 4127 4128 4128 4128 4128 4129 4129 4130 4130 4131 4132 4133 4133 4134 4134 4135 4135 4136 4137 4137 4137 4138 4139 4140 4140 4141 4141 414...
code_stdio
[ { "content": "You are an expert Python programmer. 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 starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, t...
[{"input": "63 5\n76826 79919 83599 93821 79919 46132 46132 46132 79919 76826 79919 79919 76826 79919 79919 76826 76826 46132 76826 40347 79919 46132 76826 83599 79919 79919 46132 46132 46132 83599 83599 79919 46132 83599 93821 76826 81314 79919 79919 83599 76826 76826 76826 76826 46132 76826 46132 79919 76826 83599 79...
code_stdio
[ { "content": "You are an expert Python programmer. 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 $l$ and $r$, where $l < r$. We will add $1$ to $l$ until the result is equal to $r...
[{"input": "4\n0 9\n0 10\n10 23\n2 1010000000\n", "output": "9\n11\n14\n1122222220\n"}, {"input": "4\n1 18\n8 10\n10 12\n1 1000000000\n", "output": "18\n3\n2\n1111111110\n"}, {"input": "4\n0 12\n9 10\n6 23\n1 1000000000\n", "output": "13\n2\n19\n1111111110\n"}, {"input": "4\n1 36\n8 10\n10 12\n1 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\nLittle Masha loves arranging her toys into piles on the floor. And she also hates it when somebody touches he...
[{"input": "7\n", "output": "877\n{1,2,3,4,5,6,7}\n{1,2,3,4,5,6},{7}\n{1,2,3,4,5},{6},{7}\n{1,2,3,4,5},{6,7}\n{1,2,3,4,5,7},{6}\n{1,2,3,4,7},{5},{6}\n{1,2,3,4},{5,7},{6}\n{1,2,3,4},{5},{6,7}\n{1,2,3,4},{5},{6},{7}\n{1,2,3,4},{5,6},{7}\n{1,2,3,4},{5,6,7}\n{1,2,3,4,7},{5,6}\n{1,2,3,4,6,7},{5}\n{1,2,3,4,6},{5,7}\n{1,2,3,4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two integers $n$ and $m$. Find the $\\operatorname{MEX}$ of the sequence $n \\oplus 0, n \\oplu...
[{"input": "5\n14 1\n3 0\n2 0\n110 1252\n528350 1051160\n", "output": "0\n0\n0\n1152\n1048576\n"}, {"input": "5\n22 0\n3 0\n1 1\n100 1218\n137071 1051160\n", "output": "0\n0\n2\n1152\n1048576\n"}, {"input": "5\n28 0\n4 0\n1 2\n110 1590\n978289 1283232\n", "output": "0\n0\n2\n1536\n1048576\n"}, {"input": "5\n28 0\n4 0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBuses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at...
[{"input": "60 120\n17 120\n23:00\n", "output": "11\n"}, {"input": "60 120\n17 120\n23:00\n", "output": "11\n"}, {"input": "60 120\n17 175\n23:00\n", "output": "14\n"}, {"input": "111 120\n24 100\n13:00\n", "output": "9\n"}, {"input": "88 120\n17 175\n23:00\n", "output": "14\n"}, {"input": "60 120\n24 100\n13:00\n", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn a far away kingdom young pages help to set the table for the King. As they are terribly mischievous, one n...
[{"input": "98\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\n702\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n-----Input-----\n\nThe input contains a single integer a (1 ≤ a ≤ 30).\n\n\n-----Output-----\n\nOutput a sing...
[{"input": "011\n", "output": "274\n"}, {"input": "010\n", "output": "265\n"}, {"input": "10\n", "output": "265\n"}, {"input": "11\n", "output": "274\n"}, {"input": "12\n", "output": "319\n"}, {"input": "13\n", "output": "346\n"}, {"input": "14\n", "output": "355\n"}, {"input": "15\n", "output": "378\n"}, {"input": "16...
code_stdio
[ { "content": "You are an expert Python programmer. 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 loves sortings.\n\nHe has an array a consisting of n integers. Let's number the array ele...
[{"input": "47\n703599938 780784195 912005704 957182560 961181825 964876912 996677776 997012583 999004240 999888999 999980718 999997556 999997940 999999989 999999991 999999991 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 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\nIn one little known, but very beautiful country called Waterland, lives a lovely shark Valerie. Like all the ...
[{"input": "54 22 1009\n15 7\n17 7\n11 9\n6 11\n12 9\n13 8\n13 12\n22 11\n20 9\n20 7\n16 11\n19 12\n3 12\n15 9\n1 12\n2 10\n16 10\n16 10\n14 10\n15 11\n11 9\n14 8\n10 10\n16 12\n1 8\n3 8\n21 11\n18 12\n2 6\n9 11\n11 7\n15 9\n20 11\n6 8\n8 8\n19 11\n15 7\n9 9\n22 3\n12 9\n17 9\n17 11\n12 7\n15 9\n5 11\n11 11\n18 8\n7 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\nFor a given polygon g, computes the area of the polygon.\n\ng is represented by a sequence of points p1, p2,....
[{"input": "4\n-1 -2\n-1 0\n-1 14\n-5 2", "output": "32.0\n"}, {"input": "4\n-1 -2\n-1 0\n-1 17\n-5 2", "output": "38.0\n"}, {"input": "4\n0 -1\n10 -3\n71 0\n0 11", "output": "502.0\n"}, {"input": "4\n0 -4\n-1 0\n-1 14\n-6 3", "output": "43.5\n"}, {"input": "4\n0 -4\n-1 0\n-1 14\n-5 3", "output": "34.5\n"}, {"input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet N be a positive integer.\nThere is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}).\nSnuke...
[{"input": "3\n23 1 2 -2 1 12 -2 -1 3", "output": "37\n"}, {"input": "3\n8 2 2 13 4 6 4 -1 15", "output": "16\n"}, {"input": "3\n7 1 2 18 11 1 2 2 11", "output": "31\n"}, {"input": "3\n13 2 2 13 4 6 4 0 11", "output": "20\n"}, {"input": "3\n7 1 2 18 11 1 2 0 11", "output": "33\n"}, {"input": "3\n7 4 2 26 14 1 1 1 13", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPashmak's homework is a problem about graphs. Although he always tries to do his homework completely, he can'...
[{"input": "10 12\n1 2 2\n2 1 2\n1 3 1\n3 1 1\n1 4 1\n4 1 1\n2 3 1\n3 2 1\n2 4 1\n4 2 1\n3 4 2\n4 3 2\n", "output": "2\n"}, {"input": "4 12\n1 2 2\n2 1 2\n1 3 1\n3 1 1\n1 4 1\n4 1 1\n2 3 1\n3 2 1\n2 4 1\n4 2 1\n3 4 2\n4 3 2\n", "output": "2\n"}, {"input": "4 12\n1 2 2\n2 1 2\n1 3 1\n3 1 1\n1 4 1\n4 1 1\n2 3 1\n3 2 1\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\nJohn Doe started thinking about graphs. After some thought he decided that he wants to paint an undirected gr...
[{"input": "105906\n", "output": "90\n011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n110111111111111111111111111111111111111111111111111111111111111111111111111111111111111100\n111011...
code_stdio
[ { "content": "You are an expert Python programmer. 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 convert a given number into a string with commas added for easier readability. The number sh...
[{"input": "1000000000.23", "output": "[\"1,000,000,000.23\"]", "fn_name": "commas"}, {"input": "-1000000.123", "output": "[\"-1,000,000.123\"]", "fn_name": "commas"}, {"input": "-1234567.0001236", "output": "[\"-1,234,567\"]", "fn_name": "commas"}, {"input": "9123.212", "output": "[\"9,123.212\"]", "fn_name": "commas"...
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\nA decimal representation of an integer can be transformed to another integer by rearranging the order of digi...
[{"input": "2012 8\n83268 3\n1112 9\n0 1\n20 2\n0 0", "output": "13 86526432 3\n5 74943 4\n5 954197541 14\n0 0 1\n2 63 5\n"}, {"input": "245 9\n83268 23\n821 3\n0 0\n99 1\n0 -1", "output": "3 863098632 14\n12 98765433331976666543211 5\n3 495 1\n"}, {"input": "2012 8\n83268 3\n1112 9\n0 1\n17 2\n0 0", "output": "13 8652...
code_stdio
[ { "content": "You are an expert Python programmer. 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 matrix of size $n \\times m$ is called nice, if all rows and columns of the matrix are palindromes. A seque...
[{"input": "9\n1 1\n132703760\n1 1\n33227322\n1 1\n943066084\n1 1\n729139464\n1 1\n450488051\n1 1\n206794512\n1 1\n372520051\n1 1\n552003271\n1 1\n319080560\n", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"input": "9\n1 1\n132703760\n1 1\n33227322\n1 1\n943066084\n1 1\n729139464\n1 1\n450488051\n1 1\n206794512\n1 1\n372...
code_stdio
[ { "content": "You are an expert Python programmer. 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 3N colored balls with IDs from 1 to 3N. A string S of length 3N represents the colors of the balls. T...
[{"input": "5\nRRRGRBBBBGBGGRG", "output": "12960"}, {"input": "5\nBBRBRRGGRGRGGBB", "output": "11520"}, {"input": "5\nBBBRBGGRBRRGRGG", "output": "25920"}, {"input": "5\nBRRRRGBBGGGBGRB", "output": "1440"}, {"input": "5\nBRRGRBBBBGRGGRG", "output": "1920"}, {"input": "5\nGGBBRBGGBRRGRRB", "output": "2880"}, {"input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n**Steps**\n1. Square the numbers that are greater than zero.\n2. Multiply by 3 every third number.\n3. Multip...
[{"input": "[1, -1, 10, -9, 16, 15, 45, -73, -26]", "output": "[2584]", "fn_name": "calc"}, {"input": "[1, 1, -9, 9, 16, -15, -45, -73, 26]", "output": "[1665]", "fn_name": "calc"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[0]", "fn_name": "calc"}, {"input": "[-5, -5, -5, -5, -5, -5, -5]", "outpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N robots numbered 1 to N placed on a number line. Robot i is placed at coordinate X_i. When activat...
[{"input": "20\n-8 1\n26 4\n0 5\n9 1\n19 4\n22 20\n28 27\n11 8\n-3 20\n-25 17\n10 4\n-18 27\n24 28\n-11 19\n2 27\n-2 18\n-1 12\n-24 29\n31 29\n29 7\n", "output": "110\n"}, {"input": "20\n-8 2\n26 0\n0 5\n15 1\n10 4\n22 10\n28 27\n11 8\n-3 61\n-25 17\n13 4\n-18 27\n24 28\n-11 19\n2 27\n-2 18\n-1 12\n-24 29\n31 68\n29 7"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRevised\n\nThe current era, Heisei, will end on April 30, 2019, and a new era will begin the next day. The da...
[{"input": "HEISEI 1 0 0\nHEISEI 31 4 2\nIETEIH 31 5 3\nIFISEH 142 12 42\nHEISEI 15 8 30\nIEJSEH 103 2 42\nHEISEI 3 3 14\nHEISEI 28 2 23\n#", "output": "HEISEI 1 0 0\nHEISEI 31 4 2\n? 1 5 3\n? 112 12 42\nHEISEI 15 8 30\n? 73 2 42\nHEISEI 3 3 14\nHEISEI 28 2 23\n"}, {"input": "HEISEI 1 0 0\nHEISEI 31 4 2\nIETEIH 31 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\nHDD hard drives group data by sectors. All files are split to fragments and each of them are written in some ...
[{"input": "100\n11 9 35 34 51 74 16 67 26 21 14 80 84 79 7 61 28 3 53 43 42 5 56 36 69 30 22 88 1 27 65 91 46 31 59 50 17 96 25 18 64 55 78 2 63 24 95 48 93 13 38 76 89 94 15 90 45 81 52 87 83 73 44 49 23 82 85 75 86 33 47 19 58 97 37 20 40 10 92 4 6 68 77 54 71 12 62 60 100 39 41 99 72 29 57 8 70 32 66 98\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\nPolycarp wants to buy exactly $n$ shovels. The shop sells packages with shovels. The store has $k$ types of p...
[{"input": "10\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n", "output": "104395301\n104395301\n104395301\n104395301\n104395301\n104395301\n104395301\n104...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a connected weighted undirected graph without any loops and multiple edges. \n\nLet us remind y...
[{"input": "25 25\n17 13 578885\n18 25 860003\n21 12 860003\n16 4 860003\n7 14 752263\n25 11 860003\n11 19 860003\n17 5 752263\n14 25 752263\n8 17 578885\n18 17 860003\n1 16 860003\n6 1 578885\n23 18 752263\n25 10 578885\n5 9 752263\n6 18 752263\n2 15 578885\n19 12 860003\n22 7 578885\n14 5 860003\n15 16 752263\n20 16 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSereja has two sequences a and b and number p. Sequence a consists of n integers a_1, a_2, ..., a_{n}. Simila...
[{"input": "82 50 1\n4 2 2 4 4 3 2 2 3 3 4 3 4 1 4 1 4 3 5 3 4 2 4 4 5 2 5 4 2 4 2 5 3 2 3 4 2 5 4 3 3 4 3 4 1 1 5 2 4 1 3 3 2 4 1 2 2 5 4 4 5 3 3 1 2 3 4 5 3 1 2 3 3 5 5 2 4 1 4 2 3 1\n4 3 3 3 4 1 4 4 5 5 5 2 5 4 1 2 2 1 3 3 3 3 2 5 3 2 4 3 2 2 4 4 4 3 4 2 1 2 3 2 1 1 5 2 3 5 4 5 3 4\n", "output": "2\n24 28\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\nThis is an easier version of the problem. In this version $n \\le 1000$\n\nThe outskirts of the capital are b...
[{"input": "100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 22 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77 63 17 62 91\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\nRaccoon is fighting with a monster.\nThe health of the monster is H.\nRaccoon can use N kinds of special move...
[{"input": "210 5\n31 41 59 26 53\n", "output": "Yes\n"}, {"input": "211 5\n31 41 59 26 53\n", "output": "No\n"}, {"input": "210 3\n31 41 59 26 53", "output": "Yes\n"}, {"input": "210 3\n31 55 59 26 53", "output": "Yes\n"}, {"input": "211 5\n31 33 59 26 53", "output": "No\n"}, {"input": "211 5\n31 33 59 26 24", "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\nFor some time the program of rounding numbers that had been developed by the Codeforces participants during o...
[{"input": "2567340036354357844391998756110821468858185018763415770617907336824217629234299240638243305079104961\n", "output": "$2,567,340,036,354,357,844,391,998,756,110,821,468,858,185,018,763,415,770,617,907,336,824,217,629,234,299,240,638,243,305,079,104,961.00\n"}, {"input": "16094449032068386105581779066195819551...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string $s$ of length $n$ consisting only of the characters 0 and 1.\n\nYou perform the follow...
[{"input": "3\n3 2 -1\n010\n5 -2 5\n01001\n6 -1 -12\n110111\n", "output": "4\n15\n-30\n"}, {"input": "3\n3 3 -1\n010\n5 -2 5\n01001\n6 -1 -12\n110111\n", "output": "7\n15\n-30\n"}, {"input": "3\n3 3 -2\n011\n5 -2 5\n01001\n6 -1 -12\n110111\n", "output": "5\n15\n-30\n"}, {"input": "3\n3 3 -1\n010\n5 -2 5\n01001\n6 -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\nYou are given an integer m as a product of integers a_1, a_2, ... a_{n} $(m = \\prod_{i = 1}^{n} a_{i})$. You...
[{"input": "50\n675 25000 2025 83 450 31250 3750 225 1350 250 72 187500 12000 281250 187500 30000 45000 90000 90 1200 9000 56250 5760 270000 3125 3796875 2250 101250 40 2500 175781250 1250000 45000 2250 3000 31250 46875 135000 421875000 36000 360 140625000 13500 1406250 1125 250 75000 62500 150 6\n", "output": "6873067...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTed has a pineapple. This pineapple is able to bark like a bulldog! At time t (in seconds) it barks for the f...
[{"input": "749399100 103031711 761562532\n", "output": "NO\n"}, {"input": "749399100 103031711 761562532\n", "output": "NO\n"}, {"input": "178769979 103031711 761562532\n", "output": "NO\n"}, {"input": "4363010 696782227 701145238\n", "output": "YES\n"}, {"input": "8897216 734348516 743245732\n", "output": "YES\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\nConsider some square matrix A with side n consisting of zeros and ones. There are n rows numbered from 1 to n...
[{"input": "100\n", "output": "15\n"}, {"input": "89\n", "output": "15\n"}, {"input": "91\n", "output": "15\n"}, {"input": "76\n", "output": "13\n"}, {"input": "80\n", "output": "13\n"}, {"input": "96\n", "output": "15\n"}, {"input": "72\n", "output": "13\n"}, {"input": "79\n", "output": "13\n"}, {"input": "74\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an undirected connected weighted graph with N vertices and M edges that contains neither self-l...
[{"input": "7 1\n1 -1 0\n-1 4 1\n-1 0 4", "output": "0\n"}, {"input": "7 1\n1 -1 0\n-1 4 2\n-1 0 4", "output": "0\n"}, {"input": "7 1\n1 -2 0\n-1 4 2\n-1 0 4", "output": "0\n"}, {"input": "14 -1\n2 0 1\n0 3 1\n0 0 4", "output": "0\n"}, {"input": "7 1\n1 -1 0\n-1 8 1\n0 0 4", "output": "0\n"}, {"input": "7 1\n1 -1 0\n-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\nGiven are N integers A_1,\\ldots,A_N.\nWe will choose exactly K of these elements. Find the maximum possible ...
[{"input": "10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n", "output": "999983200\n"}, {"input": "16 1\n1000000001 100000100 10000100 1000001 100000 10001 1000 000 18 1", "output": "1000000001\n"}, {"input": "10 10\n1000000000 100000000 10000000 1100010 100000 10000 1000 100 10 1", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider a sequence, which is formed by the following rule: next term is taken as the smallest possible non-n...
[{"input": "14514", "output": "[2305425]", "fn_name": "sequence"}, {"input": "1634", "output": "[79707]", "fn_name": "sequence"}, {"input": "546", "output": "[19929]", "fn_name": "sequence"}, {"input": "334", "output": "[7329]", "fn_name": "sequence"}, {"input": "123", "output": "[1084]", "fn_name": "sequence"}, {"inpu...
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 a far away country called AlgoLandia, there are `N` islands numbered `1` to `N`. Each island is denoted by...
[{"input": "[true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true...
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\nA boy PCK is playing with N electric metronomes. The i-th metronome is set to tick every t_i seconds. He star...
[{"input": "3\n16\n6\n33", "output": "22\n"}, {"input": "3\n2\n0\n11", "output": "10\n"}, {"input": "2\n3\n206", "output": "100\n"}, {"input": "2\n3\n409", "output": "406\n"}, {"input": "3\n8\n5\n23", "output": "33\n"}, {"input": "2\n2\n409", "output": "407\n"}, {"input": "2\n4\n394", "output": "193\n"}, {"input": "2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInstructors of Some Informatics School make students go to bed.\n\nThe house contains n rooms, in each room e...
[{"input": "100 3 30\n20 10 8 3 97 20 40 4 58 24 105 56 26 21 66 1 126 4 21 46 8 2 9 21 0 13 24 53 58 23 3 107 1 22 189 3 31 4 31 0 3 0 9 43 19 74 92 7 71 22 46 26 31 49 18 3 10 9 9 110 30 2 40 21 33 4 11 14 47 4 1 37 3 19 18 63 10 53 19 35 11 57 8 3 11 27 23 5 45 15 127 27 23 48 3 8 20 33 5 28\n", "output": "0\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTax Rate Changed\n\nVAT (value-added tax) is a tax imposed at a certain rate proportional to the sale price.\...
[{"input": "5 8 105\n8 5 105\n1 2 24\n99 98 24\n12 13 26\n1 22 23\n1 19 201\n13 16 112\n2 24 50\n1 82 61\n1 84 125\n1 99 999\n99 1 3106\n98 99 999\n1 99 11\n99 2 12\n0 0 0", "output": "109\n103\n24\n24\n26\n27\n237\n116\n62\n111\n230\n1972\n1576\n1004\n20\n7\n"}, {"input": "5 8 105\n8 5 105\n1 2 24\n99 98 24\n12 13 26\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For ...
[{"input": "2 6 3 3 5 5 2 6 1 1 12 4 4 4 2 4 6 5 3 1 2 5 3 1\n", "output": "NO\n"}, {"input": "5 2 6 1 5 3 5 3 1 1 3 6 6 2 4 2 5 4 4 2 1 3 4 10\n", "output": "NO\n"}, {"input": "2 6 3 3 5 5 2 6 2 1 12 4 4 4 2 4 6 5 3 1 2 5 3 1\n", "output": "NO\n"}, {"input": "1 3 5 6 3 4 4 3 5 2 2 2 3 1 5 6 3 4 6 5 1 2 1 10\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\nOm Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied...
[{"input": "2 100 59\n....................................................................................................\n.DR.D..DLLR.LDRR..L.LDRRRDLD.LDRR.LLR.R...DRLD.RRLL.L.D..R.LD.DL....LR.LR.DRLD.....L.D..RD...D.LL.R.\n", "output": "0 0 0 1 0 0 0 1 1 0 0 2 0 0 0 1 1 1 0 1 0 0 0 1 1 2 0 0 1 0 0 0 1 2 1 0 0 1 0 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have recently discovered that horses travel in a unique pattern - they're either running (at top speed) o...
[{"input": "100000000\n21\n5\n14", "output": "[1130769276]", "fn_name": "travel"}, {"input": "35869784\n90\n100\n5", "output": "[84954920]", "fn_name": "travel"}, {"input": "1234567\n4\n3\n11", "output": "[7760148]", "fn_name": "travel"}, {"input": "1000\n10\n127\n14", "output": "[1120]", "fn_name": "travel"}, {"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\nproblem\n\nGiven the sequence $ A $ of length $ N $. Find the maximum value of $ \\ sum B_i $, where $ B $ is...
[{"input": "4\n14 15 0 10", "output": "29\n"}, {"input": "4\n17 19 0 20", "output": "56\n"}, {"input": "4\n12 23 0 10", "output": "35\n"}, {"input": "4\n14 8 0 10", "output": "18\n"}, {"input": "4\n7 14 0 14", "output": "21\n"}, {"input": "4\n7 15 0 20", "output": "42\n"}, {"input": "4\n5 15 0 20", "output": "40\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The...
[{"input": "10\n19 -11\n-3 -12\n5 3\n3 -15\n8 -14\n-9 -20\n10 -9\n0 2\n-7 17\n6 -6\n", "output": "7222\n"}, {"input": "10\n19 -11\n-3 -12\n5 3\n3 -15\n13 -14\n-9 -20\n10 -9\n0 2\n-7 17\n6 -6", "output": "7246"}, {"input": "10\n19 -11\n-3 -12\n5 3\n3 -15\n8 -19\n-9 -20\n10 -14\n0 2\n-7 17\n6 -6", "output": "7233"}, {"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\nA bitstring is a string consisting only of the characters 0 and 1. A bitstring is called k-balanced if every ...
[{"input": "9\n6 4\n100110\n3 2\n1?1\n3 2\n1?0\n4 4\n????\n7 4\n1?0??1?\n10 10\n11??11??11\n4 4\n1??1\n4 4\n?0?0\n6 2\n????00\n", "output": "YES\nYES\nNO\nYES\nYES\nNO\nYES\nYES\nNO\n"}, {"input": "9\n6 4\n100110\n3 2\n1?1\n3 2\n0?1\n4 4\n????\n7 4\n1?0??1?\n10 10\n11???11?11\n4 2\n1??1\n4 4\n?0?0\n6 2\n????10\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\nWrite a function that gets a sequence and value and returns `true/false` depending on whether the variable ex...
[{"input": "[\"a\", \"b\", [\"c\", \"d\", [\"e\", [\"a\", \"b\", [\"c\", \"d\", [\"e\", [\"a\", \"b\", [\"c\", \"d\", [\"e4\", [\"a\", \"b\", [\"c\", \"d\", [\"e\", [\"a\", \"b\", [\"c\", \"d\", [\"e\", [\"a\", \"b\", [\"c\", \"d\", [\"e14\"]]]]]]]]]]]]]]]]]]\n\"e\"", "output": "[true]", "fn_name": "locate"}, {"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\nVanya and his friends are walking along the fence of height h and they do not want the guard to notice them. ...
[{"input": "100 342\n478 143 359 336 162 333 385 515 117 496 310 538 469 539 258 676 466 677 1 296 150 560 26 213 627 221 255 126 617 174 279 178 24 435 70 145 619 46 669 566 300 67 576 251 58 176 441 564 569 194 24 669 73 262 457 259 619 78 400 579 222 626 269 47 80 315 160 194 455 186 315 424 197 246 683 220 68 682 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\nRead problems statements in Mandarin Chinese and Russian. \nThis is a very easy warm-up problem.\nYou are gi...
[{"input": "4\nacab\nzzqzqq\ncba\nkklkwwww", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\nacab\nzzqzqq\ncba\nkkmkwwww", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\nacab\nzzqzqq\nbca\nkkmkwwww", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\nacac\nzzqzqq\nabc\nkklkwwww", "output": "YES\nYES\nNO\nYES\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 little girl loves the problems on array queries very much.\n\nOne day she came across a rather well-known...
[{"input": "31 48\n45 19 16 42 38 18 50 7 28 40 39 25 45 14 36 18 27 30 16 4 22 6 1 23 16 47 14 35 27 47 2\n6 16\n11 28\n4 30\n25 26\n11 30\n5 9\n4 17\n15 17\n10 25\n15 26\n1 3\n9 26\n8 29\n16 30\n3 24\n27 30\n9 10\n22 29\n2 6\n15 24\n6 21\n19 21\n4 28\n1 7\n18 21\n10 22\n6 15\n14 28\n4 19\n12 13\n19 29\n5 6\n13 31\n21...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a sequence of N integers: A_1, A_2, \\cdots, A_N.\nYou can perform the following operation between 0 ...
[{"input": "500 1000000000\n1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has deci...
[{"input": "57 3 9\n4 5 2 7 12 1 1 3 2 9 4 9 0 6 12 5 -1 6 11 1 0 0 -1 3 1 0 5 1 0 31 8 8 0 1 7 3 1 13 4 4 5 1 4 -2 1 7 1 1 1 4 5 1 24 5 1 9 6\n", "output": "0\n"}, {"input": "57 3 9\n4 5 2 7 12 1 1 0 2 9 4 9 0 6 12 5 -1 6 11 1 0 0 -1 3 1 0 5 1 0 31 8 8 0 1 7 3 1 13 4 4 5 1 4 -2 1 7 1 1 1 4 5 1 24 5 1 9 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\nIn \"Takahashi-ya\", a ramen restaurant, a bowl of ramen costs 700 yen (the currency of Japan), plus 100 yen ...
[{"input": "ooo\n", "output": "1000\n"}, {"input": "oxo\n", "output": "900\n"}, {"input": "xxx\n", "output": "700\n"}, {"input": "pxo", "output": "800\n"}, {"input": "yxx", "output": "700\n"}, {"input": "opo", "output": "900\n"}, {"input": "oxp", "output": "800\n"}, {"input": "xyx", "output": "700\n"}, {"input": "opn",...
code_stdio
[ { "content": "You are an expert Python programmer. 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 decided to plant vegetables in the vegetable garden. There were n seeds, so I sown n seeds one by one a day...
[{"input": "5\n1 2 3 11 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9 11 12\n0", "output": "11\n1\n12\n"}, {"input": "5\n1 2 3 14 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9 11 12\n0", "output": "14\n1\n12\n"}, {"input": "5\n1 2 3 25 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9 11 12\n0", "output": "25\n1\n12\n"}, {"input": "5\n1 2 3 25 4 5\n6\n1 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\nThe main city magazine offers its readers an opportunity to publish their ads. The format of the ad should be...
[{"input": "2\nWjrWBWqKIeSndDHeiVmfChQNsoUiRQHVplnIWkwBtxAJhOdTigAAzKtbNEqcgvbWHOopfCNgWHfwXyzSCfNqGMLnmlIdKQonLsmGSJlPBcYfHNJJDGlKNnOGtrWUhaTWuilHWMUlFEzbJYbeAWvgnSOOOPLxX-eJEKRsKqSnMjrPbFDprCqgbTfwAnPjFapVKiTjCcWEzhahwPRHScfcLnUixnxckQJzuHzshyBFKPwVGzHeJWniiRKynDFQdaazmTZtDGnFVTmTUZCRCpUHFmUHAVtEdweCImRztqrkQInyCsnMn...
code_stdio
[ { "content": "You are an expert Python programmer. 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 task is simply stated. Given an integer n (3 < n < 10^(9)), find the length of the smallest list of [*per...
[{"input": "661915703", "output": "[4]", "fn_name": "sum_of_squares"}, {"input": "999887641", "output": "[1]", "fn_name": "sum_of_squares"}, {"input": "999950886", "output": "[3]", "fn_name": "sum_of_squares"}, {"input": "999951173", "output": "[2]", "fn_name": "sum_of_squares"}, {"input": "999998999", "output": "[4]",...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDr .: Peter, do you know \"Yes, I have a number\"?\n\nPeter: I used to do it on TV the other day. You remembe...
[{"input": "Yes I have a number\nHow I wish I could calculate an unused bolor for space\nThank you\nEND OF INPUT", "output": "31416\n31415926535\n53\n"}, {"input": "Yes I have a rebmun\nHow I wish I could calculate an unused bolor for space\nThank you\nEND OF INPUT", "output": "31416\n31415926535\n53\n"}, {"input": "Ye...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n3D Printing\n\nWe are designing an installation art piece consisting of a number of cubes with 3D printing te...
[{"input": "1 1 100\n100 100 100\n6 4 10\n100 100 100\n106 102 102\n112 110 104\n104 116 102\n100 114 104\n92 107 100\n10 1 10\n-100 101 100\n-108 102 120\n-116 103 100\n-124 100 100\n-132 99 100\n-92 98 100\n-84 100 140\n-76 103 100\n-68 146 100\n-60 101 100\n10 4 10\n100 100 100\n108 101 100\n116 102 100\n124 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\nWrite a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.\n\nCons...
[{"input": "f@IR, LATER, OCCASIONALLY CLOUDY.", "output": "F@ir, later, occasionally cloudy.\n"}, {"input": "f@IR, LATER, YLLANOISACCO CLOUDY.", "output": "F@ir, later, yllanoisacco cloudy.\n"}, {"input": "f@IR, LATER, OLLANOISACCY CLOUDY.", "output": "F@ir, later, ollanoisaccy cloudy.\n"}, {"input": "f@IR, LATER, OLKA...
code_stdio
[ { "content": "You are an expert Python programmer. 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 the function ```consecutive(arr)``` that takes an array of integers and return the minimum number of i...
[{"input": "[1, 2, 3, 4]", "output": "[0]", "fn_name": "consecutive"}, {"input": "[10, -10]", "output": "[19]", "fn_name": "consecutive"}, {"input": "[-10, 10]", "output": "[19]", "fn_name": "consecutive"}, {"input": "[4, 8, 6]", "output": "[2]", "fn_name": "consecutive"}, {"input": "[-10, -9]", "output": "[0]", "fn_na...
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 characters of Chima need your help. Their weapons got mixed up! They need you to write a program that acc...
[{"input": "\"qwertyuiopasdfghjklzxcvbnm\"", "output": "[\"Not a character\"]", "fn_name": "identify_weapon"}, {"input": "\"Stinkin gorillas\"", "output": "[\"Not a character\"]", "fn_name": "identify_weapon"}, {"input": "\"Lagravis\"", "output": "[\"Lagravis-Blazeprowlor\"]", "fn_name": "identify_weapon"}, {"input": "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya and Petya are playing a simple game. Vasya thought of number x between 1 and n, and Petya tries to gues...
[{"input": "1000\n", "output": "193\n2 4 8 16 32 64 128 256 512 3 9 27 81 243 729 5 25 125 625 7 49 343 11 121 13 169 17 289 19 361 23 529 29 841 31 961 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Task:\n\nYour job is to take a pair of parametric equations, passed in as strings, and convert them into ...
[{"input": "\"x = -144t - 118\"\n\"y = -142t + 65\"", "output": "[\"71x - 72y = -13058\"]", "fn_name": "para_to_rect"}, {"input": "\"x = 138t - 139\"\n\"y = -47t - 134\"", "output": "[\"47x + 138y = -25025\"]", "fn_name": "para_to_rect"}, {"input": "\"x = -71t + 37\"\n\"y = -131t - 124\"", "output": "[\"131x - 71y = 13...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string of numbers between 0-9. Find the average of these numbers and return it as a floored w...
[{"input": "\"one two three four five\"", "output": "[\"three\"]", "fn_name": "average_string"}, {"input": "\"zero zero zero zero zero\"", "output": "[\"zero\"]", "fn_name": "average_string"}, {"input": "\"four six two three\"", "output": "[\"three\"]", "fn_name": "average_string"}, {"input": "\"zero nine five two\"", ...
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 Kata, you will write a function `doubles` that will remove double string characters that are adjacent...
[{"input": "\"qqqqqqnpppgooooonpppppqmmmmmc\"", "output": "[\"npgonpqmc\"]", "fn_name": "doubles"}, {"input": "\"iiiiibllllllyqqqqqbiiiiiituuf\"", "output": "[\"ibyqbtf\"]", "fn_name": "doubles"}, {"input": "\"jjjjjfuuuutgggggqppdaaas\"", "output": "[\"jftgqdas\"]", "fn_name": "doubles"}, {"input": "\"jjjfzzzzzzsddgrrr...
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\nBob loves everything sweet. His favorite chocolate bar consists of pieces, each piece may contain a nut. Bob ...
[{"input": "100\n1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1\n", "output": "5559060566555523\n"}, {"input": "100\n1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 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\nExample\n\nInput\n\n201\n\n\nOutput\n\n701### Format: Read the inputs from stdin solve the problem and write ...
[{"input": "148", "output": "648\n"}, {"input": "106", "output": "605\n"}, {"input": "145", "output": "645\n"}, {"input": "225", "output": "725\n"}, {"input": "171", "output": "671\n"}, {"input": "177", "output": "678\n"}, {"input": "116", "output": "615\n"}, {"input": "119", "output": "619\n"}, {"input": "368", "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 brothers Hiroshi and Kenjiro came to Lake Inawashiro for fishing. The two decided to score as follows and...
[{"input": "0 11\n10 0\n-1 1 41 0", "output": "kenjiro\n"}, {"input": "0 11\n10 0\n-1 2 41 0", "output": "kenjiro\n"}, {"input": "0 10\n10 0\n-1 2 41 0", "output": "kenjiro\n"}, {"input": "0 10\n10 1\n-1 2 41 0", "output": "kenjiro\n"}, {"input": "2 1\n19 4\n-1 1 24 -1", "output": "kenjiro\n"}, {"input": "2 1\n19 4\n-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\nRead problems statements in Mandarin Chinese and Russian \n\nChef is sitting in a very boring lecture, wait...
[{"input": "2\n11\n26", "output": "00:02\n11:58\n05:32\n06:28\n"}, {"input": "2\n4\n104", "output": "05:28\n06:32\n01:52\n10:08\n"}, {"input": "2\n1\n104", "output": "04:22\n07:38\n01:52\n10:08\n"}, {"input": "2\n1\n116", "output": "04:22\n07:38\n02:32\n09:28\n"}, {"input": "2\n1\n152", "output": "04:22\n07:38\n03:44\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\nTokyo has a very complex railway system. For example, there exists a partial map of lines and stations as sho...
[{"input": "4 4 2 1 4\n1 2 2 1\n3 3 2 1\n3 1 5 1\n2 4 4 2\n3 1\n3 11\n10 5 3\n\n10\n2 0 1 1 2\n1\n\n1\n4 5 2 4 1\n4 3 10 1\n3 2 2 1\n3 4 1 2\n3 2 5 2\n2 1 10 1\n3 3\n20 30\n3 2 1\n5 10\n4 2 1\n5 5 2 1 5\n2 2 10 2\n1 3 20 2\n1 4 32 1\n3 4 10 1\n4 5 20 1\n2 2\n20\n10 1\n20\n3 1\n0 0 0 0 0", "output": "60\n-1\n40\n232\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 goal of this Kata is to remind/show you, how Z-algorithm works and test your implementation.\n\nFor a str...
[{"input": "\"abracadabra\"", "output": "[[11, 0, 0, 1, 0, 1, 0, 4, 0, 0, 1]]", "fn_name": "zfunc"}, {"input": "\"ababababab\"", "output": "[[10, 0, 8, 0, 6, 0, 4, 0, 2, 0]]", "fn_name": "zfunc"}, {"input": "\"aaaa$aaaa\"", "output": "[[9, 3, 2, 1, 0, 4, 3, 2, 1]]", "fn_name": "zfunc"}, {"input": "\"ababcaba\"", "outpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer $n$. Check if $n$ has an odd divisor, greater than one (does there exist such a numb...
[{"input": "6\n3\n3\n4\n5\n998244353\n1368804034442\n", "output": "YES\nYES\nNO\nYES\nYES\nYES\n"}, {"input": "6\n3\n3\n4\n5\n998244353\n1099511627776\n", "output": "YES\nYES\nNO\nYES\nYES\nNO\n"}, {"input": "6\n3\n3\n4\n5\n998244353\n852815039649\n", "output": "YES\nYES\nNO\nYES\nYES\nYES\n"}, {"input": "6\n2\n6\n7\n4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe sequence of n - 1 consecutive composite numbers (positive integers that are not prime and not equal to 1)...
[{"input": "10\n11\n27\n4\n492170\n0", "output": "4\n0\n6\n2\n114\n"}, {"input": "10\n9\n142\n2\n199792\n0", "output": "4\n4\n10\n0\n16\n"}, {"input": "10\n11\n27\n2\n296421\n0", "output": "4\n0\n6\n0\n60\n"}, {"input": "10\n11\n27\n2\n525306\n0", "output": "4\n0\n6\n0\n14\n"}, {"input": "10\n11\n27\n2\n245198\n0", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIlya is a very good-natured lion. He likes maths. Of all mathematical objects, his favourite one is matrices....
[{"input": "16\n978618343 473608041 799158564 800910753 461479363 520477481 780529176 678879534 118274424 720632652 1126830014 582019792 225578081 537373229 944668919 758615621\n", "output": "15485512030\n"}, {"input": "16\n978618343 473608041 799158564 800910753 461479363 520477481 780529176 678879534 118274424 720632...
code_stdio
[ { "content": "You are an expert Python programmer. 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 n × m rectangle table, its cells are not initially painted. Your task is to paint all cells of th...
[{"input": "100 100\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMike wants to prepare for IMO but he doesn't know geometry, so his teacher gave him an interesting geometry p...
[{"input": "9 6\n-44 -29\n-11 85\n11 84\n-63 1\n75 89\n-37 61\n14 73\n78 88\n-22 -18\n", "output": " 0\n"}, {"input": "2 2\n-93 -22\n12 72\n", "output": " 0\n"}, {"input": "2 2\n26 99\n-56 40\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\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\nSnuke is making a snake toy by joining K of the st...
[{"input": "15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n", "output": "386\n"}, {"input": "15 14\n49 26 27 21 41 12 42 35 7 5 5 36 39 1 45", "output": "390\n"}, {"input": "15 14\n49 26 27 21 33 14 42 35 7 5 5 31 39 1 45", "output": "379\n"}, {"input": "15 14\n42 26 27 21 12 14 42 35 7 5 5 31 39 1 45", "output": "351...
code_stdio
[ { "content": "You are an expert Python programmer. 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 asked to watch your nephew who likes to play with toy blocks in a strange way.\n\nHe has $n$ boxes an...
[{"input": "20\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\n1000000000 999999999\n2\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 work as a system administrator in a dormitory, which has $n$ rooms one after another along a straight hal...
[{"input": "200 10\n10000010101010110011110010100010010000001100101111011001010010001101001011111110011010111101000101011110101001001101101011010011100000100101000010110111000110000010101110110000110000100000101110111100\n", "output": "989\n"}, {"input": "200 10\n10000010101010110011110010100010010000001100101111011001...
code_stdio
[ { "content": "You are an expert Python programmer. 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 is standing on a multiplication table with infinitely many rows and columns.\nThe square (i,j) cont...
[{"input": "613921846801\n", "output": "613921846800\n"}, {"input": "550310490859\n", "output": "550310490858\n"}, {"input": "571704556531\n", "output": "571704556530\n"}, {"input": "472249589291\n", "output": "472249589290\n"}, {"input": "310812811094\n", "output": "155406405547\n"}, {"input": "10000000019\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\nTakahashi wants to be a member of some web service.\nHe tried to register himself with the ID S, which turned...
[{"input": "aaaaaaaaaa\naaaaaaaaaaa\n", "output": "Yes\n"}, {"input": "vgxgpuamkx\nvgxgpuamkxk\n", "output": "Yes\n"}, {"input": "chokudai\nchokudaiz\n", "output": "Yes\n"}, {"input": "vfjaqmop\nodotkrjzr\n", "output": "No\n"}, {"input": "choktdai\nchokudaiz", "output": "No\n"}, {"input": "choktdai\nbhokudaiz", "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 Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya ...
[{"input": "100 100\n-98 -97 -96 -93 -92 -91 -90 -87 -86 -84 -81 -80 -79 -78 -76 -75 -73 -71 -69 -67 -65 -64 -63 -62 -61 -54 -51 -50 -49 -48 -46 -45 -44 -37 -36 -33 -30 -28 -27 -16 -15 -13 -12 -10 -9 -7 -6 -5 -4 2 3 5 8 9 10 11 13 14 15 16 17 19 22 24 25 26 27 28 30 31 32 36 40 43 45 46 47 50 51 52 53 58 60 63 69 70 73...
code_stdio
[ { "content": "You are an expert Python programmer. 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# Situation\nYou have been hired by a company making electric garage doors. Accidents with the present produc...
[{"input": "\".....P......P.P..P....\"", "output": "[\"0000012345554333321000\"]", "fn_name": "controller"}, {"input": "\".....P.P........P....\"", "output": "[\"000001222222222234555\"]", "fn_name": "controller"}, {"input": "\"P......P..OP..P...\"", "output": "[\"123455543233334555\"]", "fn_name": "controller"}, {"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\nBear Limak prepares problems for a programming competition. Of course, it would be unprofessional to mention ...
[{"input": "75\nVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK\n", "output": "1406\n"}, {"input": "75\nVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK\n", "output": "1406\n"}, {"input": "75\nVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVKVVVVVVVKKKKKKKKKKKKKKKKKKKKKKKKKKVKKKKKKK...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function that returns the count of characters that have to be removed in order to get a string with n...
[{"input": "\"abmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
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\nToday Johnny wants to increase his contribution. His plan assumes writing $n$ blogs. One blog covers one topi...
[{"input": "25 50\n25 2\n6 17\n11 4\n3 18\n11 20\n6 7\n24 15\n1 8\n13 5\n12 25\n15 18\n14 21\n13 6\n5 10\n3 14\n1 2\n23 13\n12 20\n6 4\n8 9\n3 5\n10 7\n20 2\n20 16\n7 4\n8 25\n15 6\n24 14\n2 23\n2 13\n11 3\n16 21\n18 10\n22 1\n5 24\n6 18\n22 23\n4 13\n8 18\n5 20\n22 17\n20 7\n19 15\n10 12\n2 3\n1 20\n2 24\n7 14\n16 17\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have just been put in charge of developing a new shredder for the Shredding Company. Although a ``normal'...
[{"input": "50 12346\n712 144139\n927438 667387\n23 3312\n9 3142\n25 1299\n101 63556\n103 862150\n6 1104\n0 0", "output": "43 1 2 34 6\n481 1 441 39\n667387 667387\n18 3 3 12\nerror\n21 1 2 9 9\n97 6 35 56\n103 86 2 15 0\nrejected\n"}, {"input": "50 12346\n712 144139\n1585609 667387\n23 3312\n9 3142\n25 1299\n111 63556...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn SNS has N users - User 1, User 2, \\cdots, User N.\nBetween these N users, there are some relationships - ...
[{"input": "10 9 3\n10 1\n6 7\n8 2\n2 5\n8 4\n7 3\n10 9\n6 4\n5 8\n2 6\n7 5\n3 1\n", "output": "1 3 5 4 3 3 3 3 1 0\n"}, {"input": "10 9 3\n10 1\n10 6\n8 2\n2 5\n8 4\n7 3\n10 9\n6 4\n5 8\n2 6\n7 5\n3 1", "output": "6 4 0 5 5 4 0 4 6 4\n"}, {"input": "10 9 3\n10 1\n10 6\n8 2\n2 5\n8 4\n7 3\n10 9\n6 4\n5 8\n2 7\n7 5\n3 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\nInnopolis University scientists continue to investigate the periodic table. There are n·m known elements and ...
[{"input": "20 20 80\n5 3\n13 13\n8 5\n2 9\n12 16\n1 11\n15 11\n3 20\n10 7\n5 4\n11 2\n5 20\n14 8\n5 1\n8 13\n11 5\n19 2\n15 12\n12 7\n16 5\n17 3\n12 2\n17 16\n12 3\n12 6\n18 20\n2 20\n9 1\n5 10\n9 18\n17 1\n17 10\n20 1\n12 12\n19 14\n7 8\n2 19\n6 14\n5 6\n15 2\n18 14\n5 7\n14 14\n17 2\n20 20\n11 6\n18 15\n10 5\n20 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\nVasya owns a cornfield which can be defined with two integers $n$ and $d$. The cornfield can be represented a...
[{"input": "9 3\n100\n0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n1 0\n1 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2 0\n2 1\n2 2\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n3 0\n3 1\n3 2\n3 3\n3 4\n3 5\n3 6\n3 7\n3 8\n3 9\n4 0\n4 1\n4 2\n4 3\n4 4\n4 5\n4 6\n4 7\n4 8\n4 9\n5 0\n5 1\n5 2\n5 3\n5 4\n5 5\n5 6\n5 7\n5 8\n5 9...
code_stdio