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 elections to Berland parliament are happening today. Voting is in full swing!\n\nTotally there are n candidates, they are numbered from 1 to n. Based on election results k (1 ≤ k ≤ n) top candidates will take seats in...
[{"type": "stdin_stdout", "input": "100 100 100 100\n71 22 92 3 19 90 1 16 88 56 62 37 56 84 52 46 4 64 21 19 37 54 21 81 56 33 71 57 86 75 62 42 79 67 14 8 66 30 13 38 20 71 36 66 46 55 4 99 18 37 7 24 72 46 32 86 87 7 90 93 96 94 21 23 62 53 16 11 11 83 21 81 68 50 85 9 94 60 47 41 34 82 11 12 95 81 61 81 86 85 64 36...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Mishka is a great traveller and she visited many countries. After thinking about where to travel this time, she chose XXX — beautiful, but little-known northern country.\n\nHere are some interesting facts about XXX...
[{"type": "stdin_stdout", "input": "76 24\n6814 3834 1131 6256 2598 850 7353 1702 5773 1699 35 5103 1368 2258 7891 7455 8546 7316 7428 8864 6536 5750 8455 2624 7326 2197 8239 3806 3016 7126 85 3249 1138 6783 9684 4417 7417 3660 6334 7324 9760 9755 7605 9891 3676 8784 8739 8266 3272 9250 5875 939 4130 6540 7813 6867 914...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n<image>\n\n\nThis figure shows railway tracks for reshuffling cars. The rail tracks end in the bottom and the top-left rail track is used for the entrace and the top-right rail track is used for the exit. Ten cars, which ...
[{"type": "stdin_stdout", "input": "1\n6\n-1\n13\n10\n0\n0\n0", "output": "10\n13\n-1\n"}, {"type": "stdin_stdout", "input": "1\n20\n0\n20\n11\n0\n0\n1", "output": "20\n11\n20\n"}, {"type": "stdin_stdout", "input": "1\n38\n0\n20\n11\n0\n0\n1", "output": "38\n11\n20\n"}, {"type": "stdin_stdout", "input": "1\n10\n0\n20\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n2^k teams participate in a playoff tournament. The tournament consists of 2^k - 1 games. They are held as follows: first of all, the teams are split into pairs: team 1 plays against team 2, team 3 plays against team 4 (ex...
[{"type": "stdin_stdout", "input": "3\n0110?11\n6\n5 1\n6 ?\n7 ?\n1 ?\n5 ?\n1 1\n", "output": "\n1\n2\n3\n3\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n0110?11\n6\n5 1\n6 ?\n7 ?\n2 ?\n5 ?\n1 1\n", "output": "1\n2\n3\n4\n5\n5\n"}, {"type": "stdin_stdout", "input": "3\n0110?11\n6\n5 1\n6 ?\n6 ?\n1 ?\n5 ?\n1 1\n", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven an integer, if the length of it's digits is a perfect square, return a square block of sqroot(length) * sqroot(length). If not, simply return \"Not a perfect square!\".\n\nExamples:\n\n1212 returns:\n\n>1212 \n\nNo...
[{"input": "11137980416513326753900366614118127597534595333758924261793440915871873756952319756649737238032191522372673120386100703535104754039588400552740678721535237244611848291138569327958593044675614468557005002330545247507161735907754581937618290513118338573433800934507948491646900563507252698934433726005748974840...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nAs Sherlock Holmes was investigating a crime, he identified n suspects. He knows for sure that exactly one of them committed the crime. To find out which one did it, the detective lines up the suspects and numbered them f...
[{"type": "stdin_stdout", "input": "64 28\n+54\n+44\n+55\n-3\n+33\n-54\n-54\n-7\n+33\n+54\n+54\n+26\n-54\n+14\n-54\n-47\n+25\n-54\n-54\n-54\n-52\n+54\n+54\n+54\n+54\n+20\n+7\n+54\n+4\n+32\n+46\n-54\n-47\n+15\n+32\n-54\n+7\n+62\n-16\n-54\n+3\n+54\n+54\n+54\n+54\n-54\n+54\n-54\n+54\n-52\n+27\n-7\n+54\n-5\n-54\n-18\n+1\n+...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a book with n chapters.\n\nEach chapter has a specified list of other chapters that need to be understood in order to understand this chapter. To understand a chapter, you must read it after you understand e...
[{"type": "stdin_stdout", "input": "5\n4\n1 2\n0\n2 1 4\n1 3\n5\n1 5\n1 1\n1 1\n1 1\n1 4\n5\n0\n0\n2 1 2\n1 2\n2 2 1\n4\n2 2 3\n0\n0\n2 3 2\n5\n1 2\n1 3\n1 4\n1 3\n0\n", "output": "-1\n-1\n1\n2\n-1\n"}, {"type": "stdin_stdout", "input": "5\n4\n1 2\n0\n2 1 4\n1 2\n5\n1 5\n1 1\n1 1\n1 1\n1 4\n5\n0\n0\n2 1 2\n1 2\n2 2 1\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a function $f$ written in some basic language. The function accepts an integer value, which is immediately written into some variable $x$. $x$ is an integer variable and can be assigned values from $0$ to $2...
[{"type": "stdin_stdout", "input": "83\nadd\nfor 58\nend\nadd\nadd\nfor 36\nfor 84\nadd\nadd\nfor 86\nadd\nadd\nend\nend\nadd\nadd\nadd\nadd\nfor 23\nadd\nadd\nadd\nfor 70\nadd\nadd\nend\nfor 24\nfor 58\nend\nadd\nend\nend\nend\nfor 41\nfor 51\nend\nfor 22\nfor 39\nend\nfor 94\nfor 47\nadd\nfor 57\nend\nadd\nend\nfor 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRecently Petya walked in the forest and found a magic stick.\n\nSince Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a posit...
[{"type": "stdin_stdout", "input": "7\n2 3\n1 1\n3 6\n6 8\n1 2\n4 1\n31235 6578234\n", "output": "YES\nYES\nNO\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "7\n4 3\n1 1\n3 6\n6 8\n1 2\n4 1\n31235 6578234\n", "output": "Yes\nYes\nNo\nYes\nNo\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "7\n2 3\n1 1\n3 6...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAs you know, Bob's brother lives in Flatland. In Flatland there are n cities, connected by n - 1 two-way roads. The cities are numbered from 1 to n. You can get from one city to another moving along the roads.\n\nThe «Two...
[{"type": "stdin_stdout", "input": "50\n7 34\n5 34\n5 11\n11 23\n42 5\n41 11\n12 41\n41 49\n1 49\n12 6\n7 15\n17 42\n20 6\n17 46\n20 19\n46 22\n49 40\n44 40\n43 46\n22 8\n17 29\n44 18\n31 18\n46 9\n7 16\n32 11\n13 41\n20 36\n34 25\n46 28\n39 34\n30 42\n11 47\n45 15\n37 17\n4 23\n35 17\n17 48\n2 17\n34 24\n1 10\n21 5\n2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya works as a watchman in the gallery. Unfortunately, one of the most expensive paintings was stolen while he was on duty. He doesn't want to be fired, so he has to quickly restore the painting. He remembers some facts...
[{"type": "stdin_stdout", "input": "100000 100000 100000 100000 100000\n", "output": "10000000000\n"}, {"type": "stdin_stdout", "input": "100000 100000 100000 100000 100000\n", "output": "10000000000"}, {"type": "stdin_stdout", "input": "100000 83958 32567 91083 110780\n", "output": "1466200000\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Fix the Bugs (Syntax) - My First Kata\n\n## Overview\n\nHello, this is my first Kata so forgive me if it is of poor quality.\n\nIn this Kata you should fix/create a program that ```return```s the following values:\n\n -...
[{"input": "\"hello\"\n{}", "output": "[false]", "fn_name": "my_first_kata"}, {"input": "[]\n\"pippi\"", "output": "[false]", "fn_name": "my_first_kata"}, {"input": "\"hello\"\n3", "output": "[false]", "fn_name": "my_first_kata"}, {"input": "true\ntrue", "output": "[false]", "fn_name": "my_first_kata"}, {"input": "67\n...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThree-valued logic is a logic system that has, in addition to \"true\" and \"false\", \"unknown\" as a valid value. In the following, logical values \"false\", \"unknown\" and \"true\" are represented by 0, 1 and 2 respec...
[{"type": "stdin_stdout", "input": "(Q*P)\n(--R+(Q*R))\n(P+-Q)\n2\n-1\n(-1+(((---P+Q)*(--Q+---R))+(-R+-P)))\n.", "output": "3\n9\n15\n27\n0\n19\n"}, {"type": "stdin_stdout", "input": "(P*Q)\n(--R+(P*Q))\n(P*-P)\n2\n2\n(-1+(((---P+Q)*(--Q+---R))*(-R+-P)))\n.", "output": "3\n11\n0\n27\n27\n7\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains 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": "1000000000 1000000000\n", "output": "1022"}, {"type": "stdin_stdout", "input": "852355975 1000000000\n", "output": "1022\n"}, {"type": "stdin_stdout", "input": "444747744 1000000000\n", "output": "554"}, {"type": "stdin_stdout", "input": "70407598 1000000000\n", "output": "382\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle walrus Fangy loves math very much. That's why when he is bored he plays with a number performing some operations.\n\nFangy takes some positive integer x and wants to get a number one from it. While x is not equal t...
[{"type": "stdin_stdout", "input": "1000101100110000000001111010110000000010001001111110011011000011101011001001010010111\n", "output": "133\n"}, {"type": "stdin_stdout", "input": "1000101100100000000001111010110000000010001001111110011011000011101011001001010010111\n", "output": "134\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an inte...
[{"type": "stdin_stdout", "input": "50 47\n21 17 47 15 50 47 47 41 28 18 27 47 29 28 32 26 16 26 8 22 27 10 45 21 17 30 31 38 14 8 9 40 29 35 41 24 22 14 40 46 44 34 40 31 48 40 8 50 1 28\n10 5\n34 2\n42 5\n36 28\n8 44\n36 3\n40 15\n33 18\n5 50\n1 6\n25 20\n39 24\n45 35\n14 27\n14 39\n17 47\n19 49\n28 10\n7 13\n34 3\n2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRecently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a × b squares, and each square is colored white or black. There are integers to the left of the rows and to th...
[{"type": "stdin_stdout", "input": "100\nWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWB\n", "output": "50\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "}, {"type": "stdin_stdout", "input": "100\nWBWBWBWBWBWBWBW...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given positive integers A and B.\nIf A is a divisor of B, print A + B; otherwise, print B - A.\n\n-----Constraints-----\n - All values in input are integers.\n - 1 \\leq A \\leq B \\leq 20\n\n-----Input-----\nInpu...
[{"type": "stdin_stdout", "input": "10 111", "output": "101\n"}, {"type": "stdin_stdout", "input": "110 40", "output": "-70\n"}, {"type": "stdin_stdout", "input": "111 40", "output": "-71\n"}, {"type": "stdin_stdout", "input": "111 62", "output": "-49\n"}, {"type": "stdin_stdout", "input": "111 68", "output": "-43\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWilliam is a huge fan of planning ahead. That is why he starts his morning routine by creating a nested list of upcoming errands.\n\nA valid nested list is any list which can be created from a list with one item \"1\" by ...
[{"type": "stdin_stdout", "input": "10\n4\n1\n1\n1\n1\n4\n1\n1\n1\n2\n4\n1\n1\n1\n1\n4\n1\n1\n2\n2\n4\n1\n1\n2\n3\n4\n1\n1\n1\n1\n4\n1\n2\n1\n2\n4\n1\n2\n1\n1\n4\n1\n2\n3\n1\n4\n1\n2\n3\n1\n", "output": "1\n1.1\n1.1.1\n1.1.1.1\n1\n1.1\n1.1.1\n1.1.2\n1\n1.1\n1.1.1\n1.1.1.1\n1\n1.1\n1.2\n2\n1\n1.1\n1.2\n1.3\n1\n1.1\n1.1....
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven an Array and an Example-Array to sort to, write a function that sorts the Array following the Example-Array.\n\nAssume Example Array catalogs all elements possibly seen in the input Array. However, the input Array d...
[{"input": "[\"a\", \"a\", \"b\", \"f\", \"d\", \"a\"]\n[\"c\", \"a\", \"d\", \"b\", \"e\", \"f\"]", "output": "[[\"a\", \"a\", \"a\", \"d\", \"b\", \"f\"]]", "fn_name": "example_sort"}, {"input": "[1, 2, 3, 3, 3, 5]\n[3, 4, 5, 6, 9, 11, 12, 13, 1, 7, 8, 2, 10]", "output": "[[3, 3, 3, 5, 1, 2]]", "fn_name": "example_so...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nPositive integer $x$ is called divisor of positive integer $y$, if $y$ is divisible by $x$ without remainder. For example, $1$ is a divisor of $7$ and $3$ is not divisor of $8$.\n\nWe gave you an integer $d$ and asked you...
[{"type": "stdin_stdout", "input": "2\n14\n100\n", "output": "527\n21311\n"}, {"type": "stdin_stdout", "input": "2\n14\n110\n", "output": "527\n25199\n"}, {"type": "stdin_stdout", "input": "2\n14\n111\n", "output": "527\n25651\n"}, {"type": "stdin_stdout", "input": "2\n60\n25\n", "output": "7747\n1711\n"}, {"type": "st...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor the New Year, Polycarp decided to send postcards to all his $n$ friends. He wants to make postcards with his own hands. For this purpose, he has a sheet of paper of size $w \\times h$, which can be cut into pieces.\n\...
[{"type": "stdin_stdout", "input": "16\n8192 8192 67108864\n8192 8192 67108865\n8192 8192 70000000\n8192 8192 67108863\n1 1 1\n13 13 1\n1000 1000 100\n100 15 16\n157 185 95\n1992 1895 12\n1888 4984 164\n1564 8917 15\n150 15 2\n1500 10 40\n1 10000 1000\n1 10000 10000\n", "output": "YES\nNO\nNO\nYES\nYES\nYES\nNO\nNO\nNO...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of the...
[{"type": "stdin_stdout", "input": "1495 932", "output": "1388490\n"}, {"type": "stdin_stdout", "input": "582 1592", "output": "922200\n"}, {"type": "stdin_stdout", "input": "1018 932", "output": "944880\n"}, {"type": "stdin_stdout", "input": "1018 374", "output": "377952\n"}, {"type": "stdin_stdout", "input": "314 169...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nProblem\n\n\"Ritsumeikan University Competitive Programming Camp\" will be held this year as well. I am very much looking forward to this annual training camp. However, I couldn't stand my desires and splurged before the ...
[{"type": "stdin_stdout", "input": "1234 5 4 789012345678901234 5 6", "output": "1357101234567708000\n"}, {"type": "stdin_stdout", "input": "2017 4 2 789012345678901234 5 6", "output": "1357101234567706652\n"}, {"type": "stdin_stdout", "input": "2684 2 6 699116447311015755 5 1", "output": "1202480289374942482\n"}, {"ty...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Vlad is fond of popular computer game Bota-2. Recently, the developers announced the new add-on named Bota-3. Of course, Vlad immediately bought only to find out his computer is too old for the new game and needs t...
[{"type": "stdin_stdout", "input": "100\n955 479 355 759 257 497 690 598 275 446 439 787 257 326 584 713 322 5 253 781 434 307 164 154 241 381 38 942 771 906 240 11 431 478 628 1892 346 74 493 964 455 1105 950 41 585 549 892 687 264 41 487 676 63 453 861 980 620 844 80 907 285 506 772 748 773 743 44 925 529 685 845 313...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGregor is learning about RSA cryptography, and although he doesn't understand how RSA works, he is now fascinated with prime numbers and factoring them.\n\nGregor's favorite prime number is $P$. Gregor wants to find two b...
[{"type": "stdin_stdout", "input": "5\n5\n11\n11\n13\n19\n", "output": "2 4\n2 10\n2 10\n2 12\n2 18\n"}, {"type": "stdin_stdout", "input": "5\n5\n7\n11\n13\n19\n", "output": "2 4\n2 6\n2 10\n2 12\n2 18\n"}, {"type": "stdin_stdout", "input": "5\n5\n7\n11\n13\n19\n", "output": "2 4\n2 6\n2 10\n2 12\n2 18\n"}, {"type": "s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBleatrix Trotter the sheep has devised a strategy that helps her fall asleep faster. First, she picks a number N. Then she starts naming N, 2 × N, 3 × N, and so on.\nWhenever she names a number, she thinks about all of th...
[{"input": "1250000", "output": "[90000000]", "fn_name": "trotter"}, {"input": "459923", "output": "[4139307]", "fn_name": "trotter"}, {"input": "691520", "output": "[2074560]", "fn_name": "trotter"}, {"input": "163444", "output": "[653776]", "fn_name": "trotter"}, {"input": "206929", "output": "[620787]", "fn_name": "...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet's define a split of $n$ as a nonincreasing sequence of positive integers, the sum of which is $n$. \n\nFor example, the following sequences are splits of $8$: $[4, 4]$, $[3, 3, 2]$, $[2, 2, 1, 1, 1, 1]$, $[5, 2, 1]$.\...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "1223796969\n", "output": "611898485\n"}, {"type": "stdin_stdout", "input": "1074371686\n", "output": "537185844\n"}, {"type": "stdin...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn this Kata, you will be given two numbers, n and k and your task will be to return the k-digit array that sums to n and has the maximum possible GCD.\n\nFor example, given `n = 12, k = 3`, there are a number of possible...
[{"input": "276\n12", "output": "[[3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 78]]", "fn_name": "solve"}, {"input": "24\n6", "output": "[[1, 2, 3, 4, 5, 9]]", "fn_name": "solve"}, {"input": "24\n5", "output": "[[1, 2, 3, 4, 14]]", "fn_name": "solve"}, {"input": "18\n5", "output": "[[1, 2, 3, 4, 8]]", "fn_name": "solve"},...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have two indistinguishable pieces placed on a number line. Both pieces are initially at coordinate 0. (They can occupy the same position.)\n\nWe can do the following two kinds of operations:\n\n* Choose a piece and mov...
[{"type": "stdin_stdout", "input": "1010000 100000 200000", "output": "489638142\n"}, {"type": "stdin_stdout", "input": "1010000 100001 200000", "output": "645079609\n"}, {"type": "stdin_stdout", "input": "1011000 100001 200000", "output": "150445035\n"}, {"type": "stdin_stdout", "input": "1011001 100001 200000", "outp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRecently Anton found a box with digits in his room. There are k_2 digits 2, k_3 digits 3, k_5 digits 5 and k_6 digits 6.\n\nAnton's favorite integers are 32 and 256. He decided to compose this integers from digits he has....
[{"type": "stdin_stdout", "input": "5000000 5000000 5000000 5000000\n", "output": "1280000000\n"}, {"type": "stdin_stdout", "input": "4759823 3520376 4743363 4743363\n", "output": "1214827648\n"}, {"type": "stdin_stdout", "input": "4759823 3520376 4743363 4743363\n", "output": "1214827648\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters.\n\nThere is a filler wor...
[{"type": "stdin_stdout", "input": "100\nggogogoooggogooggoggogggggogoogoggooooggooggoooggogoooggoggoogggoogoggogggoooggoggoggogggogoogggoooo\n", "output": "gg***oogg***oggoggoggggg******ggooooggooggooogg***ooggoggoogggo***ggogggoooggoggoggoggg***ogggoooo\n"}, {"type": "stdin_stdout", "input": "100\nggogogoooggogooggog...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, ..., N from west to east.\nA company called AtCoder Express possesses M trains, and the train i runs from City L_i to City R_i (...
[{"type": "stdin_stdout", "input": "10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n", "output": "7\n9\n10\n6\n8\n9\n6\n7\n8\n10\n"}, {"type": "stdin_stdout", "input": "10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nInternational Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. ...
[{"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'000000\nIAO'0000000\nIAO'00000000\nIAO'000000000\n", "output": "1990\n2000\n3000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n"}, {"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'00...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAndrew skipped lessons on the subject 'Algorithms and Data Structures' for the entire term. When he came to the final test, the teacher decided to give him a difficult task as a punishment.\n\nThe teacher gave Andrew an a...
[{"type": "stdin_stdout", "input": "100\n0 1 1 1 0 0 0 2 1 2 2 1 2 2 2 0 0 2 1 2 0 1 1 0 2 0 1 2 2 0 2 0 1 0 1 2 0 2 1 1 0 1 0 1 0 0 0 2 2 2 2 1 1 1 0 2 1 0 0 0 0 0 1 0 2 -1 1 0 0 2 0 2 2 1 0 2 2 0 2 0 2 1 2 1 1 1 0 2 1 0 2 1 1 2 1 2 0 1 2 2\n", "output": "36 30 38 35 35 33 34 31 28 22 22 23 19 16 19 20 22 23 24 25 25 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSnuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j).\n\nThere is a lowercase...
[{"type": "stdin_stdout", "input": "5\nabcde\nfghij\nklmno\npqrst\nuvvxy", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nabcde\nfghij\nonmlk\npqrst\nuvwxy", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nedcba\nfghij\nonmlk\npqrst\nuvwxy", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nedcba...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a card game called \"Durak\", which means \"Fool\" in Russian. The game is quite popular in the countries that used to form USSR. The problem does not state all the game's rules explicitly — you can find them lat...
[{"type": "stdin_stdout", "input": "D\n9S 8S\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "H\nTH 8H\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "H\nAH KH\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "H\nAD KD\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "H\nAC QC\n",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program to check whether a triangle is valid or not, when the three angles of the triangle are the inputs. A triangle is valid if the sum of all the three angles is equal to 180 degrees.\n\n-----Input-----\n\nThe ...
[{"type": "stdin_stdout", "input": "3 \n40 40 100\n45 45 90\n180 1 1\n\n", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3 \n30 40 110\n45 45 90\n180 0 0", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3 \n30 40 110\n12 45 90\n180 0 0", "output": "YES\nNO\nNO\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBoboniu likes bit operations. He wants to play a game with you.\n\nBoboniu gives you two sequences of non-negative integers $a_1,a_2,\\ldots,a_n$ and $b_1,b_2,\\ldots,b_m$.\n\nFor each $i$ ($1\\le i\\le n$), you're asked ...
[{"type": "stdin_stdout", "input": "30 55\n194 478 207 22 344 507 374 462 107 506 317 299 326 308 459 396 330 317 138 342 126 473 423 180 41 165 435 72 53 71\n44 229 106 350 420 462 412 115 452 364 452 294 280 171 325 250 94 266 33 329 197 384 50 36 495 464 67 283 83 3 335 62 101 307 474 296 484 388 315 444 203 304 110...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\n-----Constraints-----\n - 1\\leq A\\leq B\\leq 10^{18}\n - 1\\leq C,D\\...
[{"type": "stdin_stdout", "input": "123456789987654321 987654321123456789 999999999 1000000000\n", "output": "864197529407407405\n"}, {"type": "stdin_stdout", "input": "314159265358979323 846264338327950288 419716939 937510582\n", "output": "532105071133627368\n"}, {"type": "stdin_stdout", "input": "827191816666888190 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThor is getting used to the Earth. As a gift Loki gave him a smartphone. There are n applications on this phone. Thor is fascinated by this phone. He has only one minor issue: he can't count the number of unread notificat...
[{"type": "stdin_stdout", "input": "10 85\n2 2\n1 10\n1 1\n2 6\n1 2\n1 4\n1 7\n2 1\n1 1\n3 3\n1 9\n1 6\n1 8\n1 10\n1 8\n2 8\n1 6\n1 3\n1 9\n1 6\n1 3\n1 8\n1 1\n1 6\n1 10\n2 1\n2 10\n1 10\n1 1\n1 10\n1 6\n1 2\n1 8\n1 3\n1 4\n1 9\n1 5\n1 5\n2 2\n2 4\n1 7\n1 1\n2 4\n1 9\n2 1\n1 7\n1 8\n3 33\n1 10\n2 2\n1 3\n1 10\n1 6\n3 3...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBerland State University has received a new update for the operating system. Initially it is installed only on the $1$-st computer.\n\nUpdate files should be copied to all $n$ computers. The computers are not connected to...
[{"type": "stdin_stdout", "input": "13\n576460752303423486 576460752303423486\n576460752303423487 576460752303423487\n576460752303423488 576460752303423488\n576460752303423489 576460752303423489\n576460752303423490 576460752303423490\n576460752303423488 288230376151711743\n576460752303423488 288230376151711744\n5764607...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two arrays $a$ and $b$ of positive integers, with length $n$ and $m$ respectively. \n\nLet $c$ be an $n \\times m$ matrix, where $c_{i,j} = a_i \\cdot b_j$. \n\nYou need to find a subrectangle of the matrix ...
[{"type": "stdin_stdout", "input": "235 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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\nThe stardate is 1977 and the science and art of detecting Death Stars is in its infancy. Princess Heidi has received information about the stars in the nearby solar system from the Rebel spies and now, to help her identif...
[{"type": "stdin_stdout", "input": "10\nXXXOOOOXOX\nOOOXXXOXXO\nXOXXXXOOXX\nXOOOXXOXOO\nOOXOOOOOOX\nXXXXOXOOOO\nXXXOOXOXOX\nOOOOXOXOXX\nXOXXOXOOXO\nOOOOOXOOOO\nXXXOOOOXOX\nOOOXXXOXXO\nXOXXXXOOXX\nXOOOXXOXOO\nOOXOOOOOOX\nXXXXOXOOOO\nXXXOOXOXOX\nOOOOXOXOXX\nXOXXOXOOXO\nOOOOOXOOOO\n", "output": "Yes\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.\n\nToday Vasya got bored and decided to take a walk in the yard. Vasya lives in e...
[{"type": "stdin_stdout", "input": "100 37 -100\n", "output": "37\n"}, {"type": "stdin_stdout", "input": "100 37 -100\n", "output": "37\n"}, {"type": "stdin_stdout", "input": "100 37 -124\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "145 38 106\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "100 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGordon Ramsay shouts. He shouts and swears. There may be something wrong with him.\n\nAnyway, you will be given a string of four words. Your job is to turn them in to Gordon language. \n\nRules:\n\nObviously the words sho...
[{"input": "\"What feck damn cake\"", "output": "[\"WH@T!!!! F*CK!!!! D@MN!!!! C@K*!!!!\"]", "fn_name": "gordon"}, {"input": "\"dont you talk tome\"", "output": "[\"D*NT!!!! Y**!!!! T@LK!!!! T*M*!!!!\"]", "fn_name": "gordon"}, {"input": "\"how dare you feck\"", "output": "[\"H*W!!!! D@R*!!!! Y**!!!! F*CK!!!!\"]", "fn_n...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nConvert a hash into an array. Nothing more, Nothing less.\n\n```\n{name: 'Jeremy', age: 24, role: 'Software Engineer'}\n```\nshould be converted into\n\n```\n[[\"name\", \"Jeremy\"], [\"age\", 24], [\"role\", \"Software E...
[{"input": "{\"name\": \"Jeremy\", \"age\": 24, \"role\": \"Software Engineer\"}", "output": "[[[\"age\", 24], [\"name\", \"Jeremy\"], [\"role\", \"Software Engineer\"]]]", "fn_name": "convert_hash_to_array"}, {"input": "{\"product\": \"CodeWars\", \"power_level_over\": 9000}", "output": "[[[\"power_level_over\", 9000]...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIf we write out the digits of \"60\" as English words we get \"sixzero\"; the number of letters in \"sixzero\" is seven. The number of letters in \"seven\" is five. The number of letters in \"five\" is four. The number of...
[{"input": "999", "output": "[[\"nineninenine\", \"onetwo\", \"six\", \"three\", \"five\", \"four\"]]", "fn_name": "numbers_of_letters"}, {"input": "311", "output": "[[\"threeoneone\", \"oneone\", \"six\", \"three\", \"five\", \"four\"]]", "fn_name": "numbers_of_letters"}, {"input": "37", "output": "[[\"threeseven\", \...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given N non-negative integers A_1, A_2, ..., A_N and another non-negative integer K.\nFor a integer X between 0 and K (inclusive), let f(X) = (X XOR A_1) + (X XOR A_2) + ... + (X XOR A_N).\nHere, for non-negative ...
[{"type": "stdin_stdout", "input": "1 0\n1000000000000\n", "output": "1000000000000\n"}, {"type": "stdin_stdout", "input": "4 9\n7 4 0 3\n", "output": "46\n"}, {"type": "stdin_stdout", "input": "3 7\n1 6 3\n", "output": "14\n"}]
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems: the Power Gem of purple color, the Time Gem of green color, the Space Gem of blue color, the Soul Gem of ora...
[{"type": "stdin_stdout", "input": "4\ngreen\nyellow\norange\npurple\n", "output": "2\nReality\nSpace\n"}, {"type": "stdin_stdout", "input": "4\ngreen\nyellow\norange\npurple\n", "output": "2\nSpace\nReality\n"}, {"type": "stdin_stdout", "input": "4\ngreen\nyellow\norange\npurple\n", "output": "2\nSpace\nReality\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOn the competitive programming platform CodeCook, every person has a rating graph described by an array of integers $a$ of length $n$. You are now updating the infrastructure, so you've created a program to compress these...
[{"type": "stdin_stdout", "input": "5\n5\n1 5 3 4 2\n4\n1 3 2 1\n5\n1 3 3 3 1\n10\n1 2 3 4 5 10 7 8 9 10\n3\n3 3 2\n", "output": "10111\n0001\n00001\n0000011111\n000\n"}, {"type": "stdin_stdout", "input": "5\n5\n2 5 3 4 2\n4\n1 3 2 1\n5\n1 3 3 3 2\n10\n1 1 1 4 10 6 2 8 9 10\n3\n3 3 2\n", "output": "00000\n0001\n00111\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nATMs of a well-known bank of a small country are arranged so that they can not give any amount of money requested by the user. Due to the limited size of the bill dispenser (the device that is directly giving money from a...
[{"type": "stdin_stdout", "input": "58 5\n1 6 9 18 34 41 82 99 164 179 183 204 240 396 636 1224 2023 2856 4488 4705 5712 9180 9266 18360 18850 20270 23086 60810 190701 197064 211140 214200 222970 243240 263510 314442 425670 486480 708288 789888 1009800 1025349 1054040 1094580 1325184 1579776 1748076 2050698 2635100 289...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIs it rated?\n\nHere it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.\n\nAnother Codeforces round has been conducted. No two participants have the same nu...
[{"type": "stdin_stdout", "input": "10\n4078 4078\n2876 2876\n1061 1061\n3721 3721\n143 143\n2992 2992\n3279 3279\n3389 3389\n1702 1702\n1110 1110\n", "output": "unrated\n"}, {"type": "stdin_stdout", "input": "10\n4078 4078\n2876 2876\n1061 1061\n3721 3721\n143 143\n2992 2992\n3279 3279\n3389 3389\n1702 1702\n1110 1110...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn geometry, a cube is a three-dimensional solid object bounded by six square faces, facets or sides, with three meeting at each vertex.The cube is the only regular hexahedron and is one of the five Platonic solids. It ha...
[{"input": "99", "output": "[false]", "fn_name": "you_are_a_cube"}, {"input": "27", "output": "[true]", "fn_name": "you_are_a_cube"}, {"input": "2", "output": "[false]", "fn_name": "you_are_a_cube"}, {"input": "64", "output": "[true]", "fn_name": "you_are_a_cube"}, {"input": "1", "output": "[true]", "fn_name": "you_are...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nMikhail walks on a Cartesian plane. He starts at the point $(0, 0)$, and in one move he can go to any of eight adjacent points. For example, if Mikhail is currently at the point $(0, 0)$, he can go to any of the following...
[{"type": "stdin_stdout", "input": "3\n7 0 0\n3 1 0\n22 0 2\n", "output": "-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "3\n1 1 1\n9 -1 5\n35 0 1\n", "output": "1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "3\n2 2 3\n6 2 18\n10 0 1\n", "output": "1\n18\n-1\n"}, {"type": "stdin_stdout", "input": "3\n1 0 1\n9 -1...
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 \\leq l \\leq |s| - |t| + 1$ that $t = s_l s_{l+1} \\ldots s_{l + |t| - 1}$. L...
[{"type": "stdin_stdout", "input": "99985 45273\n", "output": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are creating a level for a video game. The level consists of $n$ rooms placed in a circle. The rooms are numbered $1$ through $n$. Each room contains exactly one exit: completing the $j$-th room allows you to go the $...
[{"type": "stdin_stdout", "input": "50\n499 1400 1621 123 72 526 944 482 862 136 265 605 5 616 974 967 713 187 969 467 573 845 71 224 17 873 648 120 239 1722 438 574 404 129 899 583 632 314 525 496 443 857 241 78 575 2 430 137 387 911\n", "output": "459200194 19968654 978281891 778632355 119790684 519088159 339403985 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAyoub thinks that he is a very smart person, so he created a function $f(s)$, where $s$ is a binary string (a string which contains only symbols \"0\" and \"1\"). The function $f(s)$ is equal to the number of substrings i...
[{"type": "stdin_stdout", "input": "5\n6 4\n5 2\n3 2\n2 1\n10 2\n", "output": "19\n12\n5\n2\n40\n"}, {"type": "stdin_stdout", "input": "5\n6 4\n5 2\n4 2\n2 1\n10 2\n", "output": "19\n12\n8\n2\n40\n"}, {"type": "stdin_stdout", "input": "5\n6 1\n0 0\n5 0\n16 1\n8 1\n", "output": "12\n0\n0\n72\n20\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA and B are preparing themselves for programming contests.\n\nTo train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is now stronger.\n\nFor eac...
[{"type": "stdin_stdout", "input": "...QK...\n........\n........\n........\n........\n........\n........\n...rk...\n", "output": "White\n"}, {"type": "stdin_stdout", "input": "rppppppr\n...k....\n........\n........\n........\n........\nK...Q...\n........\n", "output": "Black\n"}, {"type": "stdin_stdout", "input": ".......
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have a permutation of the integers from 1 through N, p_1, p_2, .., p_N. We also have M pairs of two integers between 1 and N (inclusive), represented as (x_1,y_1), (x_2,y_2), .., (x_M,y_M). AtCoDeer the deer is going t...
[{"type": "stdin_stdout", "input": "10 8\n10 3 6 8 7 10 9 1 2 4\n2 1\n4 1\n5 9\n4 2\n6 2\n3 5\n8 9\n7 9", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 8\n10 3 6 8 7 10 9 1 2 4\n2 1\n3 1\n5 9\n4 2\n6 2\n3 5\n8 9\n7 9", "output": "7\n"}, {"type": "stdin_stdout", "input": "10 8\n10 3 6 8 7 10 9 1 2 4\n2 1\n4 1\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTheater stage is a rectangular field of size n × m. The director gave you the stage's plan which actors will follow. For each cell it is stated in the plan if there would be an actor in this cell or not.\n\nYou are to pla...
[{"type": "stdin_stdout", "input": "10 20\n0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 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\nYou and your $n - 1$ friends have found an array of integers $a_1, a_2, \\dots, a_n$. You have decided to share it in the following way: All $n$ of you stand in a line in a particular order. Each minute, the person at the...
[{"type": "stdin_stdout", "input": "4\n6 3 2\n4 16 1 3 8 5\n4 4 1\n2 13 60 4\n4 2 3\n1 -1 2 2\n2 2 0\n2 2\n", "output": "16\n4\n2\n2\n"}, {"type": "stdin_stdout", "input": "4\n6 3 2\n2 9 2 3 10 5\n4 4 1\n2 13 60 4\n4 2 3\n1 2 2 1\n2 2 0\n1 2\n", "output": "10\n4\n2\n1\n"}, {"type": "stdin_stdout", "input": "4\n6 3 2\n2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider an infinite sequence a_1, a_2, … Initially, the values of all the terms are 0, and from this state we will sequentially perform Q operations. The i-th operation (1 ≤ i ≤ Q) is as follows:\n\n* For every positive ...
[{"type": "stdin_stdout", "input": "5\n56 114834\n72 -134386\n100 190757\n192 -132693\n240 133108", "output": "438699\n"}, {"type": "stdin_stdout", "input": "5\n56 114834\n72 -134386\n100 190757\n192 -132693\n240 261716", "output": "567307\n"}, {"type": "stdin_stdout", "input": "5\n92 114834\n125 -176641\n100 13125\n19...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe store sells $n$ items, the price of the $i$-th item is $p_i$. The store's management is going to hold a promotion: if a customer purchases at least $x$ items, $y$ cheapest of them are free.\n\nThe management has not y...
[{"type": "stdin_stdout", "input": "13 3\n5 3 1 5 2 5 3 1 5 2 5 3 1\n3 2\n1 1\n5 3\n", "output": "10\n5\n15\n"}, {"type": "stdin_stdout", "input": "5 3\n100 200 300 400 500\n2 1\n1 1\n3 2\n", "output": "400\n500\n700\n"}, {"type": "stdin_stdout", "input": "5 3\n100 200 300 400 500\n1 1\n3 2\n2 2\n", "output": "500\n700...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlena has successfully passed the entrance exams to the university and is now looking forward to start studying.\n\nOne two-hour lesson at the Russian university is traditionally called a pair, it lasts for two academic h...
[{"type": "stdin_stdout", "input": "100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven is an integer sequence A_1, ..., A_N of length N.\nWe will choose exactly \\left\\lfloor \\frac{N}{2} \\right\\rfloor elements from this sequence so that no two adjacent elements are chosen.\nFind the maximum possib...
[{"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "5000000000\n"}, {"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 0000000000 1000000000 1000000000 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are n cities numbered from 1 to n in Berland. Some of them are connected by two-way roads. Each road has its own length — an integer number from 1 to 1000. It is known that from each city it is possible to get to an...
[{"type": "stdin_stdout", "input": "5\n0 954 1255 266 751\n954 0 1677 688 1173\n1255 1677 0 989 504\n266 688 989 0 485\n751 1173 504 485 0\n5\n5 2 1509\n3 4 692\n3 5 756\n3 1 151\n2 5 262\n", "output": "8742 7851 7851 6398 5111 "}, {"type": "stdin_stdout", "input": "5\n0 954 1255 266 751\n954 0 1677 688 1173\n1255 1677...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEmuskald is an avid horticulturist and owns the world's longest greenhouse — it is effectively infinite in length.\n\nOver the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbere...
[{"type": "stdin_stdout", "input": "20 15\n7 8720.017100830131\n2 13067.215819731118\n8 58623.690996\n9 184322.3412850205\n6 227999.61123331118\n2 279836.330518\n9 282807.34217112145\n2 311057.23684687156\n1 312315.562927\n5 459200.373445\n14 563454.265947\n11 647366.9355815595\n13 679761.613732\n4 684192.647497\n3 733...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nLittle Egor is a huge movie fan. He likes watching different kinds of movies: from drama movies to comedy movies, from teen movies to horro...
[{"type": "stdin_stdout", "input": "2\n2\n2 2\n3 2\n3\n-1 1 4 1\n1 4 1 4", "output": "1\n2\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 2\n3 2\n3\n-1 1 2 1\n1 4 1 4", "output": "1\n2\n"}, {"type": "stdin_stdout", "input": "2\n2\n1 2\n2 1\n4\n1 2 1 1\n2 10 1 3", "output": "1\n2\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYukiya, the owner of Aizuyama Ski Resort, has prepared a course for advanced skiers with obstacles and jumping hills. There are various ways to slide on the course, and users who can slide in all patterns during the seaso...
[{"type": "stdin_stdout", "input": "5 5\n0 0 0 0 1\n2 1 0 2 0\n1 0 0 1 1\n0 2 1 2 0\n0 1 -1 0 0\n5 5\n0 0 1 0 0\n2 1 0 2 0\n1 0 0 0 1\n0 2 1 2 0\n0 1 0 0 0\n15 15\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDr. Hedro is astonished. According to his theory, we can make sludge that can dissolve almost everything on the earth. Now he's trying to produce the sludge to verify his theory.\n\nThe sludge is produced in a rectangular...
[{"type": "stdin_stdout", "input": "2\n14\n0", "output": "24\n328\n"}, {"type": "stdin_stdout", "input": "2\n12\n0", "output": "24\n264\n"}, {"type": "stdin_stdout", "input": "2\n10\n0", "output": "24\n216\n"}, {"type": "stdin_stdout", "input": "2\n18\n0", "output": "24\n440\n"}, {"type": "stdin_stdout", "input": "2\n2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKamil likes streaming the competitive programming videos. His MeTube channel has recently reached $100$ million subscribers. In order to celebrate this, he posted a video with an interesting problem he couldn't solve yet....
[{"type": "stdin_stdout", "input": "32\n402528994560 0 0 0 0 0 0 932646223872 893192888700 0 813583026900 0 0 0 0 143521875000 0 177570054144 186624000000 0 517655600000 202145625000 341007975000 0 116252718750 0 148561875000 0 304819200000 248474688000 0 103125000000\n29 25\n20 24\n8 21\n23 3\n32 14\n29 30\n31 24\n28 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAnastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in ...
[{"type": "stdin_stdout", "input": "9 13\n132 166 200 62 168 51 185 192 118\n", "output": "51\n"}, {"type": "stdin_stdout", "input": "9 13\n132 166 200 62 168 58 185 192 118\n", "output": "52\n"}, {"type": "stdin_stdout", "input": "9 13\n132 166 200 62 168 58 106 192 118\n", "output": "49\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N blocks arranged in a row. Let us paint these blocks.\nWe will consider two ways to paint the blocks different if and only if there is a block painted in different colors in those two ways.\nFind the number of ...
[{"type": "stdin_stdout", "input": "200000 200000 199999\n", "output": "703273590\n"}, {"type": "stdin_stdout", "input": "178720 187658 129518\n", "output": "963607179\n"}, {"type": "stdin_stdout", "input": "189770 199455 133747\n", "output": "971381227\n"}, {"type": "stdin_stdout", "input": "189992 49130 122242\n", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya plays a computer game with ninjas. At this stage Vasya's ninja should get out of a deep canyon.\n\nThe canyon consists of two vertical parallel walls, their height is n meters. Let's imagine that we split these wall...
[{"type": "stdin_stdout", "input": "101 1\n----------------------------------------------------------------------------------------------------X\n----------------------------------------------------------------------------------------------------X\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "100 10\n-X----...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp is a beginner programmer. He is studying how to use a command line.\n\nPolycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single de...
[{"type": "stdin_stdout", "input": "2 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac\n1\n", "output": "Yes\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nShe was worried. The grades are not good. Although she forced her parents to enroll in a dormitory school, her talent never blossomed. Or maybe he didn't have the talent in the first place, but it was possible that he did...
[{"type": "stdin_stdout", "input": "(B&B&f)|(~d&~i&i)|(~v&i&~V)|(&g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i~~V)|(~v&f&~d)\n(S&X&~W)\n#", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "(B&B&f)|(~d&~i&i)|(~v&i&~V)|(&g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i~~V)|(~v&f&~d)\n(T&X&~W)\n#", "out...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S of length 3 consisting of a, b and c. Determine if S can be obtained by permuting abc.\n\n-----Constraints-----\n - |S|=3\n - S consists of a, b and c.\n\n-----Input-----\nInput is given from Stan...
[{"type": "stdin_stdout", "input": "bac\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "abc\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "bab\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "aaa\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "cab", "output": "Yes\n"}, {"type":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nStatistics claims that students sleep no more than three hours a day. But even in the world of their dreams, while they are snoring peacefully, the sense of impending doom is still upon them.\n\nA poor student is dreaming...
[{"type": "stdin_stdout", "input": "100 100\n50 50\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "82 60\n100 38\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 100\n36 50\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "82 60\n100 64\n", "output": "YES\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKate and Michael want to buy a pizza and share it. Depending on the price of the pizza, they are going to divide the costs:\n\n* If the pizza is less than €5,- Michael invites Kate, so Michael pays the full price.\n* Othe...
[{"input": "28.789", "output": "[19.19]", "fn_name": "michael_pays"}, {"input": "5.9181", "output": "[3.95]", "fn_name": "michael_pays"}, {"input": "4.325", "output": "[4.33]", "fn_name": "michael_pays"}, {"input": "4.99", "output": "[4.99]", "fn_name": "michael_pays"}, {"input": "22", "output": "[14.67]", "fn_name": "...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a rectangular field of n × m cells. Each cell is either empty or impassable (contains an obstacle). Empty cells are marked with '.', impassable cells are marked with '*'. Let's call two empty cells adjacent ...
[{"type": "stdin_stdout", "input": "10 10\n*.*...*.**\n..*...*.**\n.**.***...\n....*.*.**\n***....***\n.*..*...*.\n.***.*..*.\n.*****.*.*\n*.***.*...\n..*..*....\n", "output": "9.9...5.71\n..9...5.77\n.99.997...\n....9.5.77\n299....513\n.2..0...1.\n.490.0..9.\n.71120.7.1\n7.434.8...\n..6..2....\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nInput\n\nThe only line of input contains three integers a1, a2, a3 (1 ≤ a1, a2, a3 ≤ 20), separated by spaces.\n\nOutput\n\nOutput a single integer.\n\nExamples\n\nInput\n\n2 3 2\n\n\nOutput\n\n5\n\n\nInput\n\n13 14 1\n\n...
[{"type": "stdin_stdout", "input": "20 20 20\n", "output": "218920\n"}, {"type": "stdin_stdout", "input": "1 19 20\n", "output": "132716\n"}, {"type": "stdin_stdout", "input": "10 11 15\n", "output": "10480\n"}, {"type": "stdin_stdout", "input": "10 11 12\n", "output": "2474\n"}, {"type": "stdin_stdout", "input": "12 9...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ consecutive seat places in a railway carriage. Each place is either empty or occupied by a passenger.\n\nThe university team for the Olympiad consists of $a$ student-programmers and $b$ student-athletes. Det...
[{"type": "stdin_stdout", "input": "64 59 2\n.*.***......****.*..**..**..****.*.*.*.**...**..***.***.*..*..*.\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "64 59 2\n.*.***......****.*..**..**..****.*.*.*.**...**..***.***.*..*..*.\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "64 59 3\n.*.***........
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSuppose you have a special $x$-$y$-counter. This counter can store some value as a decimal number; at first, the counter has value $0$. \n\nThe counter performs the following algorithm: it prints its lowest digit and, aft...
[{"type": "stdin_stdout", "input": "01985222473\n", "output": "-1 35 -1 33 -1 -1 -1 31 -1 29 \n35 53 24 17 20 17 18 15 13 13 \n-1 24 -1 18 -1 18 -1 19 -1 14 \n33 17 18 51 14 19 23 13 21 15 \n-1 20 -1 14 -1 21 -1 22 -1 22 \n-1 17 18 19 21 -1 17 17 20 19 \n-1 18 -1 23 -1 17 -1 12 -1 17 \n31 15 19 13 22 17 12 49 16 15 \n-...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day, people model a dragon with bamboo strips and clothes, raise them with rods, and hold the rods high and low to resemble a flying dragon.\n\nA performer...
[{"type": "stdin_stdout", "input": "200\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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\nYou've got string s, consisting of only lowercase English letters. Find its lexicographically maximum subsequence.\n\nWe'll call a non-empty string s[p1p2... pk] = sp1sp2... spk(1 ≤ p1 < p2 < ... < pk ≤ |s|) a subsequence...
[{"type": "stdin_stdout", "input": "zyxzxzwyxywxxwabcdabdacdbcacdbcacabaaba\n", "output": "zzzyyxxwddddccbba\n"}, {"type": "stdin_stdout", "input": "zyxzxzwyxybxxwabcdawdacdccacdbcacabaaba\n", "output": "zzzyyxxwwdddccbba\n"}, {"type": "stdin_stdout", "input": "thankstosamarasauteddybearsforthiscontest\n", "output": "y...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA string $s$ of length $n$ ($1 \\le n \\le 26$) is called alphabetical if it can be obtained using the following algorithm:\n\nfirst, write an empty string to $s$ (i.e. perform the assignment $s$ := \"\");\n\nthen perform...
[{"type": "stdin_stdout", "input": "11\na\nba\nab\nbac\nihfcbadeg\nz\naa\nca\nacb\nxyz\nddcba\n", "output": "YES\nYES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "11\na\nba\nab\ncac\nihfcbadeg\nz\nab\nca\nbca\nxyz\nddcba\n", "output": "YES\nYES\nYES\nNO\nYES\nNO\nYES\nNO\nNO\nNO\nNO\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function \n```javascript \ntripledouble(num1,num2)\n```\n```python\ntriple_double(num1, num2)\n```\nwhich takes numbers `num1` and `num2` and returns `1` if there is a straight triple of a number at any place in `...
[{"input": "451999277\n41177722899", "output": "[1]", "fn_name": "triple_double"}, {"input": "666789\n12345667", "output": "[1]", "fn_name": "triple_double"}, {"input": "1222345\n12345", "output": "[0]", "fn_name": "triple_double"}, {"input": "10560002\n100", "output": "[1]", "fn_name": "triple_double"}, {"input": "123...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are many anime that are about \"love triangles\": Alice loves Bob, and Charlie loves Bob as well, but Alice hates Charlie. You are thinking about an anime which has n characters. The characters are labeled from 1 to...
[{"type": "stdin_stdout", "input": "28567 13\n28079 24675 1\n18409 26720 1\n980 10815 1\n20794 16571 1\n7376 19861 1\n11146 706 1\n4255 16391 1\n27376 18263 1\n10019 28444 1\n6574 28053 1\n5036 16610 1\n3543 7122 1\n512 9554 1\n", "output": " 928433852\n"}, {"type":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nInternational Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. ...
[{"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'000000\nIAO'0000000\nIAO'00000000\nIAO'000000000\n", "output": "1990\n2000\n3000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n"}, {"type": "stdin_stdout", "input": "5\nIAO'15\nIAO'2015\nIAO'1\nIAO'9\nIAO'0\n", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nI have a sequence defined as follows:\n\n* All even-numbered terms are equal to the previous term multiplied by 2.\n* All odd-numbered terms are equal to the previous term divided by 3.\n\n\n\nCreate a program that reads ...
[{"type": "stdin_stdout", "input": "12.245545640480573\n11.553343685171598\n20.008357034777177", "output": "95.6966714867\n90.2872413915\n156.361604975\n"}, {"type": "stdin_stdout", "input": "12.245545640480573\n13.018962096503808\n20.008357034777177", "output": "95.6966714867\n101.740777865\n156.361604975\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKolya loves putting gnomes at the circle table and giving them coins, and Tanya loves studying triplets of gnomes, sitting in the vertexes of an equilateral triangle.\n\nMore formally, there are 3n gnomes sitting in a cir...
[{"type": "stdin_stdout", "input": "100000\n", "output": "192156836"}, {"type": "stdin_stdout", "input": "100000\n", "output": "192156836"}, {"type": "stdin_stdout", "input": "100000\n", "output": "192156836"}, {"type": "stdin_stdout", "input": "10701\n", "output": "198227529\n"}, {"type": "stdin_stdout", "input": "100...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a problemset consisting of $n$ problems. The difficulty of the $i$-th problem is $a_i$. It is guaranteed that all difficulties are distinct and are given in the increasing order.\n\nYou have to assemble the ...
[{"type": "stdin_stdout", "input": "9\n4 6 9 12 100 150 200 400 800\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n4 6 9 12 100 150 200 400 800\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n4 6 9 12 100 150 200 400 612\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n4 2 9 12 100 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOne company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department ...
[{"type": "stdin_stdout", "input": "700\n", "output": "16017044425409540\n"}, {"type": "stdin_stdout", "input": "776\n", "output": "33019955679376860\n"}, {"type": "stdin_stdout", "input": "666\n", "output": "11292070960994226\n"}, {"type": "stdin_stdout", "input": "777\n", "output": "33319741730082870\n"}, {"type": "s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer $n$ and an integer $k$.\n\nIn one step you can do one of the following moves: decrease $n$ by $1$; divide $n$ by $k$ if $n$ is divisible by $k$. \n\nFor example, if $n = 27$ and $k = 3$ you can...
[{"type": "stdin_stdout", "input": "93\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLong is a huge fan of CFC (Codeforces Fried Chicken). But the price of CFC is increasing, so he decides to breed the chicken on his own farm.\n\nHis farm is presented by a rectangle grid with r rows and c columns. Some of...
[{"type": "stdin_stdout", "input": "4\n3 5 3\n..R..\n...R.\n....R\n6 4 6\nR..R\nRR..\nRRRR\nRRRR\nR..R\nR..R\n5 5 12\nRRR..\nR.R..\nRRR..\nRR...\nR...R\n2 31 62\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n", "output": "aaabb\ncccbb\nccccc\naaaa\nbaaa\nbbcc\ndddc\neeee\nffff\nabcdd\needdd\nfghii\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below. Index `0` will be considered even.\n\nFor example, `capitalize(\"abcdef\") = ['AbCdEf', 'aBcDeF']`. Se...
[{"input": "\"codingisafunactivity\"", "output": "[[\"CoDiNgIsAfUnAcTiViTy\", \"cOdInGiSaFuNaCtIvItY\"]]", "fn_name": "capitalize"}, {"input": "\"indexinglessons\"", "output": "[[\"InDeXiNgLeSsOnS\", \"iNdExInGlEsSoNs\"]]", "fn_name": "capitalize"}, {"input": "\"codewarriors\"", "output": "[[\"CoDeWaRrIoRs\", \"cOdEwAr...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nDr. Sato, a botanist, invented a number of special fertilizers for seedlings. When you give the fertilizer to the seedlings, the size of the seedlings changes in a blink of an eye. However, it was found that fertilizer ha...
[{"type": "stdin_stdout", "input": "3 3\n1.8036677694351575 3.7376015310643522 0.9359006248557373\n4.789021816134845 2.456993805979323 1.0\n3.0 1.470921439035275 1.5624820640788264\n2 7\n1.2643980385584639 1.3805003041132355\n2.3877376705228617 1.9499455465451372\n0 0", "output": "17.90\n67.31\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAyush is a cashier at the shopping center. Recently his department has started a ''click and collect\" service which allows users to shop online. \n\nThe store contains k items. n customers have already used the above ser...
[{"type": "stdin_stdout", "input": "10 1 100\n1 55 67 75 40 86 24 84 82 26 81 23 70 79 51 54 21 78 31 98 68 93 66 88 99 65 20 52 35 85 16 12 94 100 59 56 18 33 47 46 71 8 38 57 2 92 3 95 6 4 87 22 48 80 15 29 11 45 72 76 44 60 91 90 39 74 41 36 13 27 53 83 32 10 30 63 89 64 49 17 9 97 69 14 50 77 37 96 10 42 28 34 61 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are n animals in the queue to Dr. Dolittle. When an animal comes into the office, the doctor examines him, gives prescriptions, appoints tests and may appoint extra examination. Doc knows all the forest animals perf...
[{"type": "stdin_stdout", "input": "150 2476\n70 21 114 127 22 11 29 59 51 59 35 3 53 88 5 8 44 4 12 100 1 27 1 25 27 56 48 22 23 103 85 66 14 58 20 7 176 11 19 26 154 97 83 3 29 30 52 92 59 11 135 37 59 8 66 20 47 19 143 16 93 18 57 71 1 13 141 1 119 6 2 87 40 68 28 22 20 53 31 19 15 33 32 9 70 63 16 26 77 7 45 52 73 ...
code_stdio