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\nThe \"BerCorp\" company has got n employees. These employees can use m approved official languages for the formal correspondence. The languages are numbered with integers from 1 to m. For each employee we have the list of...
[{"type": "stdin_stdout", "input": "100 100\n1 33\n0\n2 35 4\n2 40 78\n1 69\n0\n1 2\n0\n0\n2 81 34\n1 45\n0\n1 87\n1 50\n1 97\n0\n2 100 59\n0\n0\n0\n1 45\n0\n0\n0\n1 6\n1 54\n0\n0\n0\n4 79 96 52 84\n1 86\n0\n0\n0\n0\n0\n0\n0\n0\n3 90 2 80\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 2\n0\n1 64\n0\n1 78\n1 82\n0\n0\n0\n0\n0\n1 6\n0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTheofanis decided to visit his uncle's farm. There are $s$ animals and $n$ animal pens on the farm. For utility purpose, animal pens are constructed in one row.\n\nUncle told Theofanis that a farm is lucky if you can dist...
[{"type": "stdin_stdout", "input": "4\n1 1 1\n1 1 1\n100 50 200\n56220 47258 14497\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n1 1 1\n1 -1 2\n110 50 200\n56220 47258 14497\n", "output": "YES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n1 1 1\n1 -1 2\n110 53 200\n56220 47258 14...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis is an interactive problem. Refer to the Interaction section below for better understanding.\n\nIthea and Chtholly want to play a game in order to determine who can use the kitchen tonight.\n\n<image>\n\nInitially, It...
[{"type": "stdin_stdout", "input": "10 120 15\n6\n11\n9\n11\n3\n12\n11\n12\n2\n8\n3\n11\n13\n5\n12\n18\n9\n3\n10\n9\n9\n13\n13\n5\n6\n11\n3\n15\n8\n8\n10\n13\n7\n6\n4\n14\n9\n10\n5\n13\n4\n1\n8\n6\n13\n1\n3\n4\n9\n12\n2\n7\n3\n3\n7\n2\n2\n9\n2\n4\n2\n2\n11\n12\n15\n13\n6\n2\n11\n1\n8\n3\n13\n6\n15\n6\n4\n3\n4\n15\n15\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n### Background\n\nI was reading a [book](http://www.amazon.co.uk/Things-Make-Do-Fourth-Dimension/dp/1846147646/) recently, \"Things to Make and Do in the Fourth Dimension\" by comedian and mathematician Matt Parker, and i...
[{"input": "\"123220\"\n10", "output": "[false]", "fn_name": "is_polydivisible"}, {"input": "\"30043052\"\n6", "output": "[true]", "fn_name": "is_polydivisible"}, {"input": "\"12345\"\n10", "output": "[false]", "fn_name": "is_polydivisible"}, {"input": "\"1234\"\n10", "output": "[false]", "fn_name": "is_polydivisible"}...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nTwo-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, \"AZ\", \"AA\", \"ZA\" β€” three distinct two-grams.\n\nYou are given a string $s$ consisting of $n$ capital Latin letters. Your...
[{"type": "stdin_stdout", "input": "100\nURXCAIZFIBNJTPCZHBQIBCILLPXZCFGMKKZMNPLCYGAVJVIBMCZEBSJWPSCPQDYCTTKPOKIJRSKIZPDGCHVOUTMPNECYORSFZFNC\n", "output": "IB\n"}, {"type": "stdin_stdout", "input": "100\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y...
[{"type": "stdin_stdout", "input": "100\n10 12 512917373\n6 9 512917366\n66 44 512917421\n49 18 512917412\n57 96 512917426\n65 72 512917442\n62 59 512917440\n27 77 512917437\n31 13 512917395\n38 39 512917428\n15 72 512917430\n0 69 512917418\n22 22 512917395\n9 69 512917427\n37 96 512917428\n12 23 512917386\n100 90 5129...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOne of the most important products of the R1 company is a popular @r1.com mail service. The R1 mailboxes receive and send millions of emails every day.\n\nToday, the online news thundered with terrible information. The R1...
[{"type": "stdin_stdout", "input": "gerald.agapov1991@gmail.com\n", "output": " 18"}, {"type": "stdin_stdout", "input": "x@x.x@x.x_e_@r1.com\n", "output": " 8"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVanya has a scales for weighing loads and weights of masses w^0, w^1, w^2, ..., w^100 grams where w is some integer not less than 2 (exactly one weight of each nominal value). Vanya wonders whether he can weight an item w...
[{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1100000000 1000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "441890232 441890232\n", "output": "YES\n"}...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya has a sequence of cubes and exactly one integer is written on each cube. Vasya exhibited all his cubes in a row. So the sequence of numbers written on the cubes in the order from the left to the right equals to a_1,...
[{"type": "stdin_stdout", "input": "10 1 10\n6 7 6 1 10 10 9 5 3 9\n7 10 9 6 1 5 9 3 10 6\n", "output": "TRUTH\n"}, {"type": "stdin_stdout", "input": "10 1 10\n6 7 6 1 10 10 9 5 3 9\n7 10 9 6 1 5 9 3 10 6\n", "output": "TRUTH\n"}, {"type": "stdin_stdout", "input": "8 3 6\n5 3 1 1 1 1 1 10\n3 3 1 1 1 1 5 5\n", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPrint the circumference of a circle of radius R.\n\n-----Constraints-----\n - 1 \\leq R \\leq 100\n - All values in input are integers.\n\n-----Input-----\nInput is given from Standard Input in the following format:\nR\n\...
[{"type": "stdin_stdout", "input": "100\n", "output": "628.31853071795865162130\n"}, {"type": "stdin_stdout", "input": "73\n", "output": "458.67252742410977361942\n"}, {"type": "stdin_stdout", "input": "20\n", "output": "125.66370614359172463992\n"}, {"type": "stdin_stdout", "input": "38\n", "output": "238.761041672824...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi is a user of a site that hosts programming contests.\n\nWhen a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows: \n - ...
[{"type": "stdin_stdout", "input": "2002\n2017\n", "output": "2032\n"}, {"type": "stdin_stdout", "input": "4500\n-140", "output": "-4780\n"}, {"type": "stdin_stdout", "input": "4500\n-148", "output": "-4796\n"}, {"type": "stdin_stdout", "input": "4500\n-237", "output": "-4974\n"}, {"type": "stdin_stdout", "input": "200...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA frog is initially at position $0$ on the number line. The frog has two positive integers $a$ and $b$. From a position $k$, it can either jump to position $k+a$ or $k-b$.\n\nLet $f(x)$ be the number of distinct integers ...
[{"type": "stdin_stdout", "input": "997674659 11231 35496\n", "output": "497677363010575988\n"}, {"type": "stdin_stdout", "input": "881706694 5710 46369\n", "output": "388703347089502553\n"}, {"type": "stdin_stdout", "input": "952549276 31416 33000\n", "output": "1718466614644254\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant from the Zoo of Lviv currently is on the military mission. There are N enemy buildings placed in a row and numbered from left to right strating from 0. Each building i (except the first and the last) h...
[{"type": "stdin_stdout", "input": "3\n3\n011\n5\n10001\n7\n0000000", "output": "0\n1\n7\n"}, {"type": "stdin_stdout", "input": "3\n3\n010\n5\n10001\n7\n0010000", "output": "0\n1\n4\n"}, {"type": "stdin_stdout", "input": "3\n3\n010\n5\n10001\n7\n1010000", "output": "0\n1\n3\n"}, {"type": "stdin_stdout", "input": "3\n3\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDon Drumphet lives in a nice neighborhood, but one of his neighbors has started to let his house go. Don Drumphet wants to build a wall between his house and his neighbor’s, and is trying to get the neighborhood associat...
[{"input": "\"Melania\"", "output": "[[\"Melania\", \"Me\"]]", "fn_name": "who_is_paying"}, {"input": "\"Melissa\"", "output": "[[\"Melissa\", \"Me\"]]", "fn_name": "who_is_paying"}, {"input": "\"Mexico\"", "output": "[[\"Mexico\", \"Me\"]]", "fn_name": "who_is_paying"}, {"input": "\"Me\"", "output": "[[\"Me\"]]", "fn_...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence of $n$ pairs of integers: $(a_1, b_1), (a_2, b_2), \\dots , (a_n, b_n)$. This sequence is called bad if it is sorted in non-descending order by first elements or if it is sorted in non-descending ...
[{"type": "stdin_stdout", "input": "4\n2 3\n1 2\n2 1\n2 4\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "4\n2 3\n1 2\n2 1\n0 4\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "4\n3 3\n2 3\n2 1\n2 4\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\n2 3\n4 2\n2 1\n4 4\n", "output": "19\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSherlock and Watson are playing swapping game. Watson gives to Sherlock a string S on which he has performed K swaps. You need to help Sherlock in finding the original string. \nOne swap on a string is performed in this ...
[{"type": "stdin_stdout", "input": "1000000000\nrsiufeylcjcvvyaxuknaxpjmelvugtuymftujsimekkallagxngxgplmdjhkedlsifpuaajfmthxhkgiaogghtukedwkikfspvpsxbxlvhlfrsnshwbqqwcwcbhkondglvylwywuhjbbeqtnpxfhwjgymqjbeoirkhdijddqogrsxoiponylwgkmwvndkvwxgcipflivucqusakhpkunqfcndpsoopourwmakuvfypasplafvvuodwehpwxemmbglpivmfclucemphrl...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup ...
[{"type": "stdin_stdout", "input": "4\n-64322865 -60701256 -53458038 -42593211 -38971602 -31728384 -24485166 -17241948 -2755512 4487706 11730924 18974142 22595751 33460578 40703796 44325405\n", "output": "-39994920\n-60701256 -64322865 44325405 40703796\n-2755512 33460578 -53458038 -17241948\n18974142 -31728384 1173092...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour classmates asked you to copy some paperwork for them. You know that there are 'n' classmates and the paperwork has 'm' pages.\n\nYour task is to calculate how many blank pages do you need.\n\n### Example:\n```python\...
[{"input": "-5\n-5", "output": "[0]", "fn_name": "paperwork"}, {"input": "5\n5", "output": "[25]", "fn_name": "paperwork"}, {"input": "5\n-5", "output": "[0]", "fn_name": "paperwork"}, {"input": "-5\n5", "output": "[0]", "fn_name": "paperwork"}, {"input": "5\n0", "output": "[0]", "fn_name": "paperwork"}]
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nHow many licks does it take to get to the tootsie roll center of a tootsie pop?\n\nA group of engineering students from Purdue University reported that its licking machine, modeled after a human tongue, took an average of...
[{"input": "{\"dragons\": 100, \"evil wizards\": 110, \"trolls\": 50}", "output": "[\"It took 512 licks to get to the tootsie roll center of a tootsie pop. The toughest challenge was evil wizards.\"]", "fn_name": "total_licks"}, {"input": "{\"freezing temps\": 10, \"clear skies\": -2}", "output": "[\"It took 260 licks ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two bracket sequences (not necessarily regular) s and t consisting only of characters '(' and ')'. You want to construct the shortest regular bracket sequence that contains both given bracket sequences as su...
[{"type": "stdin_stdout", "input": "((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((\n))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several ...
[{"type": "stdin_stdout", "input": "hyyhddqhxhekehkwfhlnlsihzefwchzerevcjtokefplholrbvxlltdlafjxrfhleglrvlolojoqaolagtbeyogxlbgfolllslli\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "jhfbndhyzdvhbvhmhmefqllujdflwdpjbehedlsqfdsqlyelwjtyloxwsvasrbqosblzbowlqjmyeilcvotdlaouxhdpoeloaovb\n", "output": "YES\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp has decided to decorate his room because the New Year is soon. One of the main decorations that Polycarp will install is the garland he is going to solder himself.\n\nSimple garlands consisting of several lamps c...
[{"type": "stdin_stdout", "input": "100\n25 100 32 34 25 99 19 99 84 52 20 83 34 12 59 89 51 86 5 63 57 2 61 23 48 27 90 28 29 65 31 73 40 79 89 29 18 86 49 14 48 84 100 17 65 79 37 71 52 47 98 100 40 20 71 94 90 53 41 54 47 2 40 36 35 63 14 66 35 11 2 97 23 90 26 88 17 79 2 59 12 22 14 61 78 15 7 62 7 38 43 94 43 12 7...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\nWe will clos...
[{"type": "stdin_stdout", "input": "2 -777", "output": "1556\n"}, {"type": "stdin_stdout", "input": "2 -839", "output": "1680\n"}, {"type": "stdin_stdout", "input": "1 -839", "output": "1679\n"}, {"type": "stdin_stdout", "input": "100 100\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "181 21", "output": "139\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have two bottles for holding water.\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\nBottle 2 contains C milliliters of water.\nWe will transfer water from Bottle 2 to Bottl...
[{"type": "stdin_stdout", "input": "20 20 20\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "6 113 -1", "output": "106\n"}, {"type": "stdin_stdout", "input": "6 228 -1", "output": "221\n"}, {"type": "stdin_stdout", "input": "2 228 -1", "output": "225\n"}, {"type": "stdin_stdout", "input": "2 396 -1", "output"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVladik had started reading a complicated book about algorithms containing n pages. To improve understanding of what is written, his friends advised him to read pages in some order given by permutation P = [p_1, p_2, ..., ...
[{"type": "stdin_stdout", "input": "20 20\n18 17 2 3 16 15 1 9 12 8 20 11 13 14 4 5 19 7 10 6\n13 15 15\n1 1 1\n2 2 2\n11 14 11\n10 11 10\n2 8 6\n12 18 16\n4 8 8\n2 2 2\n5 11 11\n4 18 9\n5 6 6\n3 20 12\n8 8 8\n6 16 11\n9 18 18\n8 18 17\n1 1 1\n2 6 5\n1 4 3\n", "output": "No\nYes\nYes\nNo\nYes\nYes\nNo\nNo\nYes\nYes\nNo...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Objective\n\nGiven a number `n` we will define it's sXORe to be `0 XOR 1 XOR 2 ... XOR n` where `XOR` is the [bitwise XOR operator](https://en.wikipedia.org/wiki/Bitwise_operation#XOR).\n\nWrite a function that takes `...
[{"input": "9999999999999999999999999", "output": "[0]", "fn_name": "sxore"}, {"input": "1000000", "output": "[1000000]", "fn_name": "sxore"}, {"input": "1000001", "output": "[1]", "fn_name": "sxore"}, {"input": "50", "output": "[51]", "fn_name": "sxore"}, {"input": "0", "output": "[0]", "fn_name": "sxore"}, {"input": ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider a table of size $n \\times m$, initially fully white. Rows are numbered $1$ through $n$ from top to bottom, columns $1$ through $m$ from left to right. Some square inside the table with odd side length was painte...
[{"type": "stdin_stdout", "input": "96 1\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nW\nB\nW\nW\nW\nW\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFinish the solution so that it takes an input `n` (integer) and returns a string that is the decimal representation of the number grouped by commas after every 3 digits.\n\nAssume: `0 <= n < 2147483647`\n\n## Examples\n\n...
[{"input": "1234567890", "output": "[\"1,234,567,890\"]", "fn_name": "group_by_commas"}, {"input": "123456789", "output": "[\"123,456,789\"]", "fn_name": "group_by_commas"}, {"input": "12345678", "output": "[\"12,345,678\"]", "fn_name": "group_by_commas"}, {"input": "1234567", "output": "[\"1,234,567\"]", "fn_name": "g...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIvan is a student at Berland State University (BSU). There are n days in Berland week, and each of these days Ivan might have some classes at the university.\n\nThere are m working hours during each Berland day, and each ...
[{"type": "stdin_stdout", "input": "4 113 370\n01110100100010110100110000000011001111110000100111111001011001110111110111001011010110000110110010101010110001000\n01101001111110001010001100101100111100111001001001001101110101100110110110001110100010111011101011101110011110100\n0110011000100111101000001010110011110001111...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAfter the big birthday party, Katie still wanted Shiro to have some more fun. Later, she came up with a game called treasure hunt. Of course, she invited her best friends Kuro and Shiro to play with her.\n\nThe three frie...
[{"type": "stdin_stdout", "input": "727\nbaabbabbbababbbbaaaabaabbaabababaaababaaababbbbababbbbbbbbbbaaabaabbbbbbbbaaaabaabbaaabaabbabaa\nddcdcccccccdccdcdccdddcddcddcddddcdddcdcdccddcdddddccddcccdcdddcdcccdccccccdcdcdccccccdccccccdc\nfffeefeffeefeeeeffefffeeefffeefffefeefefeeeffefefefefefefffffffeeeeeffffeefeeeeffffee...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya is an administrator of a public page of organization \"Mouse and keyboard\" and his everyday duty is to publish news from the world of competitive programming. For each news he also creates a list of hashtags to mak...
[{"type": "stdin_stdout", "input": "2\n#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\n#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya once wrote a sad love song and shared it to Vasya. The song is a string consisting of lowercase English letters. Vasya made up $q$ questions about this song. Each question is about a subsegment of the song starting ...
[{"type": "stdin_stdout", "input": "13 7\nsonokhisumiwo\n1 5\n2 10\n7 10\n1 13\n1 8\n1 9\n3 6\n", "output": "74\n125\n62\n191\n110\n131\n48\n"}, {"type": "stdin_stdout", "input": "13 7\nowimusihkooos\n1 7\n2 10\n7 8\n2 13\n2 8\n2 4\n6 9\n", "output": "109\n128\n17\n177\n102\n45\n47\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer sequence of length N, a_1,a_2,...,a_N.\n\nFor each 1≀i≀N, you have three choices: add 1 to a_i, subtract 1 from a_i or do nothing.\n\nAfter these operations, you select an integer X and count the ...
[{"type": "stdin_stdout", "input": "10\n-1 1 2 3 2 8 6 7 14 4", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 1 5 8 2 8 4 20 0", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 1 5 8 4 8 4 20 0", "output": "3\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 1 5 8 4 8 4 17 0", "output": "3\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Berland capital is shaken with three bold crimes committed by the Pihsters, a notorious criminal gang.\n\nThe Berland capital's map is represented by an n Γ— m rectangular table. Each cell of the table on the map repre...
[{"type": "stdin_stdout", "input": "99 3\n**.\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n......
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinates x_1, x_2, ..., x_{n}. Vasya starts at the point with coordinate a. His goal is to visit at least n - 1 checkp...
[{"type": "stdin_stdout", "input": "97 -13\n-17 -11 -20 -16 -11 -18 -17 -14 -19 -13 -11 -19 -15 -17 -11 -20 -10 -19 -10 -18 -11 -14 -11 -15 -13 -13 -11 -18 -18 -18 -11 -14 -20 -19 -10 -17 -18 -19 -17 -11 -11 -11 -20 -19 -16 -15 -18 -15 -15 -20 -19 -20 -16 -13 -17 -11 -13 -18 -10 -13 -10 -14 -12 -17 -20 -10 -11 -19 -19 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below.\nGiven two integers x and y (1 ≀ x < y ≀ 12), determine whether they belong to the same group.\n\n-----...
[{"type": "stdin_stdout", "input": "12 12", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 3\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 12", "output": "Yes\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdot...
[{"type": "stdin_stdout", "input": "100 100\n100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKuro is living in a country called Uberland, consisting of $n$ towns, numbered from $1$ to $n$, and $n - 1$ bidirectional roads connecting these towns. It is possible to reach each town from any other. Each road connects ...
[{"type": "stdin_stdout", "input": "70 42 32\n25 50\n51 7\n39 61\n1 33\n20 5\n1 70\n1 63\n42 35\n64 16\n1 11\n39 42\n20 54\n11 14\n57 44\n1 59\n55 40\n25 3\n31 18\n38 68\n57 23\n39 57\n28 10\n39 20\n42 26\n58 6\n20 56\n57 2\n13 21\n15 69\n39 64\n1 39\n62 53\n39 13\n1 41\n22 12\n13 30\n68 67\n20 31\n51 15\n57 32\n59 34\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPaul is at the orchestra. The string section is arranged in an r Γ— c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes violas, so he would like to take a picture including ...
[{"type": "stdin_stdout", "input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"type": "stdin_stdout", "input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"type": "stdin_stdout", "input": "10 10 10 1\n1 10\n10 8\n7 4\n7 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nB: Nakajima, let's do that! --Match Peas War -\n\nproblem\n\nNakajima \"Uhh ...\"\n\nIsono \"Nakajima, are you okay?\"\n\nNakajima \"... I feel like I was having an unpleasant dream.\"\n\nIsono \"What kind of dream do you...
[{"type": "stdin_stdout", "input": "5 1\n2 3", "output": "NAKAJIMA\n"}, {"type": "stdin_stdout", "input": "3 1\n1 0", "output": "NAKAJIMA\n"}, {"type": "stdin_stdout", "input": "2 1\n1 2", "output": "NAKAJIMA\n"}, {"type": "stdin_stdout", "input": "3 2\n1 0", "output": "NAKAJIMA\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou will receive 3 points for solving this problem.\n\nManao is designing the genetic code for a new type of algae to efficiently produce fuel. Specifically, Manao is focusing on a stretch of DNA that encodes one protein....
[{"type": "stdin_stdout", "input": "CCCTTCACCCGGATCCAAATCCCTTAGAAATAATCCCCGACGGCGTTGTATCACCTCTGCACTTGTTAGTAAGGTCAGGCGTCCATTACGGAAGAACGTA\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "GCATTACATGGGGGGGTCCTACGAGCCCGGCATCCCGGAAACTAGCCGGTTAATTTGGTTTAAACCCTCCCACCCCGGATTGTAACCCCCCTCATTGGTT\n", "output": "17\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are a programmer on the development team for new recording media. This recording medium can be randomly accessed for reading and erasing data. On the other hand, when writing data, access is always performed in order ...
[{"type": "stdin_stdout", "input": "6\nW 0 2\nW 0 2\nD 0\nW 2 1\nR 3\nR 2\n1\nR 1000000000\n0", "output": "-1\n-1\n\n-1\n\n"}, {"type": "stdin_stdout", "input": "6\nW 0 3\nW 0 2\nD 0\nW 2 1\nR 4\nR 1\n1\nR 1000000000\n0", "output": "-1\n-1\n\n-1\n\n"}, {"type": "stdin_stdout", "input": "6\nW 0 2\nW 0 2\nD 0\nW 3 1\nR 3...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe number \"zero\" is called \"love\" (or \"l'oeuf\" to be precise, literally means \"egg\" in French), for example when denoting the zero score in a game of tennis. \n\nAki is fond of numbers, especially those with trai...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000\n", "output": "20833333333333332\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000\n", "output": "20833333333333332\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 470184984576\n", "output": "33333333333333332\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSome number of chocolate pieces were prepared for a training camp.\nThe camp had N participants and lasted for D days.\nThe i-th participant (1 \\leq i \\leq N) ate one chocolate piece on each of the following days in the...
[{"type": "stdin_stdout", "input": "5\n30 44\n26\n18\n81\n18\n6\n", "output": "56\n"}, {"type": "stdin_stdout", "input": "5\n30 44\n26\n18\n81\n18\n10", "output": "54\n"}, {"type": "stdin_stdout", "input": "5\n30 29\n26\n18\n81\n18\n10", "output": "39\n"}, {"type": "stdin_stdout", "input": "5\n30 29\n26\n18\n81\n18\n19...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA: Information Search\n\nproblem\n\nThe posting list is a list in which there is a correspondence between the search term and the appearing document ID. For example\n\n* Hokkaido: 1, 2, 4, 9\n* Sightseeing: 1, 3, 4, 7\n\n...
[{"type": "stdin_stdout", "input": "4 4\n0 2 10 11\n1 2 4 14", "output": "1 7\n2\n0\n1\n2\n4\n10\n11\n14\n"}, {"type": "stdin_stdout", "input": "4 4\n1 2 5 12\n2 3 4 13", "output": "1 7\n2\n1\n2\n3\n4\n5\n12\n13\n"}, {"type": "stdin_stdout", "input": "4 4\n1 2 4 12\n2 3 4 13", "output": "2 6\n2\n4\n1\n2\n3\n4\n12\n13\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTavas is a strange creature. Usually \"zzz\" comes out of people's mouth while sleeping, but string s of length n comes out from Tavas' mouth instead.\n\n<image>\n\nToday Tavas fell asleep in Malekas' place. While he was ...
[{"type": "stdin_stdout", "input": "173700 6\nbcabcbcbcbaaacaccaacaccaabacabaacbcacbbccaccbcacbabcaccccccaacacabbbbbacabbaaacbcbbaccaccabbbbaabbacacbabccaabcabbbcacaaccbabbcaaaaaabccbbcabcacbcbcabcbcbbaabacaaccccabacaaaccacaaabbacacabbcccacbaabcacacbbaaaccaccbaccccccbccaabcacaacabaccababacabcccbcbbacbabacbcbabacbbaccaa...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ monsters standing in a row numbered from $1$ to $n$. The $i$-th monster has $h_i$ health points (hp). You have your attack power equal to $a$ hp and your opponent has his attack power equal to $b$ hp.\n\nYou...
[{"type": "stdin_stdout", "input": "6 2 3 3\n7 10 50 12 1 8\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "6 2 3 2\n7 10 50 12 1 8\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 2 3 2\n5 10 50 12 1 8\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 2 2 2\n5 10 50 12 1 8\n", "output": "6\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDigits Are Not Just Characters\n\nMr. Manuel Majorana Minore made a number of files with numbers in their names. He wants to have a list of the files, but the file listing command commonly used lists them in an order diff...
[{"type": "stdin_stdout", "input": "2\nfile10\nfi2el0\nfile3", "output": "-\n-\n"}, {"type": "stdin_stdout", "input": "2\nfjle10\nfi2el0\niele3", "output": "-\n+\n"}, {"type": "stdin_stdout", "input": "2\n01eljf\nfi2el0\niele3", "output": "+\n+\n"}, {"type": "stdin_stdout", "input": "2\nflje10\nif3el0\n2elei", "output"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis is a harder version of the problem with bigger constraints.\n\nKorney Korneevich dag up an array a of length n. Korney Korneevich has recently read about the operation [bitwise XOR](https://en.wikipedia.org/wiki/Bitw...
[{"type": "stdin_stdout", "input": "100\n4845 2410 1317 394 2977 1455 2708 1271 2918 1866 4125 534 4055 1726 1819 790 2526 836 4853 4057 1995 3178 2972 3487 3259 4324 3807 895 2308 1513 3213 3480 1131 2807 1343 3231 1277 2683 1559 825 3667 102 1491 2066 4607 1645 3421 1475 3073 2945 3933 1157 378 3238 4123 2901 2840 48...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n```if-not:swift\nWrite simple .camelCase method (`camel_case` function in PHP, `CamelCase` in C# or `camelCase` in Java) for strings. All words must have their first letter capitalized without spaces.\n```\n```if:swift\nW...
[{"input": "\"camel case method\"", "output": "[\"CamelCaseMethod\"]", "fn_name": "camel_case"}, {"input": "\" camel case word\"", "output": "[\"CamelCaseWord\"]", "fn_name": "camel_case"}, {"input": "\"say hello \"", "output": "[\"SayHello\"]", "fn_name": "camel_case"}, {"input": "\"test case\"", "output": "[\"TestCas...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ ($n \\ge 3$) positive integers. It is known that in this array, all the numbers except one are the same (for example, in the array $[4, 11, 4, 4]$ all numbers except one are eq...
[{"type": "stdin_stdout", "input": "4\n4\n11 13 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\n", "output": "\n2\n1\n5\n3\n"}, {"type": "stdin_stdout", "input": "4\n4\n11 13 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\n", "output": "2\n1\n5\n3\n"}, {"type": "stdin_stdout", "input": "4\n4\n11...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFennec is fighting with N monsters.\nThe health of the i-th monster is H_i.\nFennec can do the following two actions:\n - Attack: Fennec chooses one monster. That monster's health will decrease by 1.\n - Special Move: Fen...
[{"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1000000000\n", "output": "3000000000\n"}, {"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1010000000", "output": "3010000000\n"}, {"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1110000000", "output": "3110000000\n"}, {"type": "s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMomiji has got a rooted tree, consisting of n nodes. The tree nodes are numbered by integers from 1 to n. The root has number 1. Momiji decided to play a game on this tree.\n\nThe game consists of several steps. On each s...
[{"type": "stdin_stdout", "input": "10\n1 2\n2 3\n3 4\n1 5\n2 6\n6 7\n4 8\n6 9\n9 10\n", "output": "3.81666666666666690000\n"}, {"type": "stdin_stdout", "input": "10\n1 2\n2 3\n3 4\n1 5\n2 6\n6 7\n7 8\n6 9\n9 10\n", "output": "3.8166666666666664\n"}, {"type": "stdin_stdout", "input": "10\n1 2\n2 3\n3 4\n1 5\n2 6\n8 7\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya is sitting on an extremely boring math class. To have fun, he took a piece of paper and wrote out n numbers on a single line. After that, Vasya began to write out different ways to put pluses (\"+\") in the line bet...
[{"type": "stdin_stdout", "input": "200 100\n56988719755815575893282254081467698462485803782142631369385180999746639622554559884281193367342283559238834106917388166048020056852911293394377949964185368886333934084399980368238188117302968424219707\n", "output": "295455656\n"}, {"type": "stdin_stdout", "input": "200 99\n9...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. \n\nUCDHP stores some s...
[{"type": "stdin_stdout", "input": "6 5 30\n536048 34640 572197 62457 304174\n194764 325606 270468 784237 551632\n10580 294606 63164 543647 531895\n430397 576813 678878 323394 603231\n534567 804015 403517 886087 981939\n518845 962097 609792 877955 88610\nc 1 5\nc 2 5\nc 2 5\nr 5 3\nc 5 2\nc 4 5\nr 6 5\nc 2 1\nr 3 4\nr ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet s be some string consisting of symbols \"0\" or \"1\". Let's call a string t a substring of string s, if there exists such number 1 ≀ l ≀ |s| - |t| + 1 that t = s_l s_{l+1} … s_{l + |t| - 1}. Let's call a substring t ...
[{"type": "stdin_stdout", "input": "99985 45273\n", "output": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLeonardo Fibonacci in a rare portrait of his younger days\n\nI assume you are all familiar with the famous Fibonacci sequence, having to get each number as the sum of the previous two (and typically starting with either `...
[{"input": "[3, 5, 2]\n[0, 1, 2]\n4", "output": "[17]", "fn_name": "custom_fib"}, {"input": "[7, 3, 4, 1]\n[1, 1]\n6", "output": "[2]", "fn_name": "custom_fib"}, {"input": "[1, 1]\n[0, 1]\n2", "output": "[2]", "fn_name": "custom_fib"}, {"input": "[1, 1]\n[0, 1]\n3", "output": "[3]", "fn_name": "custom_fib"}, {"input": ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\n\"QAQ\" is a word to denote an expression of crying. Imagine \"Q\" as eyes with tears and \"A\" as a mouth.\n\nNow Diamond has given Bort a string consisting of only uppercase English letters of length n. There is a great...
[{"type": "stdin_stdout", "input": "QCQAQAGAWAQQQAQAVQAQQQQAQAQQQAQAAATQAAVAAAQQQQAAAUUQAQQNQQWQQWAQAAQQKQYAQAAQQQAAQRAQQQWBQQQQAPBAQGQA\n", "output": "13174\n"}, {"type": "stdin_stdout", "input": "QQAQQAKQFAQLQAAWAMQAZQAJQAAQQOACQQAAAYANAQAQQAQAAQQAOBQQJQAQAQAQQQAAAAABQQQAVNZAQQQQAMQQAFAAEAQAQHQT\n", "output": "10420\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolandBall is a young, clever Ball. He is interested in prime numbers. He has stated a following hypothesis: \"There exists such a positive integer n that for each positive integer m number nΒ·m + 1 is a prime number\".\n\...
[{"type": "stdin_stdout", "input": "1447\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1127\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1722\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1332\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1261\n", "output": "1\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe nth triangular number is defined as the sum of the first n positive integers. The nth tetrahedral number is defined as the sum of the first n triangular numbers. It is easy to show that the nth tetrahedral number is e...
[{"type": "stdin_stdout", "input": "40\n14\n10\n55\n120\n199\n61\n150\n0", "output": "2 6\n2 14\n1 10\n2 21\n1 18\n4 29\n3 27\n3 14\n"}, {"type": "stdin_stdout", "input": "40\n14\n10\n55\n120\n269\n61\n150\n0", "output": "2 6\n2 14\n1 10\n2 21\n1 18\n3 31\n3 27\n3 14\n"}, {"type": "stdin_stdout", "input": "40\n14\n10\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVova is again playing some computer game, now an RPG. In the game Vova's character received a quest: to slay the fearsome monster called Modcrab.\n\nAfter two hours of playing the game Vova has tracked the monster and ana...
[{"type": "stdin_stdout", "input": "1 1 100\n100 99\n", "output": "9901\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nH...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n$n$ fishermen have just returned from a fishing vacation. The $i$-th fisherman has caught a fish of weight $a_i$.\n\nFishermen are going to show off the fish they caught to each other. To do so, they firstly choose an ord...
[{"type": "stdin_stdout", "input": "10\n319645572 758298525 812547177 459359946 355467212 304450522 807957797 916787906 239781206 242840396\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n319645572 758298525 812547177 459359946 355467212 304450522 807957797 916787906 239781206 242840396\n", "output": "0\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has $a$ coins, Barbara has $b$ coins and Cerene has $c$ coins. Recently Polycarp has returned from the trip around the wor...
[{"type": "stdin_stdout", "input": "5\n5 3 2 8\n100 101 102 105\n3 2 1 100000000\n10 20 15 14\n101 101 101 3\n", "output": "YES\nYES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n5 3 2 8\n100 101 102 105\n3 2 1 100000000\n23 20 15 14\n011 101 101 3\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are playing a computer game, where you lead a party of $m$ soldiers. Each soldier is characterised by his agility $a_i$.\n\nThe level you are trying to get through can be represented as a straight line segment from po...
[{"type": "stdin_stdout", "input": "53 1 27 3\n44 28 48 60 29 42 59 32 9 58 3 11 7 53 4 19 37 41 36 52 29 9 24 8 31 39 52 41 37 44 26 37 37 48 6 21 20 42 25 3 33 2 35 39 33 23 10 60 48 4 1 28 21\n1 1 11\n1 1 21\n1 1 3\n1 1 42\n1 1 16\n1 1 32\n1 1 52\n1 1 17\n1 1 39\n1 1 22\n1 1 31\n1 1 50\n1 1 23\n1 1 14\n1 1 41\n1 1 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ dormitories in Berland State University, they are numbered with integers from $1$ to $n$. Each dormitory consists of rooms, there are $a_i$ rooms in $i$-th dormitory. The rooms in $i$-th dormitory are number...
[{"type": "stdin_stdout", "input": "3 10\n1010000000 1000000000 1000000000\n330201655 567869543 1000000000 1000000001 1500000000 1999999999 2000000000 2000000001 2754432345 3000000000\n", "output": "1 330201655\n1 567869543\n1 1000000000\n1 1000000001\n2 490000000\n2 989999999\n2 990000000\n2 990000001\n3 744432345\n3 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis night wasn't easy on Vasya. His favorite team lost, and he didn't find himself victorious eitherΒ β€” although he played perfectly, his teammates let him down every time. He had to win at least one more time, but the lo...
[{"type": "stdin_stdout", "input": "987654320023456789\n", "output": "29340299842560\n"}, {"type": "stdin_stdout", "input": "987654321123456789\n", "output": "33007837322880\n"}, {"type": "stdin_stdout", "input": "987654321123456780\n", "output": "55657759288320\n"}, {"type": "stdin_stdout", "input": "23490681737975942...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis time around, Baby Ehab will play with permutations. He has $n$ cubes arranged in a row, with numbers from $1$ to $n$ written on them. He'll make exactly $j$ operations. In each operation, he'll pick up $2$ cubes and ...
[{"type": "stdin_stdout", "input": "2 200\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKenkoooo is planning a trip in Republic of Snuke. In this country, there are n cities and m trains running. The cities are numbered 1 through n, and the i-th train connects City u_i and v_i bidirectionally. Any city can b...
[{"type": "stdin_stdout", "input": "8 12 5 5\n2 8 685087149 1569714306\n6 1 298270585 209942236\n2 4 346080035 234079976\n1 5 131857300 40131411\n1 8 30723332 173476334\n2 6 447829832 706415811\n1 4 181424400 548830121\n4 4 30593148 195056405\n7 8 211146752 588024753\n1 6 127300821 203530153\n3 1 336869679 115858230\n4...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGhosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way.\n\nThere are $n$ ghosts in the universe, they move in the $OXY$ plane, each one of them has its own...
[{"type": "stdin_stdout", "input": "10 7 -626288749\n795312099 49439844 266151109\n-1357052512 23740808 624973405\n-513221420 -44452680 -391096559\n-350963348 -5068756 -160670209\n690883790 11897718 3356227\n-509035268 -76541374 -210137445\n-121282138 -32581578 230716703\n491731655 9500548 -13423963\n-665038289 4817024...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n\"Balloons should be captured efficiently\", the game designer says. He is designing an oldfashioned game with two dimensional graphics. In the game, balloons fall onto the ground one after another, and the player manipul...
[{"type": "stdin_stdout", "input": "2\n10 100\n100 270\n2\n12 100\n100 280\n3\n100 150\n10 360\n40 450\n3\n100 150\n17 360\n40 440\n2\n100 10\n50 200\n2\n100 100\n50 110\n1\n15 10\n4\n1 10\n2 20\n3 100\n90 200\n0", "output": "OK 220\nOK 200\nOK 260\nOK 246\nNG 1\nNG 2\nNG 1\nOK 188\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlica and Bob are playing a game.\n\nInitially they have a binary string $s$ consisting of only characters 0 and 1.\n\nAlice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice mak...
[{"type": "stdin_stdout", "input": "1\n111111111111111110000000000000000\n", "output": "NET\n"}, {"type": "stdin_stdout", "input": "1\n111111111111111110000000000000000\n", "output": "NET\n"}, {"type": "stdin_stdout", "input": "1\n111111111111101110000000000000000\n", "output": "NET\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIntroduction to Disjunctions\nIn logic and mathematics, a disjunction is an operation on 2 or more propositions. A disjunction is true if and only if 1 or more of its operands is true. In programming, we typically denot...
[{"input": "[false, true, true, true]\ntrue", "output": "[true]", "fn_name": "disjunction"}, {"input": "[true, true, true, true]\nfalse", "output": "[true]", "fn_name": "disjunction"}, {"input": "[false, true, false]\nfalse", "output": "[true]", "fn_name": "disjunction"}, {"input": "[false, true, true]\nfalse", "output...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nTo the west of the Australian continent is the wide Indian Ocean. Marine researcher JOI is studying the properties of N species of fish in the Indian Ocean.\n\nFor each type of fish, a rectangular parallelepipe...
[{"type": "stdin_stdout", "input": "3 2\n26 58 0 50 135 000\n10 24 20 127 126 60\n40 60 20 90 90 131", "output": "60000\n"}, {"type": "stdin_stdout", "input": "1 1\n20 50 -2 50 70 000\n10 102 11 39 90 40\n75 100 36 102 159 8", "output": "1200\n"}, {"type": "stdin_stdout", "input": "1 1\n20 50 -3 50 70 000\n10 102 11 39...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nToad Ivan has $m$ pairs of integers, each integer is between $1$ and $n$, inclusive. The pairs are $(a_1, b_1), (a_2, b_2), \\ldots, (a_m, b_m)$. \n\nHe asks you to check if there exist two integers $x$ and $y$ ($1 \\leq ...
[{"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 6\n2 7\n2 9\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 7\n2 7\n2 9\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 3\n2 7\n2 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its substrings.\n\nString ...
[{"type": "stdin_stdout", "input": "5\na\naba\nabacaba\nba\naba\n", "output": "YES\na\nba\naba\naba\nabacaba\n"}, {"type": "stdin_stdout", "input": "3\nqwerty\nqwerty\nqwerty\n", "output": "YES\nqwerty\nqwerty\nqwerty\n"}, {"type": "stdin_stdout", "input": "3\nqwerty\nqwerty\nqwerty\n", "output": "YES\nqwerty\nqwerty\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIt is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a special problem for the students to solve. You being his favourite student, put your heart into solving it one last t...
[{"type": "stdin_stdout", "input": "70 11 17929\n10313 427 268935 211 197219 148 357 179290 97 358580 475 343 175 221 286864 429 304793 179290 189 363 221 340651 376509 453 251006 141 304793 358580 235 107574 141 358580 167 181 101469 335 286864 171 107574 105 449 358580 286864 161 286864 349 89645 197219 395 358580 23...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMishka wants to buy some food in the nearby shop. Initially, he has $s$ burles on his card. \n\nMishka can perform the following operation any number of times (possibly, zero): choose some positive integer number $1 \\le ...
[{"type": "stdin_stdout", "input": "6\n1\n10\n19\n9876\n12345\n1000000000\n", "output": "1\n11\n21\n10973\n13716\n1111111111\n"}, {"type": "stdin_stdout", "input": "6\n1\n10\n33\n9876\n12345\n1000000000\n", "output": "1\n11\n36\n10973\n13716\n1111111111\n"}, {"type": "stdin_stdout", "input": "6\n1\n10\n24\n9876\n12345\...
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≀ l ≀ r ≀ n),...
[{"type": "stdin_stdout", "input": "65\n1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 16 19 20 21 22 23 44 25 26 35 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 104 59 60 61 62 63 64\n", "output": "15417.723076923077\n15417.723076923077\n15417.723076923077\n15417.7230769...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a lowercase Latin character (letter), check if it appears in the string ${codeforces}$.\n\n\n-----Input-----\n\nThe first line of the input contains an integer $t$ ($1 \\leq t \\leq 26$) β€” the number of test cases.\...
[{"type": "stdin_stdout", "input": "26\nq\na\nz\nw\ns\nx\ne\nd\nc\nr\nf\nv\nt\ng\nb\ny\nh\nn\nu\nj\nm\ni\nk\no\nl\np\n", "output": "NO\nNO\nNO\nNO\nYES\nNO\nYES\nYES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "10\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\n", "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Bitlandians are quite weird people. They have very peculiar customs.\n\nAs is customary, Uncle J. wants to have n eggs painted for Bitruz (an ancient Bitland festival). He has asked G. and A. to do the work.\n\nThe ki...
[{"type": "stdin_stdout", "input": "10\n2 658\n5 29\n2 558\n1 1275\n2 1177\n1 1033\n1 247\n-1 4605\n0 1170\n-1 999\n", "output": "AAAAAAAAAA\n"}, {"type": "stdin_stdout", "input": "10\n2 658\n5 66\n2 784\n1 1275\n2 1177\n1 999\n1 247\n-1 4605\n0 1170\n-1 999\n", "output": "AAAAAAAAAA\n"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n\nYour task is to write a function for calculating the score of a 10 pin bowling game. The input for the function is a list of pins knocked down per roll for one player. Output is the player's total score.\n\n# Ru...
[{"input": "[9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9]", "output": "[190]", "fn_name": "bowling_score"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 0]", "output": "[11]", "fn_name": "bowling_score"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Story\n\nDue to lack of maintenance the minute-hand has fallen off Town Hall clock face.\n\nAnd because the local council has lost most of our tax money to a Nigerian email scam there are no funds to fix the clock prope...
[{"input": "360", "output": "[\"12:00\"]", "fn_name": "what_time_is_it"}, {"input": "180", "output": "[\"06:00\"]", "fn_name": "what_time_is_it"}, {"input": "270", "output": "[\"09:00\"]", "fn_name": "what_time_is_it"}, {"input": "90", "output": "[\"03:00\"]", "fn_name": "what_time_is_it"}, {"input": "30", "output": "[...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a permutation $p_1, p_2, \\dots, p_n$. Recall that sequence of $n$ integers is called a permutation if it contains all integers from $1$ to $n$ exactly once.\n\nFind three indices $i$, $j$ and $k$ such that:...
[{"type": "stdin_stdout", "input": "3\n4\n2 1 4 3\n6\n4 12 1 2 5 3\n5\n5 7 1 2 4\n", "output": "YES\n2 3 4\nYES\n1 2 3\nYES\n1 2 3\n"}, {"type": "stdin_stdout", "input": "3\n4\n2 1 4 3\n6\n4 12 1 2 5 3\n5\n5 8 1 2 4\n", "output": "YES\n2 3 4\nYES\n1 2 3\nYES\n1 2 3\n"}, {"type": "stdin_stdout", "input": "3\n4\n2 1 4 3\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N balls placed in a row.\nAtCoDeer the deer is painting each of these in one of the K colors of his paint cans.\nFor aesthetic reasons, any two adjacent balls must be painted in different colors.\nFind the numbe...
[{"type": "stdin_stdout", "input": "-10 -2", "output": "1.1290058539e-05\n"}, {"type": "stdin_stdout", "input": "-3 -6", "output": "-0.00249895876718\n"}, {"type": "stdin_stdout", "input": "-3 -2", "output": "-0.0246913580247\n"}, {"type": "stdin_stdout", "input": "-5 9", "output": "3.43322753906e-05\n"}, {"type": "std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function that rearranges an integer into its largest possible value. \n\n```python\nsuper_size(123456) # 654321\nsuper_size(105) # 510\nsuper_size(12) # 21\n```\n``` haskell\nsuperSize 123456 `shouldBe` 654...
[{"input": "700000000001", "output": "[710000000000]", "fn_name": "super_size"}, {"input": "123456789", "output": "[987654321]", "fn_name": "super_size"}, {"input": "608719", "output": "[987610]", "fn_name": "super_size"}, {"input": "666666", "output": "[666666]", "fn_name": "super_size"}, {"input": "2017", "output": "...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nHint\n\n* One grid may be filled more than once\n* Even if it can be represented by one line segment such as '1', it may be represented by two or more line segments.\n\n\n\nSample Input 1\nFormula for Sample Input 1.\n\nS...
[{"type": "stdin_stdout", "input": "23\n1 1 3 1\n3 1 3 3\n3 3 1 3\n1 3 1 5\n1 5 3 5\n5 2 7 2\n7 2 7 4\n7 4 5 4\n5 4 5 6\n5 6 7 6\n11 4 13 4\n13 0 15 0\n15 0 15 4\n18 2 18 2\n21 5 23 5\n21 5 21 7\n21 7 23 7\n23 7 23 8\n23 9 21 9\n24 0 26 0\n24 0 24 4\n24 4 26 4\n26 0 26 4", "output": "-328\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N towers in the town where Ikta lives. Each tower is given a different number from 0 to N-1, and the tower with number i is called tower i. Curious Ikta was interested in the height of the N towers and decided t...
[{"type": "stdin_stdout", "input": "7\n0 1\n0 2\n2 3\n0 4\n0 5\n0 6", "output": "2071\n"}, {"type": "stdin_stdout", "input": "7\n0 1\n0 2\n1 3\n0 4\n1 5\n0 6", "output": "1303\n"}, {"type": "stdin_stdout", "input": "7\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6", "output": "4683\n"}, {"type": "stdin_stdout", "input": "7\n0 1\n0 2\n0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n$n$ students are taking an exam. The highest possible score at this exam is $m$. Let $a_{i}$ be the score of the $i$-th student. You have access to the school database which stores the results of all students.\n\nYou can ...
[{"type": "stdin_stdout", "input": "27\n1 1\n0\n1 2\n0\n1 5\n0\n1 10\n0\n1 50\n0\n1 100\n0\n1 500\n0\n1 1000\n0\n1 5000\n0\n1 10000\n0\n1 50000\n0\n1 100000\n0\n1 5\n4\n1 5\n5\n1 10\n9\n1 10\n10\n1 100000\n9999\n1 100000\n100000\n1 4999\n386\n1 100000\n1\n4 5\n1 0 0 0\n4 5\n0 1 0 0\n4 5\n0 0 0 0\n4 5\n5 5 5 5\n4 5\n4 4...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have an award-winning garden and everyday the plants need exactly 40mm of water. You created a great piece of JavaScript to calculate the amount of water your plants will need when you have taken into consideration th...
[{"input": "100", "output": "[\"Your plant has had more than enough water for today!\"]", "fn_name": "rain_amount"}, {"input": "40", "output": "[\"Your plant has had more than enough water for today!\"]", "fn_name": "rain_amount"}, {"input": "39", "output": "[\"You need to give your plant 1mm of water\"]", "fn_name": "...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have a string S of length N consisting of R, G, and B.\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n - S_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_...
[{"type": "stdin_stdout", "input": "4000\nGBRBRGGRRBRGBBGGRRGBRGGBRGGGBBGRGBRBRGGBGGGGRRGGBGGRGGGGRRGGRRGBBBGGRBGRRBBGGBRRBGGGGGBGGBGGRBBBGBGRGGRBGGRGRRRBRGBBBGGGRRBGRBBGGRGGRGRBGRRBGGRBRGGBBRGBRGRRGGRBGBRGBRGRRBGBRRBGRGBBGBRBGBBRBBGBBGBGGRBBRGRRGGRRBBBBRBBGBBGGRGRBBGGGBGGGGRRBBRGBBBBBRGGGBGGBBBRGRGRBGGGGBGBRGGBRGBRRRB...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIgor K. always used to trust his favorite Kashpirovsky Antivirus. That is why he didn't hesitate to download the link one of his groupmates sent him via QIP Infinium. The link was said to contain \"some real funny stuff a...
[{"type": "stdin_stdout", "input": "10110010010001110110110111100100011101101110010100100010110101011001011101111001\n1001000100\n1011001001\n0101100101\n0001110110\n1000101101\n0110110000\n0000010011\n1101111001\n1101010111\n1110010100\n", "output": "13739427\n"}, {"type": "stdin_stdout", "input": "0001010110111011010...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence a consisting of n integers. You may partition this sequence into two sequences b and c in such a way that every element belongs exactly to one of these sequences. \n\nLet B be the sum of elements ...
[{"type": "stdin_stdout", "input": "100\n-100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are n students living in the campus. Every morning all students wake up at the same time and go to wash. There are m rooms with wash basins. The i-th of these rooms contains ai wash basins. Every student independent...
[{"type": "stdin_stdout", "input": "50 50\n50 48 38 45 50 48 38 48 49 49 50 50 49 50 38 48 45 40 43 49 48 43 50 50 50 42 47 50 49 34 48 47 48 50 50 50 49 47 48 49 48 48 50 39 45 47 48 47 45 50\n", "output": "1.000000000000001\n"}, {"type": "stdin_stdout", "input": "50 50\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDo the following for a four-digit number N consisting of numbers 0-9.\n\n1. Let L be the number obtained as a result of arranging the numerical values ​​of each of the N digits in descending order.\n2. Let S be the number...
[{"type": "stdin_stdout", "input": "6174\n3985\n3333\n0000", "output": "0\n3\nNA\n"}, {"type": "stdin_stdout", "input": "6174\n1779\n3333\n0000", "output": "0\n6\nNA\n"}, {"type": "stdin_stdout", "input": "6174\n1794\n3333\n0000", "output": "0\n5\nNA\n"}, {"type": "stdin_stdout", "input": "6174\n1542\n3333\n0000", "out...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGena loves sequences of numbers. Recently, he has discovered a new type of sequences which he called an almost arithmetical progression. A sequence is an almost arithmetical progression, if its elements can be represented...
[{"type": "stdin_stdout", "input": "73\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 131 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe T9 typing predictor helps with suggestions for possible word combinations on an old-style numeric keypad phone. Each digit in the keypad (2-9) represents a group of 3-4 letters. To type a letter, press once the key wh...
[{"input": "[\"gone\", \"hood\", \"good\", \"old\"]\n\"4663\"", "output": "[[\"gone\", \"hood\", \"good\"]]", "fn_name": "T9"}, {"input": "[\"goNe\", \"hood\", \"GOOD\", \"old\"]\n\"4663\"", "output": "[[\"goNe\", \"hood\", \"GOOD\"]]", "fn_name": "T9"}, {"input": "[\"good\", \"home\", \"new\"]\n\"4663\"", "output": "[...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIlya is working for the company that constructs robots. Ilya writes programs for entertainment robots, and his current project is \"Bob\", a new-generation game robot. Ilya's boss wants to know his progress so far. Especi...
[{"type": "stdin_stdout", "input": "129341234876124184 1 2\n1 3 3\n1 1 2\n1 2 3\n3 1 1\n3 1 3\n3 2 3\n", "output": "64670617438062091 64670617438062093\n"}, {"type": "stdin_stdout", "input": "129341234876124184 1 2\n1 3 3\n1 1 2\n1 2 3\n3 1 1\n3 1 3\n3 2 3\n", "output": "64670617438062091 64670617438062093\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe map of Bertown can be represented as a set of n intersections, numbered from 1 to n and connected by m one-way roads. It is possible to move along the roads from any intersection to any other intersection. The length ...
[{"type": "stdin_stdout", "input": "20 50\n20 3\n5 16\n1 3\n10 11\n10 15\n15 9\n20 9\n14 6\n16 5\n13 4\n11 5\n3 20\n13 17\n11 8\n11 6\n12 14\n16 18\n17 13\n18 7\n3 1\n8 10\n17 15\n7 2\n9 13\n5 11\n6 1\n2 16\n8 18\n10 8\n4 13\n9 15\n14 12\n1 6\n9 20\n7 18\n6 14\n7 6\n18 16\n2 7\n3 11\n15 17\n3 12\n14 10\n4 14\n19 4\n11 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation o...
[{"type": "stdin_stdout", "input": "10000000000\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "9999999967\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "53937807463", "output": "10\n"}, {"type": "stdin_stdout", "input": "9876543210\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "6983776800...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the International System of Units (SI), various physical quantities are expressed in the form of \"numerical value + prefix + unit\" using prefixes such as kilo, mega, and giga. For example, \"3.5 kilometers\", \"5.1 m...
[{"type": "stdin_stdout", "input": "7\n12.729479136172973 kilo metfrt\n0.45 mega sttaw\n0.000000000000000000000001 yotta mrags\n1000000000000000000000000 yocto seconds\n42 amperes\n0.951642419825234 joulfs\n1234.56789012345678901234567890 hecto pascals", "output": "1.2729479136172973 * 10^4 metfrt\n4.5 * 10^5 sttaw\n1 ...
code_stdio