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\nIvan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.\n\nThere are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ c...
[{"type": "stdin_stdout", "input": "5 5 5 5\n836 776 809 618 397\n121 629 373 169 333\n589 439 410 388 446\n936 472 433 647 791\n25\n1 2\n4 5\n5 4\n4 1\n3 5\n5 2\n2 4\n3 4\n3 3\n3 2\n4 4\n4 3\n1 1\n1 4\n5 1\n2 3\n1 5\n5 5\n2 5\n3 1\n2 1\n2 2\n1 3\n5 3\n4 2\n25\n1 1\n5 4\n4 1\n1 2\n1 4\n2 3\n3 3\n4 3\n2 2\n5 3\n2 1\n1 3...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA string $b$ is a subsequence of a string $a$ if $b$ can be obtained from $a$ by deletion of several (possibly, zero or all) characters. For example, \"xy\" is a subsequence of \"xzyw\" and \"xy\", but not \"yx\".\n\nYou ...
[{"type": "stdin_stdout", "input": "1\n200\nrgygrbbbrrbbuuggbburgybrtuybubtrbryrtutuuutrrgtbbgtggrggtttbgtbuubyuyyugtgygytbgrgttruturbyuytyyggruttrbbgggbrbryrtuggbuuburrttyubybbyygubrbguybgybubgbrruubbggugtbyurgrtruyrguruygyybygbyytygttbrryrubg\n", "output": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggggggggggggggg...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N cities numbered 1 through N, and M bidirectional roads numbered 1 through M. Road i connects City A_i and City B_i.\n\nSnuke can perform the following operation zero or more times:\n\n* Choose two distinct cit...
[{"type": "stdin_stdout", "input": "103 1\n6 8", "output": "101\n"}, {"type": "stdin_stdout", "input": "164 1\n6 8", "output": "162\n"}, {"type": "stdin_stdout", "input": "109 1\n5 9", "output": "107\n"}, {"type": "stdin_stdout", "input": "56 1\n12 11", "output": "54\n"}, {"type": "stdin_stdout", "input": "129 1\n4 6",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDima's got a staircase that consists of n stairs. The first stair is at height a_1, the second one is at a_2, the last one is at a_{n} (1 ≀ a_1 ≀ a_2 ≀ ... ≀ a_{n}). \n\nDima decided to play with the staircase, so he is t...
[{"type": "stdin_stdout", "input": "5\n1 2 3 6 6\n25\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nShare price\n===========\n\nYou spent all your saved money to buy some shares.\n\nYou bought it for `invested`, and want to know how much it's worth, but all the info you can quickly get are just the change the shares pri...
[{"input": "1000\n[0, 2, 3, 6]", "output": "[\"1113.64\"]", "fn_name": "share_price"}, {"input": "100\n[-50, 100]", "output": "[\"100.00\"]", "fn_name": "share_price"}, {"input": "100\n[-20, 30]", "output": "[\"104.00\"]", "fn_name": "share_price"}, {"input": "100\n[-50, 50]", "output": "[\"75.00\"]", "fn_name": "share...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer $x$ of $n$ digits $a_1, a_2, \\ldots, a_n$, which make up its decimal notation in order from left to right.\n\nAlso, you are given a positive integer $k < n$.\n\nLet's call integer $b_1, b_2, \\ld...
[{"type": "stdin_stdout", "input": "20 10\n21474836472147483648\n", "output": "20\n21474836482147483648\n"}, {"type": "stdin_stdout", "input": "20 19\n19999999999999999999\n", "output": "20\n20000000000000000002\n"}, {"type": "stdin_stdout", "input": "20 19\n19999999999999999999\n", "output": "20\n20000000000000000002\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which manipulates a sequence A = {a0, a1, . . . , an-1} with the following operations:\n\n* find(s, t): report the minimum element in as, as+1, . . . ,at.\n* update(i, x): change ai to x.\n\n\n\nNote that ...
[{"type": "stdin_stdout", "input": "5 5\n0 0 0\n1 2 4\n1 0 0\n1 1 9\n1 1 2", "output": "2147483647\n0\n2147483647\n2147483647\n"}, {"type": "stdin_stdout", "input": "6 5\n1 0 0\n0 1 2\n1 2 3\n1 0 2\n1 2 2", "output": "2147483647\n2147483647\n2\n2147483647\n"}, {"type": "stdin_stdout", "input": "3 5\n0 0 1\n1 1 2\n1 2 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe last stage of Football World Cup is played using the play-off system.\n\nThere are n teams left in this stage, they are enumerated from 1 to n. Several rounds are held, in each round the remaining teams are sorted in ...
[{"type": "stdin_stdout", "input": "256 128 256\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 128 129\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 255 128\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 107 129\n", "output": "Final!\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nReverse every other word in a given string, then return the string. Throw away any leading or trailing whitespace, while ensuring there is exactly one space between each word. Punctuation marks should be treated as if the...
[{"input": "\"I really hope it works this time...\"", "output": "[\"I yllaer hope ti works siht time...\"]", "fn_name": "reverse_alternate"}, {"input": "\"Reverse this string, please!\"", "output": "[\"Reverse siht string, !esaelp\"]", "fn_name": "reverse_alternate"}, {"input": "\"This is not a test \"", "output": "[\"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nDr .: Peter, I've finally done it.\n\nPeter: See you again? What kind of silly invention is this time?\n\nDr .: I finally came up with a revolutionary way to process mathematical formulas on a computer. Look at this table...
[{"type": "stdin_stdout", "input": "10 0 82 - /\n4 5 - 31 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n-155.000000\n-1.000000\n"}, {"type": "stdin_stdout", "input": "10 0 82 - /\n4 5 - 60 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n-300.000000\n-1.000000\n"}, {"type": "stdin_stdout", "input": "10 0 82 - /\n4 0 - 60 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a string of integers, count how many times that integer repeats itself, then return a string showing the count and the integer.\n\n\nExample: `countMe('1123')` (`count_me` in Ruby)\n\n- Here 1 comes twice so `` will...
[{"input": "\"12322212223443\"", "output": "[\"111213321132132413\"]", "fn_name": "count_me"}, {"input": "\"1123\"", "output": "[\"211213\"]", "fn_name": "count_me"}, {"input": "\"1211\"", "output": "[\"111221\"]", "fn_name": "count_me"}, {"input": "\"21\"", "output": "[\"1211\"]", "fn_name": "count_me"}, {"input": "\"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nShapur was an extremely gifted student. He was great at everything including Combinatorics, Algebra, Number Theory, Geometry, Calculus, etc. He was not only smart but extraordinarily fast! He could manage to sum 1018 numb...
[{"type": "stdin_stdout", "input": "1010000011010110011101001101110001110010000111011101110010110110111111001001110100101100010101010001\n0111101000111100101100000101111010100100001000011101010100110011100011010011010101000100101011100011\n", "output": "110110101110101011000100100000101101011000111100000010011000010101...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nAt the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The...
[{"type": "stdin_stdout", "input": "800\n1126\n900\n198\n330", "output": "948\n"}, {"type": "stdin_stdout", "input": "800\n1126\n900\n132\n330", "output": "882\n"}, {"type": "stdin_stdout", "input": "800\n1126\n206\n132\n330", "output": "288\n"}, {"type": "stdin_stdout", "input": "800\n1126\n180\n132\n330", "output": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAn array is called `centered-N` if some `consecutive sequence` of elements of the array sum to `N` and this sequence is preceded and followed by the same number of elements. \n\nExample:\n```\n[3,2,10,4,1,6,9] is centered...
[{"input": "[0, 0, 0, -1, 1, 1, -1, 0, 0, 0]\n0", "output": "[true]", "fn_name": "is_centered"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n0", "output": "[true]", "fn_name": "is_centered"}, {"input": "[3, 2, 10, 4, 1, 6, 9]\n15", "output": "[true]", "fn_name": "is_centered"}, {"input": "[2, 10, 4, 1, 6, 9]\n15", "outp...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Artem found a grasshopper. He brought it to his house and constructed a jumping area for him.\n\nThe area looks like a strip of cells 1 Γ— n. Each cell contains the direction for the next jump and the length of that...
[{"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 6\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n2 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 2 1 1 100\n", "output": "FINITE\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have a collection of lovely poems. Unfortuantely they aren't formatted very well. They're all on one line, like this:\n\n```\nBeautiful is better than ugly. Explicit is better than implicit. Simple is better than comp...
[{"input": "\"There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now.\"", "output": "[\"There should be one-- and preferably only one --obvious way to do it.\\nAlth...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nDreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is called nice if <image> and <image>, where ...
[{"type": "stdin_stdout", "input": "10000000 10000000\n", "output": "425362313\n"}, {"type": "stdin_stdout", "input": "10000000 9999999\n", "output": "930564389\n"}, {"type": "stdin_stdout", "input": "3865975 13943620\n", "output": "633381536\n"}, {"type": "stdin_stdout", "input": "6407688 3000816\n", "output": "895399...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nCarol is currently curling.\n\nShe has n disks each with radius r on the 2D plane. \n\nInitially she has all these disks above the line y = 10^100.\n\nShe then will slide the disks towards the line y = 0 one by one in ord...
[{"type": "stdin_stdout", "input": "5 300\n939 465 129 611 532\n", "output": "300 667.8641053432639 1164.9596695962555 1522.2774553276686 2117.0538839123933\n"}, {"type": "stdin_stdout", "input": "5 300\n594 465 129 611 532\n", "output": "300 885.9684291836891 1383.0639934366804 1740.3817791680935 2335.1582077528183\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nNinja Atsushi guards the town from the roof of the Ninja Building from early morning to late night every day. This Ninja Building is two adjacent buildings of the same floor, and Atsushi's daily routine is to jump between...
[{"type": "stdin_stdout", "input": "8\n0 0 0 2 3 1 0 -1\n1 2 -1 2 1 0 -1 0\n2\n1 1 2 2\n0 -1 2 2\n-1", "output": "4\n0\n"}, {"type": "stdin_stdout", "input": "8\n0 0 -1 2 2 2 0 -1\n1 1 1 1 1 1 -1 0\n2\n1 1 2 2\n0 -1 4 2\n0", "output": "1\n0\n"}, {"type": "stdin_stdout", "input": "8\n0 0 0 2 3 1 0 -1\n1 2 0 2 1 0 -1 0\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTwin adventurers Rin and Len are searching for treasure in the Mirror Cave. The cave has two pairs of rooms, the Hall of Mirrors, and an expensive treasure lies behind the door of the room.\n\nFor convenience, each of the...
[{"type": "stdin_stdout", "input": "5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .&.\n4 1\nL.%. %..R\n0 0", "output": "Yes\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .&.\n4 1\nL.$. %.....
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nHomer has two friends Alice and Bob. Both of them are string fans.\n\nOne day, Alice and Bob decide to play a game on a string $s = s_1 s_2 \\dots s_n$ of length $n$ consisting of lowercase English letters. They move in t...
[{"type": "stdin_stdout", "input": "5\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nazazazazazazazazazazazazazazazazazazazazazazazazaz\nzazazazazazazazazazazazazazazazazazazazazazazazaza\nzzazzazzazzazzazzazzazzazzazzazzazzazzazzazza\n", "output": "bzbzbzbzbzbz...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a name, turn that name into a perfect square matrix (nested array with the amount of arrays equivalent to the length of each array). \n\nYou will need to add periods (`.`) to the end of the name if necessary, to tur...
[{"input": "\"Franklin\"", "output": "[[[\"F\", \"r\", \"a\"], [\"n\", \"k\", \"l\"], [\"i\", \"n\", \".\"]]]", "fn_name": "matrixfy"}, {"input": "\"Beyonce\"", "output": "[[[\"B\", \"e\", \"y\"], [\"o\", \"n\", \"c\"], [\"e\", \".\", \".\"]]]", "fn_name": "matrixfy"}, {"input": "\"Frank\"", "output": "[[[\"F\", \"r\",...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour dad doesn't really *get* punctuation, and he's always putting extra commas in when he posts. You can tolerate the run-on sentences, as he does actually talk like that, but those extra commas have to go!\n\nWrite a fu...
[{"input": "\"i,, don't believe this round earth,,, show me evadence!!\"", "output": "[\"i, don't believe this round earth, show me evadence!!\"]", "fn_name": "dad_filter"}, {"input": "\"Dead or alive,,,, you're coming with me,,, \"", "output": "[\"Dead or alive, you're coming with me\"]", "fn_name": "dad_filter"}, {...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya has got $n$ books, numbered from $1$ to $n$, arranged in a stack. The topmost book has number $a_1$, the next one β€” $a_2$, and so on. The book at the bottom of the stack has number $a_n$. All numbers are distinct.\n...
[{"type": "stdin_stdout", "input": "10\n4 7 10 2 1 8 3 5 9 6\n4 2 7 1 8 10 5 3 9 6\n", "output": "1 3 0 1 1 0 2 0 1 1 \n"}, {"type": "stdin_stdout", "input": "10\n4 7 10 2 1 8 3 5 9 6\n4 2 7 1 8 10 5 3 9 6\n", "output": "1 3 0 1 1 0 2 0 1 1 "}, {"type": "stdin_stdout", "input": "10\n4 7 10 2 1 8 3 5 9 6\n4 2 7 1 8 10 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nD: The Diversity of Prime Factorization\n\nProblem\n\nEbi-chan has the FACTORIZATION MACHINE, which can factorize natural numbers M (greater than 1) in O ($ \\ log $ M) time! But unfortunately, the machine could display o...
[{"type": "stdin_stdout", "input": "3\n2 3 11", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n2 2 11", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n2 2 13", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n2 3 17", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n2 2 15", "output": "0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe start with a permutation $a_1, a_2, \\ldots, a_n$ and with an empty array $b$. We apply the following operation $k$ times.\n\nOn the $i$-th iteration, we select an index $t_i$ ($1 \\le t_i \\le n-i+1$), remove $a_{t_i}...
[{"type": "stdin_stdout", "input": "6\n2 1\n2 1\n1\n3 2\n1 3 2\n1 3\n4 2\n4 1 3 2\n1 2\n5 3\n4 3 2 5 1\n1 4 5\n6 3\n2 4 5 6 1 3\n2 4 5\n7 3\n7 6 4 3 2 1 5\n1 2 6\n", "output": "1\n0\n2\n0\n0\n4\n"}, {"type": "stdin_stdout", "input": "6\n2 1\n2 1\n1\n3 2\n1 3 2\n1 3\n4 2\n4 1 3 2\n1 2\n5 3\n4 3 2 5 1\n1 4 5\n6 3\n2 4 5 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs.\n\nCatacombs consist of several rooms and bidirectional pa...
[{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 1 4 4 0 2 2 4 1 7 1 11 0 8 4 12 12 3 0 3 2 2 4 3 9 1 5 4 6 9 14 6 2 4 18 7 7 19 11 20 13 17 16 0 34 2 6 12 27 9 4 29 22 4 20 20 17 17 20 37 53 17 3 3 15 1 46 11 24 31 6 12 6 11 18 13 1 5 0 19 10 24 41 16 41 18 52 46 39 16 30 18 23 53 13\n", "output": "66\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nNumber is a palindrome if it is equal to the number with digits in reversed order.\nFor example, 5, 44, 171, 4884 are palindromes and 43, 194, 4773 are not palindromes.\n\nWrite a method `palindrome_chain_length` which ta...
[{"input": "89", "output": "[24]", "fn_name": "palindrome_chain_length"}, {"input": "87", "output": "[4]", "fn_name": "palindrome_chain_length"}, {"input": "88", "output": "[0]", "fn_name": "palindrome_chain_length"}, {"input": "10", "output": "[1]", "fn_name": "palindrome_chain_length"}, {"input": "1", "output": "[0]"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an input string.\n\nFor each symbol in the string if it's the first character occurrence, replace it with a '1', else replace it with the amount of times you've already seen it...\n \nBut will your code...
[{"input": "\"In this string, I'll make sure the amounts of a character go over 9\"", "output": "[\"11111112221221132112411115312263237221234482193101343525441123124155131\"]", "fn_name": "numericals"}, {"input": "\"hope you 123456789 expected numbers in the string\"", "output": "[\"111111212111111111321231141412115115...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are various parking lots such as three-dimensional type and tower type in the city to improve the utilization efficiency of the parking lot. In some parking lots, a \"two-stage parking device\" as shown in the figur...
[{"type": "stdin_stdout", "input": "5 5\n136\n68\n82\n84\n114\n2 4\n14\n30\n118\n54\n0 0", "output": "2 3 4 1 5\n1 2 4 3\n"}, {"type": "stdin_stdout", "input": "2 5\n123\n52\n195\n87\n105\n2 4\n18\n30\n80\n24\n0 0", "output": "4 2 3 1 5\n1 2 4 3\n"}, {"type": "stdin_stdout", "input": "1 5\n123\n52\n105\n87\n105\n2 4\n1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlexey is travelling on a train. Unfortunately, due to the bad weather, the train moves slower that it should!\n\nAlexey took the train at the railroad terminal. Let's say that the train starts from the terminal at the mo...
[{"type": "stdin_stdout", "input": "2\n2\n2 4\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "\n12\n32\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 4\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "12\n32\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 3\n10 12\n0 2\n5\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of $n$ ($n \\geq 2$) positive integers and an integer $p$. Consider an undirected weighted graph of $n$ vertices numbered from $1$ to $n$ for which the edges between the vertices $i$ and $j$ ($i...
[{"type": "stdin_stdout", "input": "1\n10 195593331\n886547706 549473499 719535263 337021357 357872635 1071822623 699988186 10455 29750933 887846992\n", "output": "1760339979\n"}, {"type": "stdin_stdout", "input": "1\n10 121406599\n432485522 549473499 522487623 1009120577 698965406 845977171 252631181 1770 81120106 717...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe goal of this exercise is to convert a string to a new string where each character in the new string is `\"(\"` if that character appears only once in the original string, or `\")\"` if that character appears more than...
[{"input": "\"Supralapsarian\"", "output": "[\")()))()))))()(\"]", "fn_name": "duplicate_encode"}, {"input": "\"CodeWarrior\"", "output": "[\"()(((())())\"]", "fn_name": "duplicate_encode"}, {"input": "\"Success\"", "output": "[\")())())\"]", "fn_name": "duplicate_encode"}, {"input": "\"recede\"", "output": "[\"()()()\...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have to restore the wall. The wall consists of $N$ pillars of bricks, the height of the $i$-th pillar is initially equal to $h_{i}$, the height is measured in number of bricks. After the restoration all the $N$ pillar...
[{"type": "stdin_stdout", "input": "100 20 149 72\n67 101 52 15 0 92 26 74 44 61 6 44 45 19 22 8 10 85 67 78 24 61 81 99 62 84 9 71 11 65 5 97 3 72 5 81 81 104 65 85 52 21 20 53 66 91 4 75 84 139 72 27 50 26 9 65 14 6 54 68 6 2 89 78 40 45 98 45 27 51 94 72 67 81 20 19 38 64 14 40 57 21 82 99 37 113 21 22 30 14 73 93 6...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\nEach of the vertices has a counter installed. Initially, the counters ...
[{"type": "stdin_stdout", "input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n", "output": "20 20 20 20 20 20\n"}, {"type": "stdin_stdout", "input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n2 10\n1 10", "output": "10 20 10 20 20 10\n"}, {"type": "stdin_stdout", "input": "6 1\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10", "output": "10 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWhen naming identifiers (variables and functions) in programming, compound words that concatenate words are used. However, if you concatenate them as they are, you will not be able to understand the word breaks, so in gen...
[{"type": "stdin_stdout", "input": "get^user_name L\ngetTserNbme U\nemaNresUteG D\nEndOfInput X", "output": "get^userName\nGetTserNbme\nema_nres_ute_g\n"}, {"type": "stdin_stdout", "input": "get^user_name L\nembNresTteg U\nemaNresUteG D\nEndOfInput X", "output": "get^userName\nEmbNresTteg\nema_nres_ute_g\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of $n$ integers, where $n$ is odd. You can make the following operation with it: Choose one of the elements of the array (for example $a_i$) and increase it by $1$ (that is, replace it with $a_...
[{"type": "stdin_stdout", "input": "23 290352079\n162011045 845692742 774584765 103906675 222286673 251540072 1067675108 30856336 71306611 790640347 835976636 327687572 387722548 48938195 769656348 341889962 393959831 928029640 320443541 248114937 798473713 159552755 814528707\n", "output": "471308140\n"}, {"type": "st...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou helped Dima to have a great weekend, but it's time to work. Naturally, Dima, as all other men who have girlfriends, does everything wrong.\n\nInna and Dima are now in one room. Inna tells Dima off for everything he do...
[{"type": "stdin_stdout", "input": "50 10\n1 2 3 4 5 6 7 8 9 10 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "50 10\n1 2 3 4 5 4 7 8 9 10 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1\n",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n**Principal Diagonal** -- The principal diagonal in a matrix identifies those elements of the matrix running from North-West to South-East.\n\n**Secondary Diagonal** -- the secondary diagonal of a matrix identifies those ...
[{"input": "[[88, 2, 2, 5, 1, 1, 2, 2, 5, 1], [4, 1, 6, 1, 1, 1, 2, 2, 7, 1], [1, 8, 1, 6, 2, 1, 2, 1, 5, 1], [1, 5, 2, 7, 2, 1, 1, 2, 5, 1], [1, 8, 2, 6, 1, 1, 2, 2, 5, 1], [1, 2, 2, 5, 1, 1, 2, 2, 5, 1], [1, 2, 2, 1, 1, 1, 1, 2, 5, 1], [1, 2, 1, 5, 1, 1, 2, 1, 5, 1], [1, 1, 2, 5, 1, 1, 2, 2, 1, 1], [88, 2, 2, 5, 1, 1...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Fair Nut lives in $n$ story house. $a_i$ people live on the $i$-th floor of the house. Every person uses elevator twice a day: to get from the floor where he/she lives to the ground (first) floor and to get from the f...
[{"type": "stdin_stdout", "input": "100\n95 81 40 82 80 78 4 86 37 94 1 46 85 6 41 87 100 69 100 87 12 61 55 81 81 32 40 54 22 32 24 73 61 68 76 16 83 76 73 77 41 37 88 46 72 63 2 37 14 49 45 81 75 56 10 101 73 85 41 17 5 2 16 75 28 53 35 77 66 53 69 82 50 95 2 12 35 62 84 46 29 95 91 49 78 14 88 75 58 52 49 31 56 43 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\nGiven are two integers A and B.\nIf Takahashi can calculate A \\times...
[{"type": "stdin_stdout", "input": "20 20\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "33 106", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 10\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1 11\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "20 1\n", "output": "-1\n"}, {"t...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\nTask:\nWrite\n```\nsmallest(n)\n```\nthat will find the smallest positive number that is evenly divisible by all ...
[{"input": "19", "output": "[232792560]", "fn_name": "smallest"}, {"input": "20", "output": "[232792560]", "fn_name": "smallest"}, {"input": "17", "output": "[12252240]", "fn_name": "smallest"}, {"input": "18", "output": "[12252240]", "fn_name": "smallest"}, {"input": "13", "output": "[360360]", "fn_name": "smallest"},...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThree years have passes and nothing changed. It is still raining in London, and Mr. Black has to close all the doors in his home in order to not be flooded. Once, however, Mr. Black became so nervous that he opened one do...
[{"type": "stdin_stdout", "input": "250\n1 0 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nC: Prayer (Pray)\n\nSome twins are famous for praying before the contest.\n\nThere are four integers $ H, W, X, Y $, and it seems unlucky if $ H \\ times W $ and $ x + y $ are both odd numbers.\n\ninput\n\nFour integers $...
[{"type": "stdin_stdout", "input": "-1 -1 -3 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 -3 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 -4 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -1 -4 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -1 -3 -...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAfter seeing the \"ALL YOUR BASE ARE BELONG TO US\" meme for the first time, numbers X and Y realised that they have different bases, which complicated their relations.\n\nYou're given a number X represented in base b_{x}...
[{"type": "stdin_stdout", "input": "10 40\n39 39 39 39 39 39 39 39 39 39\n10 39\n38 38 38 38 38 38 38 38 38 38\n", "output": ">\n"}, {"type": "stdin_stdout", "input": "10 40\n39 39 39 14 39 39 39 39 39 39\n10 39\n38 38 38 38 38 38 38 38 38 38\n", "output": ">\n"}, {"type": "stdin_stdout", "input": "10 38\n16 19 37 32 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nX and A are integers between 0 and 9 (inclusive).\nIf X is less than A, print 0; if X is not less than A, print 10.\n\n-----Constraints-----\n - 0 \\leq X, A \\leq 9\n - All values in input are integers.\n\n-----Input----...
[{"type": "stdin_stdout", "input": "11 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "19 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "-1 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 -2", "output": "10\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Task\n\nGiven a positive integer, `n`, return the number of possible ways such that `k` positive integers multiply to `n`. Order matters.\n\n**Examples**\n```\nn = 24\nk = 2\n(1, 24), (2, 12), (3, 8), (4, 6), (6, 4), (...
[{"input": "1000000\n3", "output": "[784]", "fn_name": "multiply"}, {"input": "36\n4", "output": "[100]", "fn_name": "multiply"}, {"input": "100\n1", "output": "[1]", "fn_name": "multiply"}, {"input": "20\n3", "output": "[18]", "fn_name": "multiply"}, {"input": "24\n2", "output": "[8]", "fn_name": "multiply"}, {"input"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nPaul hates palindromes. He assumes that string s is tolerable if each its character is one of the first p letters of the English alphabet and s doesn't contain any palindrome contiguous substring of length 2 or more.\n\nP...
[{"type": "stdin_stdout", "input": "302 4\nabdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdc...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEdo has got a collection of n refrigerator magnets!\n\nHe decided to buy a refrigerator and hang the magnets on the door. The shop can make the refrigerator with any size of the door that meets the following restrictions:...
[{"type": "stdin_stdout", "input": "20 5\n1 12 21 22\n9 10 15 20\n10 12 12 20\n1 1 25 29\n5 10 21 22\n4 9 20 25\n12 10 14 24\n3 3 19 27\n3 4 23 28\n9 1 11 31\n9 14 17 18\n8 12 14 20\n8 11 18 19\n12 3 14 29\n7 8 13 22\n6 4 16 30\n11 3 13 27\n9 16 15 18\n6 13 14 21\n9 12 15 22\n", "output": "4\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind t...
[{"type": "stdin_stdout", "input": "10 998244353\n10 10 10 9 5 12 0 4 7 0", "output": "559205848\n"}, {"type": "stdin_stdout", "input": "10 1051516890\n10 15 10 1 5 4 0 8 4 0", "output": "142815647\n"}, {"type": "stdin_stdout", "input": "10 918571889\n10 9 10 7 7 3 0 11 4 0", "output": "551061978\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEla likes Chess a lot. During breaks, she usually challenges her co-worker in DTL to some chess games. She's not an expert at classic chess, but she's very interested in Chess variants, where she has to adapt to new rules...
[{"type": "stdin_stdout", "input": "10\n4\n2 2 3 3 2 3\n2 3\n7\n1 1 1 2 2 1\n6 7\n9\n9 1 8 1 9 2\n5 9\n6\n2 4 3 4 2 3\n6 5\n7\n2 2 2 1 3 1\n3 5\n7\n6 1 7 2 7 1\n2 2\n7\n2 1 2 2 1 2\n7 6\n7\n3 6 3 7 4 7\n3 7\n10\n2 1 1 2 1 1\n6 3\n4\n2 3 1 3 2 4\n3 4\n", "output": "YES\nNO\nNO\nYES\nYES\nNO\nYES\nYES\nNO\nNO\n"}, {"type...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\...
[{"type": "stdin_stdout", "input": "691900\n", "output": "4444477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ water tanks in a row, $i$-th of them contains $a_i$ liters of water. The tanks are numbered from $1$ to $n$ from left to right.\n\nYou can perform the following operation: choose some subsegment $[l, r]$ ($1...
[{"type": "stdin_stdout", "input": "65\n1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64\n", "output": "15416.615384615392\n15416.615384615392\n15416.615384615392\n15416.61538461...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya recieved a gift of a string s with length up to 10^5 characters for his birthday. He took two more empty strings t and u and decided to play a game. This game has two possible moves: Extract the first character of ...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"}, {"type": "stdin_stdout", "input": "bababaaababaabbbbbabbbbbbaa...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nZane the wizard is going to perform a magic show shuffling the cups.\n\nThere are n cups, numbered from 1 to n, placed along the x-axis on a table that has m holes on it. More precisely, cup i is on the table at the posit...
[{"type": "stdin_stdout", "input": "203948 2 14\n203948 203947\n39 47\n4959 3030\n1 203947\n2929 12381\n203944 203948\n203947 203944\n203944 203922\n203922 203948\n2495 20495\n29419 5959\n12949 12\n49 29292\n1 94\n1 203\n", "output": "203947\n"}, {"type": "stdin_stdout", "input": "203948 2 14\n203948 203947\n39 38\n495...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAyoub had an array $a$ of integers of size $n$ and this array had two interesting properties: All the integers in the array were between $l$ and $r$ (inclusive). The sum of all the elements was divisible by $3$. \n\nUn...
[{"type": "stdin_stdout", "input": "101149 1300011130 1476544836\n", "output": "156648241\n"}, {"type": "stdin_stdout", "input": "101149 686320621 1476544836\n", "output": "113944181\n"}, {"type": "stdin_stdout", "input": "120881 536336525 585696606\n", "output": "915864703\n"}, {"type": "stdin_stdout", "input": "12138...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Definition\n\n**_Jumping number_** is the number that *All adjacent digits in it differ by 1*.\n\n____\n\n# Task\n\n**_Given_** a number, **_Find if it is Jumping or not_** . \n____\n\n# Warm-up (Highly recommended)\n\n...
[{"input": "987654322", "output": "[\"Not!!\"]", "fn_name": "jumping_number"}, {"input": "23", "output": "[\"Jumping!!\"]", "fn_name": "jumping_number"}, {"input": "32", "output": "[\"Jumping!!\"]", "fn_name": "jumping_number"}, {"input": "98", "output": "[\"Jumping!!\"]", "fn_name": "jumping_number"}, {"input": "1", "...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlice received a set of Toy Trainβ„’ from Bob. It consists of one train and a connected railway network of $n$ stations, enumerated from $1$ through $n$. The train occupies one station at a time and travels around the netwo...
[{"type": "stdin_stdout", "input": "5000 1\n4008 1126\n", "output": "6125 6124 6123 6122 6121 6120 6119 6118 6117 6116 6115 6114 6113 6112 6111 6110 6109 6108 6107 6106 6105 6104 6103 6102 6101 6100 6099 6098 6097 6096 6095 6094 6093 6092 6091 6090 6089 6088 6087 6086 6085 6084 6083 6082 6081 6080 6079 6078 6077 6076 6...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nModify the `kebabize` function so that it converts a camel case string into a kebab case.\n\nNotes:\n - the returned string should only contain lowercase letters\n\nWrite your solution by modifying this code:\n\n```pytho...
[{"input": "\"myCamelCasedString\"", "output": "[\"my-camel-cased-string\"]", "fn_name": "kebabize"}, {"input": "\"myCamelHas3Humps\"", "output": "[\"my-camel-has-humps\"]", "fn_name": "kebabize"}, {"input": "\"CodeWars\"", "output": "[\"code-wars\"]", "fn_name": "kebabize"}, {"input": "\"SOS\"", "output": "[\"s-o-s\"]...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\n\"Teishi-zushi\", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is C meters. Customers cannot go inside the counter.\n\nNakahashi entered Teishi-zushi, an...
[{"type": "stdin_stdout", "input": "15 10000000000\n400000000 1000000000\n800000000 1000000000\n1900000000 1000000000\n2400000000 1000000000\n2900000000 1000000000\n3300000000 1000000000\n3700000000 1000000000\n3800000000 1000000000\n4000000000 1000000000\n4100000000 1000000000\n5200000000 1000000000\n6600000000 100000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function `sumTimesTables` which sums the result of the sums of the elements specified in `tables` multiplied by all the numbers in between `min` and `max` including themselves.\n\nFor example, for `sumTimesTables(...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n1\n10", "output": "[3025]", "fn_name": "sum_times_tables"}, {"input": "[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]\n1\n10", "output": "[3025]", "fn_name": "sum_times_tables"}, {"input": "[5, 4, 7, 8, 9, 6, 3, 2, 10, 1]\n1\n10", "output": "[3025]", "fn_name": "sum_times_tables"}, {"input...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven an array $a_1, a_2, \\dots, a_n$, you need to handle a total of $q$ updates and queries of two types:\n\n$1$ $l$ $r$ β€” for each index $i$ with $l \\leq i \\leq r$, update the value of $a_i$ to the sum of the digits ...
[{"type": "stdin_stdout", "input": "1\n8 35\n14 14 14 14 14 14 14 14\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 6 7\n1 1 8\n2 1\n2 2\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n", "output": "5\n5\n5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAfter celebrating the midcourse the students of one of the faculties of the Berland State University decided to conduct a vote for the best photo. They published the photos in the social network and agreed on the rules to...
[{"type": "stdin_stdout", "input": "40\n119631 119631 772776 119631 658661 119631 108862 524470 125132 700668 69196 844949 154577 108862 108862 108862 597344 940938 989698 108862 154577 69196 125132 687080 940938 125132 69196 69196 125132 566152 953083 406319 380068 119631 154577 125132 413984 69196 154577 154577\n", "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasiliy spent his vacation in a sanatorium, came back and found that he completely forgot details of his vacation! \n\nEvery day there was a breakfast, a dinner and a supper in a dining room of the sanatorium (of course, ...
[{"type": "stdin_stdout", "input": "718167999978848233 1000000000000000000 1000000000000000000\n", "output": "281832000021151766\n"}, {"type": "stdin_stdout", "input": "338654687020656675 999999999999999999 1000000000000000000\n", "output": "661345312979343324\n"}, {"type": "stdin_stdout", "input": "643704740517968615 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA Martian boy is named s β€” he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys looking for his name everywhere. If he sees that he can obtain his name from some string by rem...
[{"type": "stdin_stdout", "input": "mars\nsunvenusearthmarsjupitersaturnuranusneptune\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "mars\nsunvenusearthmarsjupitersatuqnuranusneptune\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "mars\nsunvenusearthmarsjupitersatuqnuranusnepttne\n", "output": "0\n"}...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVector Willman and Array Bolt are the two most famous athletes of Byteforces. They are going to compete in a race with a distance of L meters today.\n\n [Image] \n\nWillman and Bolt have exactly the same speed, so when th...
[{"type": "stdin_stdout", "input": "5000000000000000000 4999999999999999837 4999999999999999963\n", "output": "1249999999999999959/1250000000000000000\n"}, {"type": "stdin_stdout", "input": "5000000000000000000 4999999999999999837 4999999999999999963\n", "output": "1249999999999999959/1250000000000000000\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ piles of stones, where the $i$-th pile has $a_i$ stones. Two people play a game, where they take alternating turns removing stones.\n\nIn a move, a player may remove a positive number of stones from the firs...
[{"type": "stdin_stdout", "input": "7\n3\n2 5 10\n8\n1 2 1 1 1 1 1 1\n6\n2 2 5 4 5 6\n6\n1 1 2 1 2 1\n1\n1000000000\n5\n1 4 2 1 1\n3\n1 1 1\n", "output": "First \nSecond\nFirst \nFirst \nFirst \nSecond\nFirst \n"}, {"type": "stdin_stdout", "input": "7\n3\n2 5 10\n8\n1 2 1 1 1 1 1 1\n6\n2 2 5 4 5 6\n6\n1 1 2 1 2 1\n1\n1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\nFind the total number of biscuits produced within T + 0...
[{"type": "stdin_stdout", "input": "1 20 20\n", "output": "400\n"}, {"type": "stdin_stdout", "input": "1 -7 15", "output": "-105\n"}, {"type": "stdin_stdout", "input": "1 -8 13", "output": "-104\n"}, {"type": "stdin_stdout", "input": "1 -7 21", "output": "-147\n"}, {"type": "stdin_stdout", "input": "1 -8 19", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array A of length N. Your task is to divide it into several contiguous subarrays. Here, all subarrays obtained must be sorted in either non-decreasing or non-increasing order. At least how many subarrays ...
[{"type": "stdin_stdout", "input": "7\n-1 -1 1 0 1 31150610 0000000101", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\n1 2 3 2 1 999999999 1000000100", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\n1 4 3 2 1 999999999 1000000100", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\n1 4 3 4 1 999...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBy 2312 there were n Large Hadron Colliders in the inhabited part of the universe. Each of them corresponded to a single natural number from 1 to n. However, scientists did not know what activating several colliders simul...
[{"type": "stdin_stdout", "input": "1 100\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nΒ«PolygonΒ» is a system which allows to create programming tasks in a simple and professional way. When you add a test to the problem, the corresponding form asks you for the test index. As in most cases it is clear which i...
[{"type": "stdin_stdout", "input": "10\n1 7 13 6 10 10 3 8 2 4\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n1 7 13 6 10 10 4 8 2 4\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "10\n1 7 13 6 10 10 4 8 2 8\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "10\n1 7 13 6 5 10 3 8 2 4\n", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou're on your way to the market when you hear beautiful music coming from a nearby street performer. The notes come together like you wouln't believe as the musician puts together patterns of tunes. As you wonder what ki...
[{"input": "\"Did I ever tell you about my run with that paleolithic beast? He tried all sorts of ways to get at my three dolla and fitty cent? I told him 'this is MY 4 dolla!'. He just wouldn't listen.\"", "output": "[false]", "fn_name": "is_lock_ness_monster"}, {"input": "\"I'm from Scottland. I moved here to be with...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are fighting with Zmei Gorynich β€” a ferocious monster from Slavic myths, a huge dragon-like reptile with multiple heads! \n\n $m$ \n\nInitially Zmei Gorynich has $x$ heads. You can deal $n$ types of blows. If you deal...
[{"type": "stdin_stdout", "input": "5\n4 807989196\n770312657 78181451\n624192034 690910298\n754831733 354913874\n519577171 400120478\n4 491297333\n546432637 76258441\n312107971 75446008\n767483254 958677299\n84044330 577526244\n2 177840791\n197738084 143071228\n23274563 597315796\n7 610054060\n858529462 646280969\n644...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a board of size $n \\times n$, where $n$ is odd (not divisible by $2$). Initially, each cell of the board contains one figure.\n\nIn one move, you can select exactly one figure presented in some cell and mov...
[{"type": "stdin_stdout", "input": "3\n11\n11375\n5405\n", "output": "440\n490606116000\n52633933240\n"}, {"type": "stdin_stdout", "input": "3\n11\n22093\n2775\n", "output": "440\n3594535872088\n7123077200\n"}, {"type": "stdin_stdout", "input": "3\n21\n7511\n4623\n", "output": "3080\n141244655440\n32934449248\n"}, {"ty...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a set of points $x_1$, $x_2$, ..., $x_n$ on the number line.\n\nTwo points $i$ and $j$ can be matched with each other if the following conditions hold: neither $i$ nor $j$ is matched with any other point; ...
[{"type": "stdin_stdout", "input": "100 13\n11 28 21 7 6 23 26 31 26 32 34 17 19 1 13 1 28 30 28 8 23 36 17 20 5 37 32 23 14 1 20 23 3 39 20 14 2 12 15 3 1 27 7 25 15 39 10 6 8 37 6 22 7 29 6 17 17 9 16 3 39 23 2 34 20 12 28 29 32 2 38 27 36 27 29 18 7 14 27 25 33 18 29 40 22 9 9 6 21 7 23 35 33 26 31 31 39 36 27 27\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Description\nWrite a function that checks whether a credit card number is correct or not, using the Luhn algorithm.\n\nThe algorithm is as follows:\n\n* From the rightmost digit, which is the check digit, moving left, d...
[{"input": "\"8895 6238 9323 4311\"", "output": "[false]", "fn_name": "valid_card"}, {"input": "\"5457 6238 5568 4311\"", "output": "[false]", "fn_name": "valid_card"}, {"input": "\"5457 6238 9323 4311\"", "output": "[false]", "fn_name": "valid_card"}, {"input": "\"5457 1125 9323 4311\"", "output": "[false]", "fn_name"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven an array a_1, a_2, ..., a_{n} of n integers, find the largest number in the array that is not a perfect square.\n\nA number x is said to be a perfect square if there exists an integer y such that x = y^2.\n\n\n-----...
[{"type": "stdin_stdout", "input": "71\n908209 289 44521 240100 680625 274576 212521 91809 506944 499849 3844 15376 592900 58081 240100 984064 732736 257049 600625 180625 130321 580644 261121 75625 46225 853776 485809 700569 817216 268324 293764 528529 25921 399424 175561 99856 295936 20736 611524 13924 470596 574564 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWinters are just damn freezing cold in Nvodsk! That's why a group of n friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for example, 12-34-56). ...
[{"type": "stdin_stdout", "input": "10\n5 eeleGlOFWbcnIPPtnll\n55-55-55\n00-00-00\n98-65-32\n76-43-10\n98-76-54\n2 DMBiqRyQJkFvHPJNJp\n28-97-50\n87-64-10\n4 bAfmtnKHohIX\n61-58-93\n77-77-77\n53-17-51\n96-43-10\n3 cDX\n22-22-22\n77-77-77\n63-30-64\n1 HCeHJ\n44-44-44\n6 HgSpfAolwoaBQ\n96-93-53\n98-53-10\n33-33-33\n66-66-...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n Round the given number `n` to the nearest multiple of `m`.\n\n If `n` is exactly in the middle of 2 multiples of m, return `n` instead.\n\n# Example\n\n For `n = 20, m = 3`, the output should be `21`.\n\n For `n ...
[{"input": "50\n100", "output": "[50]", "fn_name": "rounding"}, {"input": "123\n456", "output": "[0]", "fn_name": "rounding"}, {"input": "20\n3", "output": "[21]", "fn_name": "rounding"}, {"input": "19\n3", "output": "[18]", "fn_name": "rounding"}, {"input": "1\n10", "output": "[0]", "fn_name": "rounding"}]
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Definition\n\n**_Extra perfect number_** *is the number that* **_first_** and **_last_** *bits* are **_set bits_**.\n\n____\n\n# Task\n\n**_Given_** *a positive integer* `N` , **_Return_** the **_extra perfect numbe...
[{"input": "39", "output": "[[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]]", "fn_name": "extra_perfect"}, {"input": "28", "output": "[[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27]]", "fn_name": "extra_perfect"}, {"input": "7", "output": "[[1, 3, 5, 7]]", "fn_name": "extra_perfect"},...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function that solves an algebraic expression given as a string. \n\n* The expression can include only sums and products. \n\n* The numbers in the expression are in standard notation (NOT scientific).\n\n* In contr...
[{"input": "\"1.333333333*1.23456789+0.003*0.002\"", "output": "[\"1.64610e+00\"]", "fn_name": "sum_prod"}, {"input": "\"0.5*1.2*56+9.6*5*81+1\"", "output": "[\"3.92260e+03\"]", "fn_name": "sum_prod"}, {"input": "\"5.4*4.0+6.2+8.0\"", "output": "[\"3.58000e+01\"]", "fn_name": "sum_prod"}, {"input": "\"5*8+6*3*2\"", "ou...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $A$ and $B$, calculate the number of pairs $(a, b)$ such that $1 \\le a \\le A$, $1 \\le b \\le B$, and the equation $a \\cdot b + a + b = conc(a, b)$ is true; $conc(a, b)$ is the concatenation ...
[{"type": "stdin_stdout", "input": "3\n1 14\n4 2\n191 102469002\n", "output": "1\n0\n1528\n"}, {"type": "stdin_stdout", "input": "3\n1 14\n4 2\n131 176163142\n", "output": "1\n0\n1048\n"}, {"type": "stdin_stdout", "input": "3\n1 14\n4 2\n142 128000654\n", "output": "1\n0\n1136\n"}, {"type": "stdin_stdout", "input": "3\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor given two sequences $X$ and $Y$, a sequence $Z$ is a common subsequence of $X$ and $Y$ if $Z$ is a subsequence of both $X$ and $Y$. For example, if $X = \\\\{a,b,c,b,d,a,b\\\\}$ and $Y = \\\\{b,d,c,a,b,a\\\\}$, the se...
[{"type": "stdin_stdout", "input": "3\nabcbdab\nbdcaba\nabc\nabc\nacb\nbc", "output": "4\n3\n1\n"}, {"type": "stdin_stdout", "input": "3\nabcbdab\nbdcaba\nabc\nabc\nbcb\nbc", "output": "4\n3\n2\n"}, {"type": "stdin_stdout", "input": "3\nabcbdab\nbdcaba\n`bc\nabc\nbcb\nbc", "output": "4\n2\n2\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn number theory, Euler's totient is an arithmetic function, introduced in 1763 by Euler, that counts the positive integers less than or equal to `n` that are relatively prime to `n`. Thus, if `n` is a positive integer, t...
[{"input": "\"wow doge\"", "output": "[0]", "fn_name": "totient"}, {"input": "0.0435", "output": "[0]", "fn_name": "totient"}, {"input": "false", "output": "[0]", "fn_name": "totient"}, {"input": "19", "output": "[18]", "fn_name": "totient"}, {"input": "15", "output": "[8]", "fn_name": "totient"}, {"input": "18", "outp...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nSuppose I have two vectors: `(a1, a2, a3, ..., aN)` and `(b1, b2, b3, ..., bN)`. The dot product between these two vectors is defined as:\n\n```\na1*b1 + a2*b2 + a3*b3 + ... + aN*bN\n```\n\nThe vectors are classified as o...
[{"input": "[5, 10, 1, 20, 2]\n[-2, -20, -1, 10, 5]", "output": "[false]", "fn_name": "is_orthogonal"}, {"input": "[2, 4, 5, 6, 7]\n[-14, -12, 0, 8, 4]", "output": "[true]", "fn_name": "is_orthogonal"}, {"input": "[1, -2, 3, -4]\n[-4, 3, 2, -1]", "output": "[true]", "fn_name": "is_orthogonal"}, {"input": "[3, -4, -5]\n...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIvan has an array consisting of n elements. Each of the elements is an integer from 1 to n.\n\nRecently Ivan learned about permutations and their lexicographical order. Now he wants to change (replace) minimum number of e...
[{"type": "stdin_stdout", "input": "50\n48 37 47 50 46 43 42 46 36 40 45 41 40 50 35 49 37 42 44 45 49 44 31 47 45 49 48 41 45 45 48 20 34 43 43 41 47 50 41 48 38 48 43 48 46 48 32 37 47 45\n", "output": "31\n1 2 3 4 5 6 7 8 36 9 10 11 40 12 35 13 14 42 15 16 17 44 31 18 19 49 21 22 23 24 25 20 34 26 27 28 29 50 41 30 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor a given array $a$ consisting of $n$ integers and a given integer $m$ find if it is possible to reorder elements of the array $a$ in such a way that $\\sum_{i=1}^{n}{\\sum_{j=i}^{n}{\\frac{a_j}{j}}}$ equals $m$? It is ...
[{"type": "stdin_stdout", "input": "5\n4 10\n5 5 5 5\n3 5\n5 5 5\n3 4\n10 1 1\n4 5\n5 5 1 5\n5 5\n5 5 5 10 5\n", "output": "NO\nNO\nNO\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "5\n4 10\n5 5 5 5\n3 5\n5 5 5\n3 4\n10 1 1\n4 5\n5 5 1 5\n5 5\n5 5 5 15 5\n", "output": "NO\nNO\nNO\nNO\nNO\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVillages were scattered in the Wakamatsu Plain of Aizu. Several settlements are connected by straight roads that allow them to travel to and from each other, and any settlement in the plain can be traced back and forth. E...
[{"type": "stdin_stdout", "input": "7 6\n-1 2\n3 0\n2 2\n1 -1\n4 1\n2 3\n3 5\n1 3\n2 4\n2 3\n3 5\n3 7\n6 7", "output": "20.8510743960\n"}, {"type": "stdin_stdout", "input": "7 6\n-1 2\n3 0\n2 4\n1 -1\n4 1\n2 3\n3 5\n1 3\n2 4\n2 3\n3 5\n3 7\n6 7", "output": "20.0292199808\n"}, {"type": "stdin_stdout", "input": "7 6\n-1 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n\nWrite a function named `sumEvenNumbers`, taking a sequence of numbers as single parameter. Your function must return the sum of **the even values** of this sequence.\n\nOnly numbers without decimals like `4` or ...
[{"input": "[15397, 12422, 10495, 22729, 23921, 18326, 27955, 24073, 23690, 15002, 11615, 15682, 24346, 16725, 17252, 20467, 20493, 17807, 13041, 25861, 22471, 22747, 24082, 18979, 28543, 26488, 10002, 24740, 17950, 26573, 25851, 19446, 22584, 14857, 17387, 29310, 28265, 19497, 11394, 28111, 20957, 17201, 26647, 26885,...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nApart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky an...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "100000000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "900000000\n", "output": "100000000\n"}, {"type": "stdin...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe king's birthday dinner was attended by $k$ guests. The dinner was quite a success: every person has eaten several dishes (though the number of dishes was the same for every person) and every dish was served alongside ...
[{"type": "stdin_stdout", "input": "100 100\n97 64 64 35 35 97 39 83 26 97 92 97 83 11 83 97 97 64 23 97 97 11 39 11 11 39 64 14 23 39 64 26 26 97 39 39 39 64 83 26 83 97 64 11 64 64 64 83 64 92 64 26 83 26 27 64 11 83 92 92 23 11 11 97 92 64 97 64 97 83 64 27 83 23 11 26 11 92 83 64 83 11 11 11 97 83 97 26 26 97 23 23...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTaro is a member of a programming contest circle. In this circle, the members manage their schedules in the system called Great Web Calender.\n\nTaro has just added some of his friends to his calendar so that he can brows...
[{"type": "stdin_stdout", "input": "5 2\n12.765198556451168 15.39026707382745 9.233322443088145\n10.815832893726053 -1.9252139692459584 2.3339220907347795\n4.371806005587981 8.307983558511573 9.03829736864434\n3.663558291396137 5.363391652445537 7.212792777097519\n3.0699790954158255 4.913753801376337 -4.249695725207287...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn 21XX, an annual programming contest, Japan Algorithmist GrandPrix (JAG) has become one of the most popular mind sports events.\n\nJAG is conducted as a knockout tournament. This year, $N$ contestants will compete in JA...
[{"type": "stdin_stdout", "input": "[[r-i]-[m-e]]\nd -1\no 0\ng -1\nl 6", "output": "No\n"}, {"type": "stdin_stdout", "input": "[[m-y]-[a-o]]\nn 0\na 1\ny 2\nm 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "[[r-i]-[m-e]]\nd -1\nr 1\ng 1\nm 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "[[r-i]-[m-...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe new \"Die Hard\" movie has just been released! There are n people at the cinema box office standing in a huge line. Each of them has a single 100, 50 or 25 ruble bill. A \"Die Hard\" ticket costs 25 rubles. Can the bo...
[{"type": "stdin_stdout", "input": "14\n25 25 25 25 25 25 25 50 50 50 100 100 100 100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "14\n25 25 25 25 25 25 25 50 50 50 100 100 100 100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n100 100 100 100 100 100 100 100 100 100\n", "output": "NO\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOnce upon a time Petya and Gena gathered after another programming competition and decided to play some game. As they consider most modern games to be boring, they always try to invent their own games. They have only stic...
[{"type": "stdin_stdout", "input": "110\n-256 -149 -136 -33 -253 -141 -170 -253 0 -107 -141 -236 -65 -158 -84 -180 -97 -97 -223 -44 -232 -255 -108 -25 -49 -48 -212 -3 -232 -172 -231 -158 -23 -206 -198 -55 -36 -11 -169 -94 -190 -115 -116 -231 -155 -201 -155 -103 -242 -119 -136 -8 -2 -11 -69 -250 -51 -129 -155 -216 -107 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nHave you ever used the chat application QQ? Well, in a chat group of QQ, administrators can muzzle a user for days.\n\nIn Boboniu's chat group, there's a person called Du Yi who likes to make fun of Boboniu every day.\n\n...
[{"type": "stdin_stdout", "input": "100 61 71\n11 18 0 47 33 37 91 13 8 30 73 64 50 97 62 50 2 36 68 32 64 74 32 77 81 41 23 44 40 18 45 33 21 68 57 79 107 23 21 37 99 27 30 56 75 62 75 63 1 15 79 42 18 66 21 25 2 12 89 48 75 7 57 85 80 14 82 29 66 47 29 10 1 84 79 39 33 81 135 26 80 67 52 25 38 68 57 53 38 83 83 3 86 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya, like many others, likes to participate in a variety of sweepstakes and lotteries. Now he collects wrappings from a famous chocolate bar \"Jupiter\". According to the sweepstake rules, each wrapping has an integer w...
[{"type": "stdin_stdout", "input": "50\n667406402 354775600 95220950 604569294 945922983 82947113 120853697 25192357 911801905 8804755 572528228 1217518845 180664274 949243037 5283222 128577958 23627567 882714363 413386071 937062768 916521072 1051464852 328941225 17876118 770879655 928962609 331124489 236187404 8786298...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn this problem you will meet the simplified model of game King of Thieves.\n\nIn a new ZeptoLab game called \"King of Thieves\" your aim is to reach a chest with gold by controlling your character, avoiding traps and obs...
[{"type": "stdin_stdout", "input": "100\n*****************************)**********************************************************************\n", "output": "yes\n"}, {"type": "stdin_stdout", "input": "100\n*.....................*.....................*.....................*......../............*...........\n", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe all know the problem about the number of ways one can tile a 2 Γ— n field by 1 Γ— 2 dominoes. You probably remember that it goes down to Fibonacci numbers. We will talk about some other problem below, there you also are ...
[{"type": "stdin_stdout", "input": "101\n", "output": "aaffjjnnrrvvzzddhhllppttxxbbffjjnnrrvvzzddhhllppttxxbbffjjnnrrvvzzddhhllppttxxbbffjjnnrrvvzzddhhllppt\nbbggkkoosswwaaeeiimmqquuyyccggkkoosswwaaeeiimmqquuyyccggkkoosswwaaeeiimmqquuyyccggkkoosswwaaeeiimmqqt\ncddhhllppttxxbbffjjnnrrvvzzddhhllppttxxbbffjjnnrrvvzzddhhll...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?\n\nOh, that's funny, is it? Oh it's funny? Because we've been at thi...
[{"type": "stdin_stdout", "input": "5\n2\n1 1\n2\n1 1000000000\n2\n1000000000 1\n2\n1000000000 1000000000\n2\n228 1337\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n1 1\n2\n1 1000000000\n2\n1000000000 1\n2\n1000000000 1000000000\n2\n228 1337\n", "output": "YES\nYES\nNO\nYES\nYES\n"...
code_stdio