messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "Solve the following coding problem using the programming language python:\n\nAshish and Vivek play a game on a matrix consisting of $n$ rows and $m$ columns, where they take turns claiming cells. Unclaimed cells are represented by $0$, while claimed cells are represented by $1$. The initial state ...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "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\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents ...
[{"type": "stdin_stdout", "input": "100 100\n", "output": "9801\n"}, {"type": "stdin_stdout", "input": "91 61\n", "output": "5400\n"}, {"type": "stdin_stdout", "input": "-33 13", "output": "-408\n"}, {"type": "stdin_stdout", "input": "-36 13", "output": "-444\n"}, {"type": "stdin_stdout", "input": "-36 17", "output": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLevko loves array a_1, a_2, ... , a_{n}, consisting of integers, very much. That is why Levko is playing with array a, performing all sorts of operations with it. Each operation Levko performs is of one of two types:\n\n ...
[{"type": "stdin_stdout", "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...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is the constraints.\n\nPolycarp has to write a coursework. The coursework consists of $m$ pages.\n\nPolycarp also has $n$ cups of coffee. The coffee in the $i$-th cup Pol...
[{"type": "stdin_stdout", "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 9...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya studies positional notations. He has already learned to add and subtract numbers in the systems of notations with different radices and has moved on to a more complicated action β€” multiplication. To multiply large n...
[{"type": "stdin_stdout", "input": "10\n", "output": "1 2 3 4 5 6 7 8 9 \n2 4 6 8 10 12 14 16 18 \n3 6 9 12 15 18 21 24 27 \n4 8 12 16 20 24 28 32 36 \n5 10 15 20 25 30 35 40 45 \n6 12 18 24 30 36 42 48 54 \n7 14 21 28 35 42 49 56 63 \n8 16 24 32 40 48 56 64 72 \n9 18 27 36 45 54 63 72 81 \n"}, {"type": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have probably registered on Internet sites many times. And each time you should enter your invented password. Usually the registration form automatically checks the password's crypt resistance. If the user's password ...
[{"type": "stdin_stdout", "input": "c7jqaudcqmv8o7zvb5x_gp6zcgl6nwr7tz5or!28.tj8s1m2.wxz5a4id03!rq07?662vy.7.p5?vk2f2mc7ag8q3861rgd0rmbr\n", "output": "Too weak\n"}, {"type": "stdin_stdout", "input": "i6a.,8jb,n0kv4.1!7h?p.96pnhhgy6cl7dg7e4o6o384ys3z.t71kkq,,w,oqi4?u,,m5!rzu6wym_4hm,ohjy!.vvksl?pt,,1\n", "output": "Too...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDora loves adventures quite a lot. During some journey she encountered an amazing city, which is formed by n streets along the Eastern direction and m streets across the Southern direction. Naturally, this city has nm int...
[{"type": "stdin_stdout", "input": "1 100\n197 693 757 329 311 798 783 1130 504 1051 978 358 367 467 623 767 481 154 855 608 157 104 273 261 110 713 948 897 96 476 855 337 93 321 648 441 215 979 505 69 858 99 1215 337 237 116 824 98 955 192 773 99 485 385 861 347 772 993 470 215 792 1192 986 515 84 7 476 831 903 74 79 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a string S consisting of digits 1, 2, ..., 9.\nLunlun, the Dachshund, will take out three consecutive digits from S, treat them as a single integer X and bring it to her master. (She cannot rearrange the digits.)...
[{"type": "stdin_stdout", "input": "1111111111\n", "output": "642\n"}, {"type": "stdin_stdout", "input": "2432423234\n", "output": "321\n"}, {"type": "stdin_stdout", "input": "8889998899\n", "output": "135\n"}, {"type": "stdin_stdout", "input": "1234567876\n", "output": "34\n"}, {"type": "stdin_stdout", "input": "69452...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nAlice and Bob, both have to drink water. But they both don't want to go, so they will play a game to decide who will fetch water for both of them. Alice will ...
[{"type": "stdin_stdout", "input": "3\n17 13\n3 12\n5 3", "output": "110/221\n1/2\n7/15\n"}, {"type": "stdin_stdout", "input": "3\n17 11\n3 5\n5 3", "output": "93/187\n7/15\n7/15\n"}, {"type": "stdin_stdout", "input": "3\n17 11\n3 6\n5 3", "output": "93/187\n1/2\n7/15\n"}, {"type": "stdin_stdout", "input": "3\n1 2\n11 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Task:\nYou have to write a function `pattern` which returns the following Pattern (See Pattern & Examples) upto `n` number of rows. \n\n* Note: `Returning` the pattern is not the same as `Printing` the pattern.\n\n### ...
[{"input": "5", "output": "[\"54321\\n5432\\n543\\n54\\n5\"]", "fn_name": "pattern"}, {"input": "2", "output": "[\"21\\n2\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"1\"]", "fn_name": "pattern"}, {"input": "0", "output": "[\"\"]", "fn_name": "patt...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nTokitsukaze is one of the characters in the game \"Kantai Collection\". In this game, every character has a common attributeΒ β€” health points, shortened to HP.\n\nIn general, different values of HP are grouped into $4$ cat...
[{"type": "stdin_stdout", "input": "100\n", "output": "1 A\n"}, {"type": "stdin_stdout", "input": "100\n", "output": "1 A\n"}, {"type": "stdin_stdout", "input": "101\n", "output": "0 A\n"}, {"type": "stdin_stdout", "input": "130\n", "output": "1 B\n"}, {"type": "stdin_stdout", "input": "121\n", "output": "0 A\n"}, {"ty...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of n sticks and an instrument. Each stick is characterized by its length l_{i}.\n\nIlya decided to make...
[{"type": "stdin_stdout", "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...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBerland starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, the berlanders need to know exactly how many more flatland soldiers are left in the enemy's reserve. Fortunately,...
[{"type": "stdin_stdout", "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 46...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\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$. Thus, there will be exactly $r-l$ additions performed. For each such addition, let's look at the number of di...
[{"type": "stdin_stdout", "input": "4\n0 9\n0 10\n10 23\n2 1010000000\n", "output": "9\n11\n14\n1122222220\n"}, {"type": "stdin_stdout", "input": "4\n1 18\n8 10\n10 12\n1 1000000000\n", "output": "18\n3\n2\n1111111110\n"}, {"type": "stdin_stdout", "input": "4\n0 12\n9 10\n6 23\n1 1000000000\n", "output": "13\n2\n19\n11...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Masha loves arranging her toys into piles on the floor. And she also hates it when somebody touches her toys. One day Masha arranged all her n toys into several piles and then her elder brother Sasha came and gathe...
[{"type": "stdin_stdout", "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,...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $n$ and $m$. Find the $\\operatorname{MEX}$ of the sequence $n \\oplus 0, n \\oplus 1, \\ldots, n \\oplus m$. Here, $\\oplus$ is the bitwise XOR operator .\n\n$\\operatorname{MEX}$ of the sequen...
[{"type": "stdin_stdout", "input": "5\n14 1\n3 0\n2 0\n110 1252\n528350 1051160\n", "output": "0\n0\n0\n1152\n1048576\n"}, {"type": "stdin_stdout", "input": "5\n22 0\n3 0\n1 1\n100 1218\n137071 1051160\n", "output": "0\n0\n2\n1152\n1048576\n"}, {"type": "stdin_stdout", "input": "5\n28 0\n4 0\n1 2\n110 1590\n978289 1283...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIvan is going to sleep now and wants to set his alarm clock. There will be many necessary events tomorrow, the $i$-th of them will start during the $x_i$-th minute. Ivan doesn't want to skip any of the events, so he has t...
[{"type": "stdin_stdout", "input": "2 1\n500000000000000000 1000010000000000000\n700000000\n", "output": "YES\n500000000000000000 1\n"}, {"type": "stdin_stdout", "input": "2 2\n1 1000000000000000000\n1000000000000000000 1000000000000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2 2\n1 100000000000000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\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 11:59 PM. A bus from the city A departs every a minutes and arrives to the city B in a t_{a} minutes, and a bus...
[{"type": "stdin_stdout", "input": "60 120\n17 120\n23:00\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "60 120\n17 120\n23:00\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "60 120\n17 175\n23:00\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "111 120\n24 100\n13:00\n", "output": "9\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn a far away kingdom young pages help to set the table for the King. As they are terribly mischievous, one needs to keep an eye on the control whether they have set everything correctly. This time the royal chef Gerasim ...
[{"type": "stdin_stdout", "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\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n-----Input-----\n\nThe input contains a single integer a (1 ≀ a ≀ 30).\n\n\n-----Output-----\n\nOutput a single integer.\n\n\n-----Example-----\nInput\n3\n\nOutput\n27\n\nThe input will be stdin and you should print your ...
[{"type": "stdin_stdout", "input": "011\n", "output": "274\n"}, {"type": "stdin_stdout", "input": "010\n", "output": "265\n"}, {"type": "stdin_stdout", "input": "10\n", "output": "265\n"}, {"type": "stdin_stdout", "input": "11\n", "output": "274\n"}, {"type": "stdin_stdout", "input": "12\n", "output": "319\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant loves sortings.\n\nHe has an array a consisting of n integers. Let's number the array elements from 1 to n, then the i-th element will be denoted as ai. The Little Elephant can make one move to choose ...
[{"type": "stdin_stdout", "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 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn one little known, but very beautiful country called Waterland, lives a lovely shark Valerie. Like all the sharks, she has several rows of teeth, and feeds on crucians. One of Valerie's distinguishing features is that w...
[{"type": "stdin_stdout", "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\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor a given polygon g, computes the area of the polygon.\n\ng is represented by a sequence of points p1, p2,..., pn where line segments connecting pi and pi+1 (1 ≀ i ≀ n-1) are sides of g. The line segment connecting pn a...
[{"type": "stdin_stdout", "input": "4\n-1 -2\n-1 0\n-1 14\n-5 2", "output": "32.0\n"}, {"type": "stdin_stdout", "input": "4\n-1 -2\n-1 0\n-1 17\n-5 2", "output": "38.0\n"}, {"type": "stdin_stdout", "input": "4\n0 -1\n10 -3\n71 0\n0 11", "output": "502.0\n"}, {"type": "stdin_stdout", "input": "4\n0 -4\n-1 0\n-1 14\n-6 3...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour task is to convert a given number into a string with commas added for easier readability. The number should be rounded to 3 decimal places and the commas should be added at intervals of three digits before the decim...
[{"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": "Solve the following coding problem using the programming language python:\n\nA decimal representation of an integer can be transformed to another integer by rearranging the order of digits. Let us make a sequence using this fact.\n\nA non-negative integer a0 and the number of digits L are given fi...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "input": "245 9\n83268 23\n821 3\n0 0\n99 1\n0 -1", "output": "3 863098632 14\n12 98765433331976666543211 5\n3 495 1\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA matrix of size $n \\times m$ is called nice, if all rows and columns of the matrix are palindromes. A sequence of integers $(a_1, a_2, \\dots , a_k)$ is a palindrome, if for any integer $i$ ($1 \\le i \\le k$) the equal...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "input": "9\n1 1\n132703760\n1 1\n33227322\n1 1\n943066084\n1 1\n729...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n**Steps**\n1. Square the numbers that are greater than zero.\n2. Multiply by 3 every third number.\n3. Multiply by -1 every fifth number.\n4. Return the sum of the sequence.\n\n**Example** \n`{ -2, -1, 0, 1, 2 }` return...
[{"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": "Solve the following coding problem using the programming language python:\n\nRevised\n\nThe current era, Heisei, will end on April 30, 2019, and a new era will begin the next day. The day after the last day of Heisei will be May 1, the first year of the new era.\n\nIn the system developed by the A...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nHDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order.\n\nOne of the problems of...
[{"type": "stdin_stdout", "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...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp wants to buy exactly $n$ shovels. The shop sells packages with shovels. The store has $k$ types of packages: the package of the $i$-th type consists of exactly $i$ shovels ($1 \\le i \\le k$). The store has an in...
[{"type": "stdin_stdout", "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\n1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSereja has two sequences a and b and number p. Sequence a consists of n integers a_1, a_2, ..., a_{n}. Similarly, sequence b consists of m integers b_1, b_2, ..., b_{m}. As usual, Sereja studies the sequences he has. Toda...
[{"type": "stdin_stdout", "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", "outpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis is an easier version of the problem. In this version $n \\le 1000$\n\nThe outskirts of the capital are being actively built up in Berland. The company \"Kernel Panic\" manages the construction of a residential comple...
[{"type": "stdin_stdout", "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...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRaccoon is fighting with a monster.\nThe health of the monster is H.\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's h...
[{"type": "stdin_stdout", "input": "210 5\n31 41 59 26 53\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "211 5\n31 41 59 26 53\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "210 3\n31 41 59 26 53", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "210 3\n31 55 59 26 53", "output": "Yes\n"}, ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor some time the program of rounding numbers that had been developed by the Codeforces participants during one of the previous rounds, helped the citizens of Far Far Away to convert numbers into a more easily readable fo...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider some square matrix A with side n consisting of zeros and ones. There are n rows numbered from 1 to n from top to bottom and n columns numbered from 1 to n from left to right in this matrix. We'll denote the eleme...
[{"type": "stdin_stdout", "input": "100\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "89\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "91\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "76\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "80\n", "output": "13\n"}, {"type": "std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges.\nThe i-th (1≀i≀M) edge connects vertex a_i and vertex b_i with a distance of c_i.\nHere, ...
[{"type": "stdin_stdout", "input": "7 1\n1 -1 0\n-1 4 1\n-1 0 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 1\n1 -1 0\n-1 4 2\n-1 0 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 1\n1 -2 0\n-1 4 2\n-1 0 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "14 -1\n2 0 1\n0 3 1\n0 0 4", "outpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters '+' and '1'. For example, sequences '(())()', '()', and '(()(()))' are balanced, while ')(', '(()', and '(()))...
[{"type": "stdin_stdout", "input": "3\n6\n101101\n10\n1001011101\n4\n1001\n", "output": "YES\n((()))\n()()()\nYES\n(()((())))\n()(()())()\nYES\n(())\n()()\n"}, {"type": "stdin_stdout", "input": "3\n6\n101101\n10\n1011001101\n4\n1001\n", "output": "YES\n((()))\n()()()\nYES\n(((()())))\n()((()))()\nYES\n(())\n()()\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider a sequence, which is formed by the following rule: next term is taken as the smallest possible non-negative integer, which is not yet in the sequence, so that `no 3` terms of sequence form an arithmetic progressi...
[{"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": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers numbered from $1$ to $n$.\n\nLet's define the $k$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $k...
[{"type": "stdin_stdout", "input": "3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1\n", "output": "-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1 \n"}, {"type": "stdin_stdout", "input": "3\n5\n4 4 4 4 2\n5\n1 2 3 4 5\n6\n1 3 1 5 3 1\n", "output": "-1 4 4 4 2 \n-1 -1 3 2 1 \n-1 -1 1 1 1 1 \n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have final scores of an examination for n students. Calculate standard deviation of the scores s1, s2 ... sn.\n\nThe variance Ξ±2 is defined by\n\nΞ±2 = (βˆ‘ni=1(si - m)2)/n\n\nwhere m is an average of si. The standard de...
[{"type": "stdin_stdout", "input": "5\n70 115 100 90 20\n3\n74 80 117\n0", "output": "32.9241552663\n19.0146142626\n"}, {"type": "stdin_stdout", "input": "5\n70 115 100 90 20\n3\n74 82 117\n0", "output": "32.9241552663\n18.6726180989\n"}, {"type": "stdin_stdout", "input": "5\n70 115 100 90 20\n3\n74 80 80\n0", "output"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDefine a function that removes duplicates from an array of numbers and returns it as a result.\n\nThe order of the sequence has to stay the same.\n\nWrite your solution by modifying this code:\n\n```python\ndef distinct(s...
[{"input": "[1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 7]", "output": "[[1, 2, 3, 4, 5, 6, 7]]", "fn_name": "distinct"}, {"input": "[1, 1, 1, 2, 3, 4, 5]", "output": "[[1, 2, 3, 4, 5]]", "fn_name": "distinct"}, {"input": "[1, 1, 2]", "output": "[[1, 2]]", "fn_name": "distinct"}, {"input": "[1, 2]", "output": "[[1, 2]]", "fn_nam...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nInstructors of Some Informatics School make students go to bed.\n\nThe house contains n rooms, in each room exactly b students were supposed to sleep. However, at the time of curfew it happened that many students are not ...
[{"type": "stdin_stdout", "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\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe task is simply stated. Given an integer n (3 < n < 10^(9)), find the length of the smallest list of [*perfect squares*](https://en.wikipedia.org/wiki/Square_number) which add up to n. Come up with the best algorithm y...
[{"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": "Solve the following coding problem using the programming language python:\n\nDr .: Peter, do you know \"Yes, I have a number\"?\n\nPeter: I used to do it on TV the other day. You remember something by the number of characters in each word contained in a sentence. \"Yes, I have a number\", so it me...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "input": "Yes I have a rebmun\nHow I wish I could calculate an unused bolor for space\nThank you\nEND OF INPUT", "out...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n3D Printing\n\nWe are designing an installation art piece consisting of a number of cubes with 3D printing technology for submitting one to Installation art Contest with Printed Cubes (ICPC). At this time, we are trying t...
[{"type": "stdin_stdout", "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\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.\n\nConstraints\n\n* The length of the input string < 1200\n\nInput\n\nA string is given in a line.\n\nOutput\n\nPrint t...
[{"type": "stdin_stdout", "input": "f@IR, LATER, OCCASIONALLY CLOUDY.", "output": "F@ir, later, occasionally cloudy.\n"}, {"type": "stdin_stdout", "input": "f@IR, LATER, YLLANOISACCO CLOUDY.", "output": "F@ir, later, yllanoisacco cloudy.\n"}, {"type": "stdin_stdout", "input": "f@IR, LATER, OLLANOISACCY CLOUDY.", "outpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nCreate the function ```consecutive(arr)``` that takes an array of integers and return the minimum number of integers needed to make the contents of ```arr``` consecutive from the lowest number to the highest number.\nFor ...
[{"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": "Solve the following coding problem using the programming language python:\n\nThe characters of Chima need your help. Their weapons got mixed up! They need you to write a program that accepts the name of a character in Chima then tells which weapon he/she owns.\n\nFor example: for the character `\"...
[{"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": "Solve the following coding problem using the programming language python:\n\nYou are given a string of numbers between 0-9. Find the average of these numbers and return it as a floored whole number (ie: no decimal places) written out as a string. Eg:\n\n\"zero nine five two\" -> \"four\"\n\nIf the...
[{"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": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n201\n\n\nOutput\n\n701\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.\n\nWrite Python code to solve this problem. Your program s...
[{"type": "stdin_stdout", "input": "148", "output": "648\n"}, {"type": "stdin_stdout", "input": "106", "output": "605\n"}, {"type": "stdin_stdout", "input": "145", "output": "645\n"}, {"type": "stdin_stdout", "input": "225", "output": "725\n"}, {"type": "stdin_stdout", "input": "171", "output": "671\n"}, {"type": "stdi...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe brothers Hiroshi and Kenjiro came to Lake Inawashiro for fishing. The two decided to score as follows and compete with the total score of the fish they caught.\n\n* One char is a point\n* One yamame trout b points\n* ...
[{"type": "stdin_stdout", "input": "0 11\n10 0\n-1 1 41 0", "output": "kenjiro\n"}, {"type": "stdin_stdout", "input": "0 11\n10 0\n-1 2 41 0", "output": "kenjiro\n"}, {"type": "stdin_stdout", "input": "0 10\n10 0\n-1 2 41 0", "output": "kenjiro\n"}, {"type": "stdin_stdout", "input": "0 10\n10 1\n-1 2 41 0", "output": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian \n\nChef is sitting in a very boring lecture, waiting for it to end. He has recently asked his friend about the time, and instead of the straightforward answer, h...
[{"type": "stdin_stdout", "input": "2\n11\n26", "output": "00:02\n11:58\n05:32\n06:28\n"}, {"type": "stdin_stdout", "input": "2\n4\n104", "output": "05:28\n06:32\n01:52\n10:08\n"}, {"type": "stdin_stdout", "input": "2\n1\n104", "output": "04:22\n07:38\n01:52\n10:08\n"}, {"type": "stdin_stdout", "input": "2\n1\n116", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTokyo has a very complex railway system. For example, there exists a partial map of lines and stations as shown in Figure D-1.\n\n<image>\n\nFigure D-1: A sample railway network\n\n\nSuppose you are going to station D fro...
[{"type": "stdin_stdout", "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", "outpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer $n$. Check if $n$ has an odd divisor, greater than one (does there exist such a number $x$ ($x > 1$) that $n$ is divisible by $x$ and $x$ is odd).\n\nFor example, if $n=6$, then there is $x=3$. If...
[{"type": "stdin_stdout", "input": "6\n3\n3\n4\n5\n998244353\n1368804034442\n", "output": "YES\nYES\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\n3\n3\n4\n5\n998244353\n1099511627776\n", "output": "YES\nYES\nNO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "6\n3\n3\n4\n5\n998244353\n852815039649\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIlya is a very good-natured lion. He likes maths. Of all mathematical objects, his favourite one is matrices. Now he's faced a complicated matrix problem he needs to solve.\n\nHe's got a square 2^{n} Γ— 2^{n}-sized matrix ...
[{"type": "stdin_stdout", "input": "16\n978618343 473608041 799158564 800910753 461479363 520477481 780529176 678879534 118274424 720632652 1126830014 582019792 225578081 537373229 944668919 758615621\n", "output": "15485512030\n"}, {"type": "stdin_stdout", "input": "16\n978618343 473608041 799158564 800910753 46147936...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSpongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all pairs of n and m, such that there are exactly x distinct squares in the table consisting of n rows and m c...
[{"type": "stdin_stdout", "input": "983282300\n", "output": "48\n 1 983282300\n 2 3277...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMike wants to prepare for IMO but he doesn't know geometry, so his teacher gave him an interesting geometry problem. Let's define f([l, r]) = r - l + 1 to be the number of integer points in the segment [l, r] with l ≀ r (...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "input": "2 2\n-93 -22\n12 72\n", "output": " ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\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 sticks together.\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind ...
[{"type": "stdin_stdout", "input": "15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n", "output": "386\n"}, {"type": "stdin_stdout", "input": "15 14\n49 26 27 21 41 12 42 35 7 5 5 36 39 1 45", "output": "390\n"}, {"type": "stdin_stdout", "input": "15 14\n49 26 27 21 33 14 42 35 7 5 5 31 39 1 45", "output": "379\n"}, {"t...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou work as a system administrator in a dormitory, which has $n$ rooms one after another along a straight hallway. Rooms are numbered from $1$ to $n$.\n\nYou have to connect all $n$ rooms to the Internet.\n\nYou can conne...
[{"type": "stdin_stdout", "input": "200 10\n10000010101010110011110010100010010000001100101111011001010010001101001011111110011010111101000101011110101001001101101011010011100000100101000010110111000110000010101110110000110000100000101110111100\n", "output": "989\n"}, {"type": "stdin_stdout", "input": "200 10\n10000010...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi is standing on a multiplication table with infinitely many rows and columns.\nThe square (i,j) contains the integer i \\times j. Initially, Takahashi is standing at (1,1).\nIn one move, he can move from (i,j) to...
[{"type": "stdin_stdout", "input": "613921846801\n", "output": "613921846800\n"}, {"type": "stdin_stdout", "input": "550310490859\n", "output": "550310490858\n"}, {"type": "stdin_stdout", "input": "571704556531\n", "output": "571704556530\n"}, {"type": "stdin_stdout", "input": "472249589291\n", "output": "472249589290\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi wants to be a member of some web service.\nHe tried to register himself with the ID S, which turned out to be already used by another user.\nThus, he decides to register using a string obtained by appending one ...
[{"type": "stdin_stdout", "input": "aaaaaaaaaa\naaaaaaaaaaa\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "vgxgpuamkx\nvgxgpuamkxk\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "chokudai\nchokudaiz\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "vfjaqmop\nodotkrjzr\n", "output": "No\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a multiset S consisting of positive integers (initially empty). There are two kind of queries: Add a positive integer to S, the newly added integer is not less than any number in it. Find a subset s of th...
[{"type": "stdin_stdout", "input": "88\n1 1411\n2\n1 1783\n1 2132\n2\n2\n1 2799\n2\n2\n1 7856\n1 10551\n2\n2\n1 10868\n1 15159\n1 16497\n2\n1 20266\n2\n2\n2\n1 21665\n2\n2\n2\n2\n1 25670\n2\n2\n2\n1 26767\n1 31392\n2\n2\n2\n1 35319\n1 38575\n1 40111\n2\n1 41305\n1 49444\n1 53013\n2\n2\n1 53117\n2\n2\n1 55113\n2\n2\n2\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest ...
[{"type": "stdin_stdout", "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...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Situation\nYou have been hired by a company making electric garage doors. Accidents with the present product line have resulted in numerous damaged cars, broken limbs and several killed pets. Your mission is to write a ...
[{"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": "Solve the following coding problem using the programming language python:\n\nBear Limak prepares problems for a programming competition. Of course, it would be unprofessional to mention the sponsor name in the statement. Limak takes it seriously and he is going to change some words. To make it sti...
[{"type": "stdin_stdout", "input": "75\nVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK\n", "output": "1406\n"}, {"type": "stdin_stdout", "input": "75\nVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK\n", "output": "1406\n"}, {"type": "stdin_stdout", "input": "75\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function that returns the count of characters that have to be removed in order to get a string with no consecutive repeats.\n\n*Note:* This includes any characters\n\n## Examples\n\n```python\n'abbbbc' => 'abc' ...
[{"input": "\"abmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have just been put in charge of developing a new shredder for the Shredding Company. Although a ``normal'' shredder would just shred sheets of paper into little pieces so that the contents would become unreadable, thi...
[{"type": "stdin_stdout", "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"}, {"type": "stdin_stdout", "input": "50 12346\n712 144139\n158...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nInnopolis University scientists continue to investigate the periodic table. There are nΒ·m known elements and they form a periodic table: a rectangle with n rows and m columns. Each element can be described by its coordina...
[{"type": "stdin_stdout", "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\n1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya owns a cornfield which can be defined with two integers $n$ and $d$. The cornfield can be represented as rectangle with vertices having Cartesian coordinates $(0, d), (d, 0), (n, n - d)$ and $(n - d, n)$.\n\n [Image...
[{"type": "stdin_stdout", "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\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\nThere are N! possible paths to vi...
[{"type": "stdin_stdout", "input": "8\n898 1000\n85 1000\n980 1000\n359 1000\n-560 1000\n-764 1000\n-103 1000\n-116 1000\n", "output": "5277.7500000000\n"}, {"type": "stdin_stdout", "input": "8\n-1000 1000\n-1000 0\n-1000 -1000\n0 1000\n0 -1000\n1000 1000\n1000 0\n1000 -1000\n", "output": "12300.5630797458\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant loves permutations of integers from 1 to n very much. But most of all he loves sorting them. To sort a permutation, the Little Elephant repeatedly swaps some elements. As a result, he must receive a pe...
[{"type": "stdin_stdout", "input": "125 8\n111 69 3 82 24 38 4 39 42 22 92 6 16 10 8 45 17 91 84 53 5 46 124 47 18 57 43 73 114 102 121 105 118 95 104 98 72 20 56 60 123 80 103 70 65 107 67 112 101 108 99 49 12 94 2 68 119 109 59 40 86 116 88 63 110 14 13 120 41 64 89 71 15 35 81 51 113 90 55 122 1 75 54 33 28 7 125 9 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPooja would like to withdraw X US from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Pooja's account balance has enough cash to perform the withdrawal transaction (including bank c...
[{"type": "stdin_stdout", "input": "1013 120.00", "output": "120.00\n"}, {"type": "stdin_stdout", "input": "1676 120.00", "output": "120.00\n"}, {"type": "stdin_stdout", "input": "1038 120.00", "output": "120.00\n"}, {"type": "stdin_stdout", "input": "1022 120.00", "output": "120.00\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSince Sonya has just learned the basics of matrices, she decided to play with them a little bit.\n\nSonya imagined a new type of matrices that she called rhombic matrices. These matrices have exactly one zero, while all o...
[{"type": "stdin_stdout", "input": "20\n1 0 2 3 5 3 2 1 3 2 3 1 4 2 1 4 2 3 2 4\n", "output": "4 5\n2 2\n"}, {"type": "stdin_stdout", "input": "20\n1 0 2 3 5 3 2 1 3 2 3 1 4 2 1 4 2 3 2 4\n", "output": "4 5\n2 2\n"}, {"type": "stdin_stdout", "input": "18\n2 2 3 2 4 3 3 3 0 2 4 2 1 3 2 1 1 1\n", "output": "3 6\n2 3\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was carried out in the Int...
[{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n3 0 3 0 3 0 3 0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSnuke prepared 6 problems for a upcoming programming contest. For each of those problems, Rng judged whether it can be used in the contest or not.\n\nYou are given a string S of length 6. If the i-th character of s is `1`...
[{"type": "stdin_stdout", "input": "001011", "output": "3\n"}, {"type": "stdin_stdout", "input": "100000", "output": "1\n"}, {"type": "stdin_stdout", "input": "011011", "output": "4\n"}, {"type": "stdin_stdout", "input": "100100", "output": "2\n"}, {"type": "stdin_stdout", "input": "111011", "output": "5\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given <var>Q</var> tuples of integers <var>(L_i, A_i, B_i, M_i)</var>. For each tuple, answer the following question. \nThere is an arithmetic progression with L terms: s_0, s_1, s_2, ... , s_{L-1}.\nThe initial t...
[{"type": "stdin_stdout", "input": "31940 139378099479290043 26943708742238 1000000000\n", "output": "997629525\n"}, {"type": "stdin_stdout", "input": "1 999999999999999999 999999999999999999 998244353\n", "output": "716070897\n"}, {"type": "stdin_stdout", "input": "345 493299812499659259 1418510335032035 998244353\n",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAllen wants to enter a fan zone that occupies a round square and has $n$ entrances.\n\nThere already is a queue of $a_i$ people in front of the $i$-th entrance. Each entrance allows one person from its queue to enter the ...
[{"type": "stdin_stdout", "input": "30\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet's define a multiplication operation between a string $a$ and a positive integer $x$: $a \\cdot x$ is the string that is a result of writing $x$ copies of $a$ one after another. For example, \"abc\" $\\cdot~2~=$ \"abca...
[{"type": "stdin_stdout", "input": "13\na\na\na\na\na\na\na\na\na\na\na\na\nb\na\na\na\na\na\na\na\na\na\na\na\nb\na\n", "output": "a\na\na\na\na\na\n-1\na\na\na\na\na\n-1\n"}, {"type": "stdin_stdout", "input": "13\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\nb\na\n", "output": "a\na\na\na\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence $s$ consisting of $n$ digits from $1$ to $9$.\n\nYou have to divide it into at least two segments (segment β€” is a consecutive sequence of elements) (in other words, you have to place separators be...
[{"type": "stdin_stdout", "input": "21\n3\n123\n3\n123\n3\n123\n3\n123\n3\n123\n3\n213\n3\n123\n3\n123\n3\n123\n3\n321\n3\n123\n3\n321\n3\n132\n3\n322\n3\n321\n3\n341\n3\n123\n3\n421\n3\n421\n3\n421\n3\n421\n", "output": "YES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n2 13\nYES\n2\n1 23\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIvan has an array consisting of n different integers. He decided to reorder all elements in increasing order. Ivan loves merge sort so he decided to represent his array with one or several increasing sequences which he th...
[{"type": "stdin_stdout", "input": "10\n71550121 446173607 640274071 402690754 802030518 598196518 796619138 96204862 983359971 799843967\n", "output": "71550121 446173607 640274071 802030518 983359971 \n402690754 598196518 796619138 799843967 \n96204862 \n"}, {"type": "stdin_stdout", "input": "10\n71550121 446173607 6...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDuring the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made unrated for some participants. \n\nLet's assume that n people took part in the contest. Let's assume that the pa...
[{"type": "stdin_stdout", "input": "10 0\n5 9 1 12 4 2 2 4 12 1\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"type": "stdin_stdout", "input": "10 0\n5 16 1 7 4 2 2 5 18 3\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"type": "stdin_stdout", "input": "10 0\n5 16 1 7 4 2 2 4 18 3\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row.\n\nLet's enumerate all the houses from left to right, starting with one...
[{"type": "stdin_stdout", "input": "100\n9 9 72 55 14 8 55 58 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 34 48 96 79 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 98 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider a billiard table of rectangular size $n \\times m$ with four pockets. Let's introduce a coordinate system with the origin at the lower left corner (see the picture). [Image] \n\nThere is one ball at the point $(...
[{"type": "stdin_stdout", "input": "1000000000 999999999 999999998 999999999 -1 -1\n", "output": "1000000000 999999999\n"}, {"type": "stdin_stdout", "input": "1000000000 999999999 999999998 999999999 -1 -1\n", "output": "1000000000 999999999"}, {"type": "stdin_stdout", "input": "1000000000 999999999 999999998 999999999...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nValera is a collector. Once he wanted to expand his collection with exactly one antique item.\n\nValera knows n sellers of antiques, the i-th of them auctioned k_{i} items. Currently the auction price of the j-th object o...
[{"type": "stdin_stdout", "input": "3 999999\n22 1000000 1000000 1250369 623205 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000100 1506663 1001000 1010000 999999 1000000 1000000 1010000 352800 999999 1000000\n14 999999 999999 1521826 1368902 999999 1000000 999999 1556972 999999 999999 418013 999999 1000000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function that will encrypt a given sentence into International Morse Code, both the input and out puts will be strings.\n\nCharacters should be separated by a single space.\nWords should be separated by a triple s...
[{"input": "\"THE QUICK BROWN FOX\"", "output": "[\"- .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..-\"]", "fn_name": "encryption"}, {"input": "\"WOLFRAM ALPHA 1\"", "output": "[\".-- --- .-.. ..-. .-. .- -- .- .-.. .--. .... .- .----\"]", "fn_name": "encryption"}, {"input": "\"Final basic test\...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers 1, 5, 10 and 50 respectively. The use of other roman digits is not allowed.\n\nNumbers in this ...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "48999999753\n"}, {"type": "stdin_stdout", "input": "1000000100\n", "output": "49000004653\n"}, {"type": "stdin_stdout", "input": "1517731607\n", "output": "74368848496\n"}, {"type": "stdin_stdout", "input": "1000001100\n", "output": "49000053653\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe internet is a very confounding place for some adults. Tom has just joined an online forum and is trying to fit in with all the teens and tweens. It seems like they're speaking in another language! Help Tom fit in by t...
[{"input": "\"Sometimes I use ? in the middle of a sentence; is that ok?!\"", "output": "[\"OMG ZOMETIMEZ I UZE ?????????????? IN the MIDDLE of A zentence; IZ that OK??????????????!1!1!1!1!1!1!1\"]", "fn_name": "n00bify"}, {"input": "\"Before you know it... wait, what does this have to do with UNO!?\"", "output": "[\"O...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nA and B are preparing themselves for programming contests.\n\nB loves to debug his code. But before he runs the solution and starts debugging, he has to first compile the code.\n\nInitially, the compiler displayed n compi...
[{"type": "stdin_stdout", "input": "10\n460626451 802090732 277246428 661369649 388684428 784303821 376287098 656422756 9301599 25720377\n277246428 388684428 661369649 460626451 656422756 802090732 9301599 784303821 376287098\n376287098 802090732 388684428 9301599 656422756 784303821 460626451 277246428\n", "output": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAt the first holiday in spring, the town Shortriver traditionally conducts a flower festival. Townsfolk wear traditional wreaths during these festivals. Each wreath contains exactly k flowers.\n\nThe work material for the...
[{"type": "stdin_stdout", "input": "100 15 6 10\n6 9 1 7 6 4 1 9 3 2 4 6 2 5 3 10 9 2 9 1 6 5 6 2 3 10 7 10 7 4 5 4 4 4 4 7 1 10 8 4 8 3 10 10 7 4 4 10 6 1 8 5 4 6 2 3 10 3 2 5 7 5 6 10 10 3 4 7 4 3 3 1 7 8 10 10 10 10 8 3 7 4 2 1 8 6 5 6 5 8 7 9 2 1 5 2 4 6 10 8\n6 9 7 8 7 1 4 3 5 8\n", "output": "2\n76 77 \n"}, {"typ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a square matrix of size n. Every row and every column of this matrix is a permutation of 1, 2, …, n. Let a_{i, j} be the element at the intersection of i-th row and j-th column for every 1 ≀ i, j ≀ n. Rows a...
[{"type": "stdin_stdout", "input": "5\n3 2\n1 2 3\n2 3 1\n3 1 2\nDR\n3 2\n1 2 3\n2 3 1\n3 1 2\nLU\n3 1\n1 2 3\n2 3 1\n3 1 2\nI\n3 1\n1 2 3\n2 3 1\n3 1 2\nC\n3 16\n1 2 3\n2 3 1\n3 1 2\nLDICRUCILDICRUCI\n", "output": "\n2 3 1 \n3 1 2 \n1 2 3 \n\n3 1 2 \n1 2 3 \n2 3 1 \n\n1 2 3 \n3 1 2 \n2 3 1 \n\n1 3 2 \n2 1 3 \n3 2 1 \n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nNatasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n - 2 intermediate planets. Formally: we number all the planets from 1 to n. 1 is Earth, n is Mars. Natasha will ...
[{"type": "stdin_stdout", "input": "90\n35\n1 68 16 30 24 1 1 1 35 1 1 67 1 1 1 1 33 16 37 77 83 1 77 26 1 1 68 67 70 62 1 47 1 1 1 84 1 65 1 32 83 1 1 1 28 1 71 76 84 1 1 5 1 74 10 1 1 1 38 87 13 1 7 66 81 49 1 9 1 11 1 25 1 1 1 1 7 1 1 36 61 47 51 1 1 69 40 1 37 1\n40 1 21 1 19 51 37 52 64 1 86 1 5 24 1 1 1 19 36 1 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA high school has a strange principal. On the first day, he has his students perform an odd opening day ceremony:\n\nThere are number of lockers \"n\" and number of students \"n\" in the school. The principal asks the fir...
[{"input": "950811894", "output": "[30835]", "fn_name": "num_of_open_lockers"}, {"input": "3991700", "output": "[1997]", "fn_name": "num_of_open_lockers"}, {"input": "74864", "output": "[273]", "fn_name": "num_of_open_lockers"}, {"input": "128", "output": "[11]", "fn_name": "num_of_open_lockers"}, {"input": "500", "out...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp found a rectangular table consisting of $n$ rows and $m$ columns. He noticed that each cell of the table has its number, obtained by the following algorithm \"by columns\":\n\ncells are numbered starting from one...
[{"type": "stdin_stdout", "input": "5\n1 1 1\n2 2 3\n3 10 11\n100 100 7312\n1001000 1000010 1000000000000\n", "output": "1\n2\n14\n1174\n1000009998991\n"}, {"type": "stdin_stdout", "input": "5\n1 1 1\n2 2 2\n3 10 11\n100 100 7312\n1001000 1000010 1000000000000\n", "output": "1\n3\n14\n1174\n1000009998991\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nZiota found a video game called \"Monster Invaders\".\n\nSimilar to every other shooting RPG game, \"Monster Invaders\" involves killing monsters and bosses with guns.\n\nFor the sake of simplicity, we only consider two d...
[{"type": "stdin_stdout", "input": "100 5 5 9 3\n3 4 2 3 4 3 8 5 2 1 1 4 1 1 10 10 7 5 2 9 4 2 10 10 8 2 4 9 6 2 6 7 7 5 7 7 1 8 10 9 9 3 10 3 10 1 1 8 3 6 4 5 5 4 9 5 9 4 8 2 10 8 9 1 5 9 7 2 1 7 9 3 2 9 1 5 4 2 3 10 6 7 8 2 10 1 6 2 1 6 10 9 1 2 2 7 2 8 4 4\n", "output": "1597\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a bracket sequence $s$ consisting of $n$ opening '(' and closing ')' brackets.\n\nA regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting ch...
[{"type": "stdin_stdout", "input": "20\n(())(()((((()())()((\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "20\n(())(((((((()())()()\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "20\n(()())()((((()(())((\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "20\n(())((((()(((())()()\n", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAs you might remember from the previous round, Vova is currently playing a strategic game known as Rage of Empires.\n\nVova managed to build a large army, but forgot about the main person in the army - the commander. So h...
[{"type": "stdin_stdout", "input": "5\n1 1\n1 4\n3 6 3\n1 4\n3 10 3\n", "output": "1\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 3\n1 4\n3 11 3\n2 4\n3 6 2\n", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 3\n1 4\n3 12 3\n1 4\n3 4 3\n", "output": "0\n2\n"}, {"type": "stdin_stdout", "input": "5\n1 3\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlice has a birthday today, so she invited home her best friend Bob. Now Bob needs to find a way to commute to the Alice's home.\n\nIn the city in which Alice and Bob live, the first metro line is being built. This metro ...
[{"type": "stdin_stdout", "input": "10 3\n0 1 1 0 1 0 0 2 -1 0\n1 4 1 2 -1 0 1 1 -1 1\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 10\n1 0 0 0 0 0 0 0 0 1\n0 0 0 0 0 0 0 0 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 10\n1 0 0 0 0 0 0 0 0 1\n0 0 0 0 0 0 0 0 0 0\n", "output": "YES\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Elephant loves magic squares very much.\n\nA magic square is a 3 Γ— 3 table, each cell contains some positive integer. At that the sums of integers in all rows, columns and diagonals of the table are equal. The figu...
[{"type": "stdin_stdout", "input": "0 100000 100000\n100000 0 100000\n100000 100000 0\n", "output": "100000 100000 100000\n100000 100000 100000\n100000 100000 100000\n"}, {"type": "stdin_stdout", "input": "0 100000 100000\n100000 0 100000\n100000 100000 0\n", "output": "100000 100000 100000\n100000 100000 100000\n10000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nThere are fine icicles under the eaves of JOI's house in Canada. Because of this, JOI decided to investigate the icicles.\n\nThere are N (2 ≀ N ≀ 100000 = 105) icicles under the eaves of JOI's house. These icic...
[{"type": "stdin_stdout", "input": "1 56\n4\n-1\n-1\n-1", "output": "52\n"}, {"type": "stdin_stdout", "input": "2 71\n14\n6\n0\n0", "output": "122\n"}, {"type": "stdin_stdout", "input": "2 30\n14\n6\n3\n0", "output": "40\n"}, {"type": "stdin_stdout", "input": "2 17\n2\n3\n3\n-1", "output": "29\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThird day at your new cryptoanalyst job and you come across your toughest assignment yet. Your job is to implement a simple keyword cipher. A keyword cipher is a type of monoalphabetic substitution where two parameters ar...
[{"input": "\"alpha bravo charlie\"\n\"delta\"", "output": "[\"djofd eqdvn lfdqjga\"]", "fn_name": "keyword_cipher"}, {"input": "\"WELCOME HOME\"\n\"gridlocked\"", "output": "[\"wlfimhl kmhl\"]", "fn_name": "keyword_cipher"}, {"input": "\"one two three\"\n\"rails\"", "output": "[\"mks twm tdpss\"]", "fn_name": "keyword...
code_functional