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\nA has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the end of this string. Since both A and B like the characters 'a' and 'b', ...
[{"type": "stdin_stdout", "input": "aaaaabbbbbb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "aaaaabbbbbb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "aaaaabbabbb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "bbbabbaaaaa\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "aabb...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA: A-Z-\n\nproblem\n\nThere is a circular board of 26 squares, each square with one capital letter of the alphabet written clockwise in alphabetical order. That is, the clockwise side of the'A'square is the'B' square, the...
[{"type": "stdin_stdout", "input": "AIZV", "output": "2\n"}, {"type": "stdin_stdout", "input": "W\\AG", "output": "1\n"}, {"type": "stdin_stdout", "input": "[VIA", "output": "3\n"}, {"type": "stdin_stdout", "input": "BEW]", "output": "0\n"}, {"type": "stdin_stdout", "input": "VZIA", "output": "2\n"}, {"type": "stdin_st...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nValera takes part in the Berland Marathon. The marathon race starts at the stadium that can be represented on the plane as a square whose lower left corner is located at point with coordinates (0, 0) and the length of the...
[{"type": "stdin_stdout", "input": "70092.4982 95833.7741\n1000\n", "output": "70092.4982000000 25741.2759000000\n18609.9464000000 70092.4982000000\n7131.3295000000 0.0000000000\n70092.4982000000 32872.6054000000\n11478.6169000001 70092.4982000000\n14262.6590000000 0.0000000000\n70092.4982000000 40003.9348999999\n4347....
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor an array a of integers let's denote its maximal element as max(a), and minimal as min(a). We will call an array a of k integers interesting if max(a) - min(a) ≥ k. For example, array [1, 3, 4, 3] isn't interesting as ...
[{"type": "stdin_stdout", "input": "1\n24\n1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4 5 5 5 5 5 5\n", "output": "YES\n12 13\n"}, {"type": "stdin_stdout", "input": "1\n24\n1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4 4 5 5 5 5 5\n", "output": "YES\n12 13\n"}, {"type": "stdin_stdout", "input": "1\n24\n1 1 2 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe only king stands on the standard chess board. You are given his position in format \"cd\", where c is the column from 'a' to 'h' and d is the row from '1' to '8'. Find the number of moves permitted for the king.\n\nCh...
[{"type": "stdin_stdout", "input": "e4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "a1\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "h8\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "a4\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "g7\n", "output": "8\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Collatz conjecture is one of the most famous one. Take any positive integer n, if it is even divide it by 2, if it is odd multiply it by 3 and add 1 and continue indefinitely.The conjecture is that whatever is n the s...
[{"input": "1000000", "output": "[[837799, 525]]", "fn_name": "max_collatz_length"}, {"input": "1000", "output": "[[871, 179]]", "fn_name": "max_collatz_length"}, {"input": "30", "output": "[[27, 112]]", "fn_name": "max_collatz_length"}, {"input": "1", "output": "[[1, 1]]", "fn_name": "max_collatz_length"}, {"input": "...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour task is to ___find the next higher number (int) with same '1'- Bits___.\n\nI.e. as much `1` bits as before and output next higher than input. Input is always an int in between 1 and 1<<30 (inclusive). No bad cases or...
[{"input": "1253343", "output": "[1253359]", "fn_name": "next_higher"}, {"input": "1022", "output": "[1279]", "fn_name": "next_higher"}, {"input": "128", "output": "[256]", "fn_name": "next_higher"}, {"input": "127", "output": "[191]", "fn_name": "next_higher"}, {"input": "1", "output": "[2]", "fn_name": "next_higher"}...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nKarlsson has recently discovered a huge stock of berry jam jars in the basement of the house. More specifically, there were $2n$ jars of strawberry and blueberry jam.\n\nAll the $2n$ jars are arranged in a row. The stairs...
[{"type": "stdin_stdout", "input": "4\n6\n1 1 1 1 2 1 2 1 2 1 1 1\n2\n2 2 1 2\n3\n1 1 1 1 1 1\n2\n2 1 2 1\n", "output": "12\n2\n6\n0\n"}, {"type": "stdin_stdout", "input": "4\n6\n2 2 2 1 2 2 2 1 2 2 1 2\n2\n2 2 1 2\n3\n1 1 1 1 2 1\n2\n2 1 1 1\n", "output": "10\n2\n4\n2\n"}, {"type": "stdin_stdout", "input": "4\n6\n1 1 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S consisting of lowercase English letters. We will write down this string, starting a new line after every w letters. Print the string obtained by concatenating the letters at the beginnings of thes...
[{"type": "stdin_stdout", "input": "dnuoodnuuuhs\n1", "output": "dnuoodnuuuhs\n"}, {"type": "stdin_stdout", "input": "shuuundoound\n1", "output": "shuuundoound\n"}, {"type": "stdin_stdout", "input": "dnuondouuuhs\n1", "output": "dnuondouuuhs\n"}, {"type": "stdin_stdout", "input": "siuuuodnound\n1", "output": "siuuuodno...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nM-kun has the following three cards:\n\n* A red card with the integer A.\n* A green card with the integer B.\n* A blue card with the integer C.\n\n\n\nHe is a genius magician who can do the following operation at most K t...
[{"type": "stdin_stdout", "input": "13 4 1\n10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "13 5 1\n10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "12 3 4\n9", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "12 4 4\n9", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "12 4 2\n9", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Russian here \nThe Head Chef has been playing with Fibonacci numbers for long . He has learnt several tricks related to Fibonacci numbers . Now he wants to test his chefs in the skills . \n \nA...
[{"type": "stdin_stdout", "input": "3\n5\n13\n13", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n13\n15\n13", "output": "YES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "3\n13\n18\n21", "output": "YES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5\n13\n11", "output": "YES\nYES\nNO\n"}, ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n_Based on [Project Euler problem 35](https://projecteuler.net/problem=35)_\n\nA circular prime is a prime in which every circular permutation of that number is also prime. Circular permutations are created by rotating the...
[{"input": "179", "output": "[false]", "fn_name": "circular_prime"}, {"input": "222", "output": "[false]", "fn_name": "circular_prime"}, {"input": "9377", "output": "[true]", "fn_name": "circular_prime"}, {"input": "213", "output": "[false]", "fn_name": "circular_prime"}, {"input": "197", "output": "[true]", "fn_name":...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn 20XX AD, a school competition was held. The tournament has finally left only the final competition. You are one of the athletes in the competition.\n\nThe competition you participate in is to compete for the time it ta...
[{"type": "stdin_stdout", "input": "5 5\n-38 -71 -293 75 1\n-158 -38 -405 66 1\n-236 -303 157 266 1\n316 26 411 190 1\n207 -312 -27 196 1\n-50 292 -375 -401 389 -389\n460 278 409 -329 -303 411\n215 -220 -200 309 -474 300\n310 -494 -87 -300 123 -463\n386 378 486 -443 -64 299", "output": "0\n2\n1\n3\n0\n"}, {"type": "std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a deck of $n$ cards. The $i$-th card has a number $a_i$ on the front and a number $b_i$ on the back. Every integer between $1$ and $2n$ appears exactly once on the cards.\n\nA deck is called sorted if the front v...
[{"type": "stdin_stdout", "input": "20\n24 12\n37 1\n5 35\n36 19\n22 6\n25 4\n26 17\n15 31\n39 8\n28 16\n11 29\n21 18\n14 34\n30 10\n32 2\n20 27\n33 13\n23 9\n40 7\n3 38\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "20\n7 29\n4 34\n40 2\n39 10\n33 5\n1 37\n20 23\n14 21\n22 9\n8 28\n19 24\n26 13\n32 6\n30 16...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n###Instructions\n\nWrite a function that takes a negative or positive integer, which represents the number of minutes before (-) or after (+) Sunday midnight, and returns the current day of the week and the current time i...
[{"input": "259180", "output": "[\"Thursday 23:40\"]", "fn_name": "day_and_time"}, {"input": "-349000", "output": "[\"Tuesday 15:20\"]", "fn_name": "day_and_time"}, {"input": "18876", "output": "[\"Saturday 02:36\"]", "fn_name": "day_and_time"}, {"input": "-3", "output": "[\"Saturday 23:57\"]", "fn_name": "day_and_time...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which calculates the distance between two points P1(x1, y1) and P2(x2, y2).\n\n\n\nInput\n\nFour real numbers x1, y1, x2 and y2 are given in a line.\n\nOutput\n\nPrint the distance in real number. The outp...
[{"type": "stdin_stdout", "input": "-1 -4 3 -115", "output": "111.072048689\n"}, {"type": "stdin_stdout", "input": "-1 -4 3 -190", "output": "186.043005781\n"}, {"type": "stdin_stdout", "input": "-1 -4 1 -190", "output": "186.010752377\n"}, {"type": "stdin_stdout", "input": "-1 -5 1 -190", "output": "185.010810495\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe progress is not standing still in Berland. Recently all garbage containers in Bertown, the capital of Berland, were replaced by differentiated recycling bins, each accepting some category of waste. While this will def...
[{"type": "stdin_stdout", "input": "7\n1 2 5\n1 1 3 0 0\n2 2 5\n0 0 0 1 0\n2 1 4\n1 1 2 0 0\n1 2 5\n1 2 3 0 1\n0 0 0\n0 0 0 0 0\n1 0 4\n1 0 0 0 0\n13 37 42\n1 0 0 40 47\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "7\n1 2 3\n1 1 3 0 0\n2 2 5\n0 0 3 1 0\n2 2 4\n1 2 2 0 1\n1 2 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThanks to your help, Heidi is confident that no one can fool her. She has now decided to post some fake news on the HC2 Facebook page. However, she wants to be able to communicate to the HC2 committee that the post is fak...
[{"type": "stdin_stdout", "input": "688094\n", "output": "abcdefghijklmnopqrssrqpomlkjihgfebbbccddeeffgghhiijjkkllmmnnooppqqrrss abcdefghijklmnopqrs\n"}, {"type": "stdin_stdout", "input": "912733\n", "output": "abcdefghijklmnopqrstsrqpnljigfedbccddeeffgghhiijjkkllmmnnooppqqrrsstt abcdefghijklmnopqrst\n"}, {"type": "std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a string of words, you need to find the highest scoring word.\n\nEach letter of a word scores points according to its position in the alphabet: `a = 1, b = 2, c = 3` etc.\n\nYou need to return the highest scoring wo...
[{"input": "\"what time are we climbing up the volcano\"", "output": "[\"volcano\"]", "fn_name": "high"}, {"input": "\"take two bintang and a dance please\"", "output": "[\"bintang\"]", "fn_name": "high"}, {"input": "\"massage yes massage yes massage\"", "output": "[\"massage\"]", "fn_name": "high"}, {"input": "\"man i...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nA function $f : R \\rightarrow R$ is called Lipschitz continuous if there is a real constant K such that the inequality |f(x) - f(y)| ≤ K·|x - y| holds for all $x, y \\in R$. We'll deal with a more... discrete version of ...
[{"type": "stdin_stdout", "input": "3 6\n48261735 26888803 75904937\n1 2\n1 3\n2 3\n1 2\n2 3\n1 3\n", "output": "21372932\n119405200\n49016134\n21372932\n49016134\n119405200\n"}, {"type": "stdin_stdout", "input": "3 6\n48261735 26888803 75904937\n1 2\n1 3\n2 3\n1 2\n2 3\n1 3\n", "output": "21372932\n119405200\n49016134...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian as well. \n\nYou had an array of integer numbers. You also had a beautiful operations called \"Copy-Paste\" which allowed you to copy any contiguous subsequence of ...
[{"type": "stdin_stdout", "input": "2\n5\n1 0 1 1 1\n5\n1 2 10 2 2", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n5\n1 0 1 1 1\n5\n1 2 10 0 2", "output": "2\n4\n"}, {"type": "stdin_stdout", "input": "2\n5\n1 0 1 1 1\n5\n1 2 10 0 4", "output": "2\n5\n"}, {"type": "stdin_stdout", "input": "2\n5\n1 1 1 1 1\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA median of an array of integers of length $n$ is the number standing on the $\\lceil {\\frac{n}{2}} \\rceil$ (rounding up) position in the non-decreasing ordering of its elements. Positions are numbered starting with $1$...
[{"type": "stdin_stdout", "input": "6\n2 4\n0 24 37 58 62 64 69 78\n2 2\n27 61 81 91\n4 3\n0 4 16 18 21 27 36 53 82 91 92 95\n3 4\n1 11 12 22 33 35 38 67 69 71 94 99\n2 1\n11 41\n3 3\n1 2 1 1 1 1 1 1 -1\n", "output": "168\n108\n145\n234\n11\n3\n"}, {"type": "stdin_stdout", "input": "6\n2 4\n0 24 25 58 62 64 69 78\n2 2\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of n integer numbers. Let sum(l, r) be the sum of all numbers on positions from l to r non-inclusive (l-th element is counted, r-th element is not counted). For indices l and r holds 0 ≤ l ≤ r ≤ n. ...
[{"type": "stdin_stdout", "input": "100\n2 1 -2 -1 -2 0 -1 -2 1 2 0 1 0 -2 -1 -2 0 2 0 1 -2 -2 2 0 -2 2 -2 0 2 -1 2 0 -1 0 -2 2 -1 -1 -2 -1 0 -2 2 0 -2 -2 -2 -1 1 0 -2 -1 2 -1 -4 0 -1 1 1 2 -2 1 -2 1 2 2 -2 1 -2 0 -1 -1 -2 -2 1 0 -1 -1 2 0 2 0 -1 2 1 -1 2 0 2 1 1 1 -1 -1 1 -2 0 0 -2 0\n", "output": "2 78 92\n"}, {"type...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points...
[{"type": "stdin_stdout", "input": "5\n20421 5189 23141 12511\n16414 10436 17880 12511\n17880 10436 20421 12511\n15819 10436 16414 12511\n15819 5189 20421 10436\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n20421 5189 23141 12511\n16414 10436 17880 12511\n17880 10436 20421 12511\n15819 10436 16414 12511...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have N logs of lengths A_1,A_2,\\cdots A_N.\nWe can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t...
[{"type": "stdin_stdout", "input": "10 10\n158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 211047202\n", "output": "292638192\n"}, {"type": "stdin_stdout", "input": "10 10\n158260522 877914575 1013896555 24979445 861648772 623690081 433933447 476190629 262703497 374010847", "out...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven an array of $n$ positive integers $a_1, a_2, \\dots, a_n$ ($1 \\le a_i \\le 1000$). Find the maximum value of $i + j$ such that $a_i$ and $a_j$ are coprime,$^{\\dagger}$ or $-1$ if no such $i$, $j$ exist.\n\nFor exa...
[{"type": "stdin_stdout", "input": "9\n19\n146 637 288 867 647 705 297 414 541 951 238 806 73 916 781 371 937 343 985\n6\n289 797 286 446 650 296\n15\n670 558 11 473 388 270 231 981 580 180 834 882 212 233 547\n16\n461 336 815 510 720 169 999 580 367 47 992 786 671 522 25 24\n8\n732 710 651 518 287 789 347 14\n4\n697 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Scenario \n\n*You're saying good-bye your best friend* , **_See you next happy year_** . \n\n**_Happy Year_** *is the year with only distinct digits* , (e.g) **_2018_**\n\n___\n# Task\n\n**_Given_** a year, **_Find_** *...
[{"input": "1001", "output": "[1023]", "fn_name": "next_happy_year"}, {"input": "1123", "output": "[1203]", "fn_name": "next_happy_year"}, {"input": "2001", "output": "[2013]", "fn_name": "next_happy_year"}, {"input": "2334", "output": "[2340]", "fn_name": "next_happy_year"}, {"input": "3331", "output": "[3401]", "fn_n...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nTwo experienced climbers are planning a first-ever attempt: they start at two points of the equal altitudes on a mountain range, move back and forth on a single route keeping their altitudes equal, and finally meet with e...
[{"type": "stdin_stdout", "input": "6\n0 -1\n3 4\n9 12\n17 10\n21 12\n33 -1\n5\n0 0\n12 0\n20 0\n30 0\n74 0\n10\n0 0\n1 2\n3 0\n6 3\n9 0\n11 2\n13 0\n15 2\n16 2\n35 0\n7\n0 0\n150 997\n300 1\n450 999\n600 2\n750 998\n900 0\n0", "output": "46.241105114034\n74.000000000000\n46.612166980266\n10078.072814085803\n"}, {"type...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have a grid with N rows and M columns of squares. Initially, all the squares are white.\n\nThere is a button attached to each row and each column. When a button attached to a row is pressed, the colors of all the squar...
[{"type": "stdin_stdout", "input": "1 13 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 13 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 17 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 20 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 21 3", "output": "Yes\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given n points on a plane. All points are different.\n\nFind the number of different groups of three points (A, B, C) such that point B is the middle of segment AC. \n\nThe groups of three points are considered un...
[{"type": "stdin_stdout", "input": "40\n-8 24\n2 -1\n1 -18\n72 -70\n5 -4\n-308 436\n-19 40\n36 -35\n-178 265\n-1 2\n-7 30\n-1 0\n3 -2\n200 -285\n17 -16\n-35 74\n0 -4\n-86 106\n-1 4\n-7 6\n0 1\n-5 4\n-2 3\n6 -5\n-4 5\n181 -262\n76 -118\n0 0\n-7 18\n-58 104\n-5 6\n-6 12\n-3 4\n1 0\n11 -10\n-86 130\n-3 6\n153 -236\n-183 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n Mobius function - an important function in number theory. For each given n, it only has 3 values:\n```\n0 -- if n divisible by square of a prime. Such as: 4, 8, 9\n1 -- if n not divisible by any square of a pri...
[{"input": "100000000001", "output": "[0]", "fn_name": "mobius"}, {"input": "10", "output": "[1]", "fn_name": "mobius"}, {"input": "7", "output": "[-1]", "fn_name": "mobius"}, {"input": "5", "output": "[-1]", "fn_name": "mobius"}, {"input": "9", "output": "[0]", "fn_name": "mobius"}, {"input": "8", "output": "[0]", "fn...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\n<image>\n\n\nYou know the merry-go-round in the amusement park. Vehicles such as horses and carriages are fixed on a large disk, and it is a standard playset that the vehicle swings up and down at the same time as the dis...
[{"type": "stdin_stdout", "input": "0 3 1 1 0 -1 -1 2\n1 1 5 3 -1 3 0 -1", "output": "1 4 1 2 1 2 1 4\n1 2 1 4 1 4 1 2\n"}, {"type": "stdin_stdout", "input": "0 2 0 1 0 -1 -1 2\n1 1 5 3 -1 3 0 -1", "output": "1 2 1 2 1 4 1 4\n1 2 1 4 1 4 1 2\n"}, {"type": "stdin_stdout", "input": "0 2 1 1 0 -1 -1 2\n1 1 5 3 -1 0 0 -1",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n \"AL-AHLY\" and \"Zamalek\" are the best teams in Egypt, but \"AL-AHLY\" always wins the matches between them. \"Zamalek\" managers want to know what is the best match they've played so far.\n \n The best match i...
[{"input": "[1, 2, 3, 4, 5]\n[0, 1, 2, 3, 4]", "output": "[4]", "fn_name": "best_match"}, {"input": "[3, 4, 3]\n[1, 1, 2]", "output": "[2]", "fn_name": "best_match"}, {"input": "[4, 3, 4]\n[1, 1, 1]", "output": "[1]", "fn_name": "best_match"}, {"input": "[6, 4]\n[1, 2]", "output": "[1]", "fn_name": "best_match"}, {"inp...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a_1, a_2, ..., a_{k}, that their sum is equal to n and greatest common divisor is maximal.\n\nGreatest com...
[{"type": "stdin_stdout", "input": "10000000000 5000\n", "output": "640 1280 1920 2560 3200 3840 4480 5120 5760 6400 7040 7680 8320 8960 9600 10240 10880 11520 12160 12800 13440 14080 14720 15360 16000 16640 17280 17920 18560 19200 19840 20480 21120 21760 22400 23040 23680 24320 24960 25600 26240 26880 27520 28160 2880...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nThere are $ N $ streetlights on a two-dimensional square of $ W \\ times H $.\nGaccho wants to start with $ (1,1) $ and go to $ (W, H) $.\nGaccho is afraid of dark places, so he only wants to walk in the square...
[{"type": "stdin_stdout", "input": "43 16 2\n4 7\n-1 8\n10 0", "output": "48\n"}, {"type": "stdin_stdout", "input": "19 21 2\n0 3\n-1 11\n1 1", "output": "30\n"}, {"type": "stdin_stdout", "input": "12 31 1\n5 2\n-1 1\n14 0", "output": "36\n"}, {"type": "stdin_stdout", "input": "34 50 1\n9 1\n0 1\n-2 -1", "output": "74\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe sequence of integers $a_1, a_2, \\dots, a_k$ is called a good array if $a_1 = k - 1$ and $a_1 > 0$. For example, the sequences $[3, -1, 44, 0], [1, -99]$ are good arrays, and the sequences $[3, 7, 8], [2, 5, 4, 1], [0...
[{"type": "stdin_stdout", "input": "4\n-2 0 4 -1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-2 0 1 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4\n-2 1 5 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n-1 0 4 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-2 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMahmoud and Ehab continue their adventures! As everybody in the evil land knows, Dr. Evil likes bipartite graphs, especially trees.\n\nA tree is a connected acyclic graph. A bipartite graph is a graph, whose vertices can ...
[{"type": "stdin_stdout", "input": "10\n7 6\n2 10\n7 1\n8 5\n9 3\n2 3\n8 7\n10 8\n10 4\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "10\n7 6\n2 7\n4 1\n8 5\n9 4\n5 3\n8 7\n10 8\n10 4\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "10\n2 6\n3 7\n8 4\n4 10\n6 9\n9 7\n3 10\n1 2\n5 8\n", "output": "16...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA: A-Z Cat / A-Z Cat\n\nstory\n\nAizunyan is a second-year student who belongs to the programming contest club of Wakagamatsu High School, commonly known as the Prokon club. It's so cute. Aizu Nyan was asked by her friend...
[{"type": "stdin_stdout", "input": "AOZUNYANPERIPERO", "output": "AZ\n"}, {"type": "stdin_stdout", "input": "OREQIRMQEAYNUYOA", "output": "-1\n"}, {"type": "stdin_stdout", "input": "OREPIREPNAYNUZOA", "output": "AZ\n"}, {"type": "stdin_stdout", "input": "OREPIRNPEAYNUZOA", "output": "AZ\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRecently a dog was bought for Polycarp. The dog's name is Cormen. Now Polycarp has a lot of troubles. For example, Cormen likes going for a walk. \n\nEmpirically Polycarp learned that the dog needs at least k walks for an...
[{"type": "stdin_stdout", "input": "100 500\n64 140 15 221 24 106 73 30 275 97 296 55 5 30 47 199 130 44 72 170 7 204 359 40 128 117 45 192 344 112 0 11 196 78 73 53 222 93 88 151 99 283 60 71 4 87 226 46 66 74 23 89 77 60 397 181 0 101 358 54 124 155 19 218 9 140 161 130 308 85 103 85 300 128 19 108 225 136 100 54 30 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.\n\nOnly Japanese students or overseas students can pas...
[{"type": "stdin_stdout", "input": "12 14 3\ncaababaccaba", "output": "No\nYes\nYes\nYes\nYes\nYes\nYes\nNo\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "12 14 3\nabaccababaac", "output": "Yes\nYes\nYes\nNo\nNo\nYes\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "12 16 2\ncabbabaacaaa"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet's call a positive integer $n$ ordinary if in the decimal notation all its digits are the same. For example, $1$, $2$ and $99$ are ordinary numbers, but $719$ and $2021$ are not ordinary numbers.\n\nFor a given number ...
[{"type": "stdin_stdout", "input": "6\n2\n2\n3\n8\n10\n100\n", "output": "2\n2\n3\n8\n9\n18\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n3\n4\n10\n100\n", "output": "2\n2\n3\n4\n9\n18\n"}, {"type": "stdin_stdout", "input": "6\n1\n2\n3\n4\n5\n100\n", "output": "\n1\n2\n3\n4\n5\n18\n"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which prints the central coordinate ($cx$,$cy$) and the radius $r$ of a circumscribed circle of a triangle which is constructed by three points ($x_1$, $y_1$), ($x_2$, $y_2$) and ($x_3$, $y_3$) on the plan...
[{"type": "stdin_stdout", "input": "1 -2\n3 2\n-2 0", "output": "0.62500000000000000000 0.68750000000000000000 2.71353666826155124291"}, {"type": "stdin_stdout", "input": "0 3\n4 0\n0 0", "output": "2.00000000000000000000 1.50000000000000000000 2.50000000000000000000"}, {"type": "stdin_stdout", "input": "7 -3\n1 0\n-13...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\...
[{"type": "stdin_stdout", "input": "987654215 1000000000 9854874 854888120 270\n", "output": "3.1951405575880256686e-08"}, {"type": "stdin_stdout", "input": "777777776 778777777 777777775 1000000000 1\n", "output": "2.013495963778572506e-06"}, {"type": "stdin_stdout", "input": "987654215 1000000000 5640296 854888120 27...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n```if-not:rust\nYour task is to write a function `toLeetSpeak` that converts a regular english sentence to Leetspeak.\n```\n```if:rust\nYour task is to write a function `to_leet_speak` that converts a regular english sent...
[{"input": "\"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG\"", "output": "[\"7#3 QU!(K 8R0WN F0X JUMP$ 0V3R 7#3 1@2Y D06\"]", "fn_name": "to_leet_speak"}, {"input": "\"LOREM IPSUM DOLOR SIT AMET\"", "output": "[\"10R3M !P$UM D010R $!7 @M37\"]", "fn_name": "to_leet_speak"}, {"input": "\"HELLO WORLD\"", "output": "[\"#311...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider the set of all nonnegative integers: ${0, 1, 2, \\dots}$. Given two integers $a$ and $b$ ($1 \\le a, b \\le 10^4$). We paint all the numbers in increasing number first we paint $0$, then we paint $1$, then $2$ an...
[{"type": "stdin_stdout", "input": "4\n10 10\n1 10\n6 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"type": "stdin_stdout", "input": "4\n10 10\n1 10\n3 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"type": "stdin_stdout", "input": "4\n10 10\n1 10\n6 9\n7 3\n", "output": "Infinite\nFini...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nI love Fibonacci numbers in general, but I must admit I love some more than others. \n\nI would like for you to write me a function that when given a number (n) returns the n-th number in the Fibonacci Sequence.\n\nFor e...
[{"input": "22", "output": "[10946]", "fn_name": "nth_fib"}, {"input": "23", "output": "[17711]", "fn_name": "nth_fib"}, {"input": "24", "output": "[28657]", "fn_name": "nth_fib"}, {"input": "25", "output": "[46368]", "fn_name": "nth_fib"}, {"input": "18", "output": "[1597]", "fn_name": "nth_fib"}, {"input": "19", "out...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nGiven the squares of $ R * C $. Each square is either an empty square or a square with a hole. The given square meets the following conditions.\n\n* The cells with holes are connected. (You can move a square wi...
[{"type": "stdin_stdout", "input": "3 5\n.....\n.#.#.\n.###.\n.#.#.\n.....", "output": "3\n"}, {"type": "stdin_stdout", "input": "3 1\n.....\n.#.#.\n.###.\n.#.#.\n.....", "output": "0\n"}, {"type": "stdin_stdout", "input": "2 5\n.....\n.#.#.\n.###.\n.#.#.\n.....", "output": "2\n"}, {"type": "stdin_stdout", "input": "4 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are n cities in the country where the Old Peykan lives. These cities are located on a straight line, we'll denote them from left to right as c_1, c_2, ..., c_{n}. The Old Peykan wants to travel from city c_1 to c_{n...
[{"type": "stdin_stdout", "input": "100 6\n15 20 32 8 29 10 33 15 9 26 28 21 34 7 41 23 9 17 16 15 14 29 25 31 24 26 13 18 19 40 9 16 36 32 39 11 4 31 37 28 32 40 7 18 45 21 15 45 6 15 27 22 27 41 28 7 22 43 25 40 6 7 32 31 36 14 5 27 31 28 23 9 13 14 7 25 28 33 40 22 44 9 29 26 41 30 16 15 31 42 13 40 36 44 17 29 32 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\nYou are a lifelong fan of your local football club, and proud to say you rarely miss a game. Even though you're a superfan, you still hate boring games. Luckily, boring games often end in a draw, at which point th...
[{"input": "100\n[100, 100]", "output": "[2]", "fn_name": "penaltyShots"}, {"input": "10\n[10, 10]", "output": "[2]", "fn_name": "penaltyShots"}, {"input": "2\n[1, 2]", "output": "[3]", "fn_name": "penaltyShots"}, {"input": "5\n[5, 5]", "output": "[2]", "fn_name": "penaltyShots"}, {"input": "0\n[0, 0]", "output": "[6]"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a very secret base in Potatoland where potato mash is made according to a special recipe. The neighbours from Porridgia decided to seize this recipe and to sell it to Pilauland. For this mission they have been pr...
[{"type": "stdin_stdout", "input": "...\nX.X\n...\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "X.X\n.X.\nX.X\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "...\nXXX\n...\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "X..\n.X.\n..X\n", "output": "YES\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTheofanis has a riddle for you and if you manage to solve it, he will give you a Cypriot snack halloumi for free (Cypriot cheese).\n\nYou are given an integer $n$. You need to find two integers $l$ and $r$ such that $-10^...
[{"type": "stdin_stdout", "input": "7\n1\n3\n20\n2\n110\n23\n4838829180358\n", "output": "0 1\n-2 3\n-19 20\n-1 2\n-109 110\n-22 23\n-4838829180357 4838829180358\n"}, {"type": "stdin_stdout", "input": "7\n1\n2\n12\n2\n101\n56\n3000000000000\n", "output": "0 1\n-1 2\n-11 12\n-1 2\n-100 101\n-55 56\n-2999999999999 300000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n4\nDurett 7\nGayles 3\nFacenda 6\nDaughtery 0\n1\n+ Mccourtney 2\n\n\nOutput\n\nMccourtney is not working now.\nDurett is working hard now.\n\nThe input will be stdin and you should print your solution...
[{"type": "stdin_stdout", "input": "4\nDurett 10\nGayles 4\nF`cenda 10\nyrethguaD 0\n1\n+ Mccourtney 1", "output": "Mccourtney is not working now.\nF`cenda is working hard now.\n"}, {"type": "stdin_stdout", "input": "4\nDurett 10\nGaxles 4\nFacenda 10\nyrethguaD 0\n1\n+ yentruoccM 2", "output": "yentruoccM is not worki...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nUjan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is time to sort them out. This time he found an old dusty graph theory notebook with a description of a graph.\n\nIt ...
[{"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 12\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15 10\n2 3\n6 4\n5 12\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15 10\n2 3\n5 8\n5 6\n5 7\n3 8\n3 10\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a robot on a coordinate plane. Initially, the robot is located at the point $(0, 0)$. Its path is described as a string $s$ of length $n$ consisting of characters 'L', 'R', 'U', 'D'.\n\nEach of these characters c...
[{"type": "stdin_stdout", "input": "4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLRDDL\n", "output": "1 2 \n1 4 \n3 4 \n1 2 \n"}, {"type": "stdin_stdout", "input": "4\n4\nLRUD\n4\nLURD\n5\nRURDU\n5\nLRDDL\n", "output": "1 2 \n1 4 \n4 5 \n1 2 \n"}, {"type": "stdin_stdout", "input": "4\n4\nDURL\n4\nLURD\n5\nUDURR\n5\nLRDDL\n", "out...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOnce Bob needed to find the second order statistics of a sequence of integer numbers. Lets choose each number from the sequence exactly once and sort them. The value on the second position is the second order statistics o...
[{"type": "stdin_stdout", "input": "99\n10 -84 -100 -100 73 -64 -100 -94 33 -100 -100 -100 -100 71 64 24 7 -100 -32 -100 -100 77 -100 62 -12 55 45 -100 -100 -80 -100 -100 -100 -100 -100 -100 -100 -100 -100 -39 -48 -100 -34 47 -100 -100 -100 -100 -100 -77 -100 -100 -100 -100 -100 -100 -52 40 -55 -100 -44 -100 72 33 70 -...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two arrays $a$ and $b$, both of length $n$.\n\nYou can perform the following operation any number of times (possibly zero): select an index $i$ ($1 \\leq i \\leq n$) and swap $a_i$ and $b_i$.\n\nLet's define...
[{"type": "stdin_stdout", "input": "1\n100\n77 18 18 20 58 11 45 18 21 15 44 87 77 65 94 83 68 73 43 84 75 100 66 39 63 44 60 16 100 4 83 53 37 11 95 71 38 57 66 31 40 60 36 37 92 79 30 55 46 25 54 45 85 38 29 82 60 11 11 69 30 1 53 100 62 61 17 75 99 9 31 8 100 53 57 8 11 26 95 72 50 77 90 88 80 84 53 50 23 3 78 27 76...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBerOilGasDiamondBank has branches in n cities, at that n is an even number. The bank management wants to publish a calendar with the names of all those cities written in two columns: the calendar should consist of exactly...
[{"type": "stdin_stdout", "input": "58\nesgdfmf\nxfkluadj\nqhvh\njwhuyhm\nmgi\nysgc\nvhhenku\npb\ntr\nu\njyrpjnpd\nkluadjo\nopb\ncopb\ngcyhceo\nr\ndjo\nxfklu\neo\nadjo\nfkluadjo\nybe\nwljwh\nqhvhh\nrhgotp\nyhceo\nuyhm\nvdd\nyhm\nysgcyhc\nvddrhg\nril\nwljwhu\nx\nqh\nhceo\ntfcopb\nmgitfc\nvddrh\nmgitfco\nxf\nmgitf\ncyoyb...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions are constraints on $n$ and $k$.\n\nYou are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most $k$ most recent conversat...
[{"type": "stdin_stdout", "input": "10 4\n2 3 3 1 1 4 1 2 3 3\n", "output": "4\n4 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 3 3 1 1 2 1 2 5 3\n", "output": "4\n5 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 3 3 2 1 4 1 2 3 3\n", "output": "4\n4 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolate out of boredom.\n\nA bar of chocolate can be presented as an n × n table, where each cell represents one piece...
[{"type": "stdin_stdout", "input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6\n4\n1\n7\n2\n2\n8\n7\n"}, {"type": "stdin_stdout", "input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAn extension of a complex number is called a quaternion. It is a convenient number that can be used to control the arm of a robot because it is convenient for expressing the rotation of an object. Quaternions are $ using ...
[{"type": "stdin_stdout", "input": "2\n2 0 2 1 89 0 26 7\n13 11 25 8 -1 3 0 -2\n0", "output": "119 -12 230 103\n-30 -22 21 -109\n"}, {"type": "stdin_stdout", "input": "2\n2 0 2 5 89 0 26 4\n7 11 25 8 -1 3 0 -2\n0", "output": "106 -122 230 453\n-24 -40 21 -97\n"}, {"type": "stdin_stdout", "input": "2\n2 0 2 5 89 0 26 4\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya has recently finished writing a book. Now he faces the problem of giving it the title. Vasya wants the title to be vague and mysterious for his book to be noticeable among others. That's why the title should be repr...
[{"type": "stdin_stdout", "input": "26\nabcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdythuhqvwyhovvtlsnvgfzyxwvutsrqponmlkjihgfedcba\n", "output": "abcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdythuhqvwyhovvtlsnvgfzyxwvutsrqponmlkjihgfedcba\n"}, {"type": "stdin_stdout", "input": "26\nab?defg??j??mnopqrs...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis contest is `CODEFESTIVAL`, which can be shortened to the string `CF` by deleting some characters.\n\nMr. Takahashi, full of curiosity, wondered if he could obtain `CF` from other strings in the same way.\n\nYou are g...
[{"type": "stdin_stdout", "input": "CODDFESTIVAL", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "EDOCLAVFTSEI", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "ECOFLAVDTSEI", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "DOECSDKSIVAF", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "DOEC...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic operation '+' and '-', equality and positive integer n. The goal is to replace each question mark with some posit...
[{"type": "stdin_stdout", "input": "? + ? + ? - ? + ? - ? - ? - ? - ? - ? + ? - ? + ? + ? - ? + ? - ? + ? + ? - ? + ? - ? + ? + ? + ? - ? - ? - ? + ? - ? - ? + ? - ? - ? + ? - ? + ? + ? - ? + ? - ? - ? + ? + ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n\"The Shell Game\" involves cups upturned on a playing surface, with a ball placed underneath one of them. The index of the cups are swapped around multiple times. After that the players will try to find which cup contai...
[{"input": "0\n[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19], [19, 20], [20, 21], [21, 22], [22, 23], [23, 24], [24, 25], [25, 26], [26, 27], [27, 28], [28, 29], [29, 30], [30, 31], [31, 32], [32...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a list of white pawns on a chessboard (any number of them, meaning from 0 to 64 and with the possibility to be positioned everywhere), determine how many of them have their backs covered by another. \nPawns attackin...
[{"input": "[\"a1\", \"a2\", \"a3\", \"a4\", \"a5\", \"a6\", \"a7\", \"a8\", \"b1\", \"b2\", \"b3\", \"b4\", \"b5\", \"b6\", \"b7\", \"b8\", \"c1\", \"c2\", \"c3\", \"c4\", \"c5\", \"c6\", \"c7\", \"c8\", \"d1\", \"d2\", \"d3\", \"d4\", \"d5\", \"d6\", \"d7\", \"d8\", \"e1\", \"e2\", \"e3\", \"e4\", \"e5\", \"e6\", \"e...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasilisa the Wise from a far away kingdom got a present from her friend Helga the Wise from a farther away kingdom. The present is a surprise box, yet Vasilisa the Wise doesn't know yet what the surprise actually is becau...
[{"type": "stdin_stdout", "input": "BYOVRR\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "OVBRYG\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "RRYOGB\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "VOBYGO\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "GRBYVO\n", "output": "30...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\n0 2 7\n2 0 4\n5 8 0\n\n\nOutput\n\n11\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.\n\nWrite Python code to solve this probl...
[{"type": "stdin_stdout", "input": "3\n0 3 10\n1 0 4\n19 11 0", "output": "15\n"}, {"type": "stdin_stdout", "input": "3\n0 6 13\n4 0 3\n24 12 0", "output": "20\n"}, {"type": "stdin_stdout", "input": "3\n0 12 13\n6 0 6\n27 8 0", "output": "25\n"}, {"type": "stdin_stdout", "input": "3\n0 12 18\n6 0 6\n27 8 0", "output": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven an integer `n` return `\"odd\"` if the number of its divisors is odd. Otherwise return `\"even\"`.\n\n**Note**: big inputs will be tested.\n\n## Examples:\n\nAll prime numbers have exactly two divisors (hence `\"eve...
[{"input": "27", "output": "[\"even\"]", "fn_name": "oddity"}, {"input": "121", "output": "[\"odd\"]", "fn_name": "oddity"}, {"input": "5", "output": "[\"even\"]", "fn_name": "oddity"}, {"input": "16", "output": "[\"odd\"]", "fn_name": "oddity"}, {"input": "1", "output": "[\"odd\"]", "fn_name": "oddity"}]
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S of length 2N consisting of lowercase English letters.\n\nThere are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?\n\n* The string...
[{"type": "stdin_stdout", "input": "18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "output": "9075135300"}, {"type": "stdin_stdout", "input": "18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aaaa", "output": "0\n"}, {"type": "stdin_stdout", "input": "18\naaaaaaaaaaaaaaaaaaaaaaabaaaaaaa`aaaa", "output": "0\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nToday's Random Number\n\nE869120 You ran a campaign called \"Today's Random Numbers\" for N days. This is a project to generate a random number once a day and post the value on Twitter.\n\nThe \"random numbers of the day\...
[{"type": "stdin_stdout", "input": "5\n15 -1 21 0 20", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n15 -1 21 0 22", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n-2 -1 -1 14 2", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n-2 -1 -1 21 2", "output": "2\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nCurrently Tiny is learning Computational Geometry. When trying to solve a problem called \"The Closest Pair Of Points In The Plane\", he found that a code which gave a wrong time complexity got Accepted instead of Time Li...
[{"type": "stdin_stdout", "input": "3119 2029631\n", "output": "0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n0 13\n0 14\n0 15\n0 16\n0 17\n0 18\n0 19\n0 20\n0 21\n0 22\n0 23\n0 24\n0 25\n0 26\n0 27\n0 28\n0 29\n0 30\n0 31\n0 32\n0 33\n0 34\n0 35\n0 36\n0 37\n0 38\n0 39\n0 40\n0 41\n0 42\n0 43\n0 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya is a regular participant at programming contests and is already experienced in finding important sentences in long statements. Of course, numbers constraints are important — factorization of a number less than 10000...
[{"type": "stdin_stdout", "input": "2684354990\n", "output": "2684354990\n"}, {"type": "stdin_stdout", "input": "2539579656\n", "output": "2539579656\n"}, {"type": "stdin_stdout", "input": "9663677133\n", "output": "9663677133\n"}, {"type": "stdin_stdout", "input": "6530347911\n", "output": "6530347911\n"}, {"type": "s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTurbulent times are coming, so you decided to buy sugar in advance. There are $n$ shops around that sell sugar: the $i$-th shop sells one pack of sugar for $a_i$ coins, but only one pack to one customer each day. So in or...
[{"type": "stdin_stdout", "input": "1\n100 37\n29 33 45 64 95 33 45 76 86 5 52 16 27 24 80 5 44 19 96 8 77 67 21 17 22 56 28 3 84 27 39 12 60 35 75 6 68 71 81 5 76 85 73 54 8 4 58 4 22 5 11 51 72 31 67 93 38 94 96 22 73 34 33 84 21 60 89 88 30 21 44 57 5 16 11 65 20 68 68 41 25 78 43 96 61 10 40 98 55 35 19 79 21 4 62 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou can not just take the file and send it. When Polycarp trying to send a file in the social network \"Codehorses\", he encountered an unexpected problem. If the name of the file contains three or more \"x\" (lowercase L...
[{"type": "stdin_stdout", "input": "100\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "98\n"}, {"type": "stdin_stdout", "input": "100\nuxxxxxlmexxxxxxxwnxxexxxxxcxxfydxxxxxxvmdxxxxxxisxxxxxxxxidkxxxpxxxxxxxxmnuxxxxjxxxqcxxwmxxxxxxxxmrx\n", "output": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRecently a Golden Circle of Beetlovers was found in Byteland. It is a circle route going through $n \\cdot k$ cities. The cities are numerated from $1$ to $n \\cdot k$, the distance between the neighboring cities is exact...
[{"type": "stdin_stdout", "input": "100000 100000\n50000 6424\n", "output": "1250000000 1250000000\n"}, {"type": "stdin_stdout", "input": "100000 101000\n50000 6424\n", "output": "39453125 1262500000\n"}, {"type": "stdin_stdout", "input": "98752 97209\n41218 39020\n", "output": "21427641 3199861056\n"}, {"type": "stdin...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSereja has an n × m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants his table to meet the following requirement: each connected component of the same values forms a rectangle with...
[{"type": "stdin_stdout", "input": "21 10 8\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n0 0 1 1 1 0 0 0 0 0\n0 0 0 1 1 0 0 0 0 0\n1 1 1 0 0 1 1 1 1 1\n0 0 0 1 1 0 0 0 0 0\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n0 0 0 1 1 0 0 0 0 0\n1 0 1 0 0 1 1 1 1 1\n0 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDrazil likes heap very much. So he created a problem with heap:\n\nThere is a max heap with a height h implemented on the array. The details of this heap are the following:\n\nThis heap contains exactly 2^h - 1 distinct p...
[{"type": "stdin_stdout", "input": "2\n3 1\n7 6 3 5 4 2 1\n3 1\n23 6 5 4 3 2 1\n", "output": "1\n1 1 1 1 1 1\n1\n1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "2\n3 1\n14 10 3 5 4 2 1\n3 2\n23 12 9 4 3 2 1\n", "output": "1\n1 1 1 1 1 1\n8\n1 1 1 3\n"}, {"type": "stdin_stdout", "input": "2\n3 2\n14 6 3 5 4 2 1\n3 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a consisting of n integers. We denote the subarray a[l..r] as the array [a_l, a_{l + 1}, ..., a_r] (1 ≤ l ≤ r ≤ n).\n\nA subarray is considered good if every integer that occurs in this subarray occ...
[{"type": "stdin_stdout", "input": "100\n79 79 79 97 97 97 64 64 64 2 2 2 38 38 38 65 65 65 10 10 10 25 24 25 53 53 53 73 73 73 11 11 11 29 29 29 93 93 93 73 73 73 89 89 89 72 72 72 49 49 49 78 78 78 92 92 92 90 90 90 95 95 95 92 92 92 12 12 12 65 65 65 81 81 81 5 5 5 21 21 21 94 94 94 51 51 51 44 44 44 55 55 55 47 47 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEvery day we can send from the server a certain limit of e-mails.\n\nTask:\nWrite a function that will return the integer number of e-mails sent in the percentage of the limit.\n\nExample:\n```\nlimit - 1000;\nemail...
[{"input": "1000\n1000", "output": "[\"Daily limit is reached\"]", "fn_name": "get_percentage"}, {"input": "0", "output": "[\"No e-mails sent\"]", "fn_name": "get_percentage"}, {"input": "101\n1000", "output": "[\"10%\"]", "fn_name": "get_percentage"}, {"input": "256\n500", "output": "[\"51%\"]", "fn_name": "get_percen...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven two numbers (m and n) :\n\n- convert all numbers from m to n to binary\n- sum them as if they were in base 10 \n- convert the result to binary\n- return as string\n\nEg: with the numbers 1 and 4\n\n\n 1 // 1 to bi...
[{"input": "100\n1000", "output": "[\"111111001111110110011011000101110101110\"]", "fn_name": "binary_pyramid"}, {"input": "1\n100", "output": "[\"10011101010010110000101010\"]", "fn_name": "binary_pyramid"}, {"input": "100\n100", "output": "[\"100001100100101000100\"]", "fn_name": "binary_pyramid"}, {"input": "21\n60"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nOn Bertown's main street n trees are growing, the tree number i has the height of ai meters (1 ≤ i ≤ n). By the arrival of the President of Berland these trees were decided to be changed so that their heights formed a bea...
[{"type": "stdin_stdout", "input": "10\n73905 73906 73907 85732 73909 73909 73908 73907 73906 73905\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10\n60718 99414 65042 65043 65044 38495 95782 65042 65041 65040\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n60718 99414 65042 89001 65044 38495 95...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTime Limit: 8 sec / Memory Limit: 64 MB\n\n\n\n\n\nExample\n\nInput\n\neggchickenegg\n\n\nOutput\n\negg\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the cod...
[{"type": "stdin_stdout", "input": "egechmilfgcgg", "output": "chicken\n"}, {"type": "stdin_stdout", "input": "egichgckenegg", "output": "egg\n"}, {"type": "stdin_stdout", "input": "egichnckegegg", "output": "egg\n"}, {"type": "stdin_stdout", "input": "egechickgnegg", "output": "egg\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe start with a string s consisting only of the digits 1, 2, or 3. The length of s is denoted by |s|. For each i from 1 to |s|, the i-th character of s is denoted by s_i. \n\nThere is one cursor. The cursor's location ℓ i...
[{"type": "stdin_stdout", "input": "9\n1500\n1212\n1500\n1221\n1500\n122\n1500\n12121\n1500\n22\n1500\n1111112111111112\n1500\n1111111111221111111\n1500\n111111122\n1500\n11111121111121111111\n", "output": "1504\n1599\n1502\n1598\n1502\n1510\n1657\n1502\n1763\n"}, {"type": "stdin_stdout", "input": "9\n1676\n1212\n1500\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n Define crossover operation over two equal-length strings A and B as follows:\n\n the result of that operation is a string of the same length as the input strings result[i] is chosen at random between A[i] and B[i...
[{"input": "[\"abc\", \"aaa\", \"aba\", \"bab\"]\n\"bbb\"", "output": "[2]", "fn_name": "strings_crossover"}, {"input": "[\"aacccc\", \"bbcccc\"]\n\"abdddd\"", "output": "[0]", "fn_name": "strings_crossover"}, {"input": "[\"a\", \"b\", \"c\", \"d\", \"e\"]\n\"c\"", "output": "[4]", "fn_name": "strings_crossover"}, {"in...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nn people came to a party. Then those, who had no friends among people at the party, left. Then those, who had exactly 1 friend among those who stayed, left as well. Then those, who had exactly 2, 3, ..., n - 1 friends amo...
[{"type": "stdin_stdout", "input": "1\n108\n", "output": "106\n"}, {"type": "stdin_stdout", "input": "1\n157\n", "output": "155\n"}, {"type": "stdin_stdout", "input": "1\n168\n", "output": "166\n"}, {"type": "stdin_stdout", "input": "1\n299\n", "output": "297\n"}, {"type": "stdin_stdout", "input": "1\n111\n", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAssume `\"#\"` is like a backspace in string. This means that string `\"a#bc#d\"` actually is `\"bd\"`\n\nYour task is to process a string with `\"#\"` symbols.\n\n\n## Examples\n\n```\n\"abc#d##c\" ==> \"ac\"\n\"ab...
[{"input": "\"831####jns###s#cas/*####-5##s##6+yqw87e##hfklsd-=-28##fds##\"", "output": "[\"6+yqw8hfklsd-=-f\"]", "fn_name": "clean_string"}, {"input": "\"####gfdsgf##hhs#dg####fjhsd###dbs########afns#######sdanfl##db#####s#a\"", "output": "[\"sa\"]", "fn_name": "clean_string"}, {"input": "\"gfh#jds###d#dsd####dasdaskh...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nBear Limak wants to become the largest of bears, or at least to become larger than his brother Bob.\n\nRight now, Limak and Bob weigh a and b respectively. It's guaranteed that Limak's weight is smaller than or equal to h...
[{"type": "stdin_stdout", "input": "10 10\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 10\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 10\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "11 12\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 43\n", "output": "10\n"}, {"ty...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGildong's town has a train system that has $100$ trains that travel from the bottom end to the top end and $100$ trains that travel from the left end to the right end. The trains starting from each side are numbered from ...
[{"type": "stdin_stdout", "input": "3\n1 2\n1\n3 4\n3 2\n2 3 11\n2 1\n9 14\n2 12 16 28 42 57 59 86 99\n3 9 14 19 25 26 20 35 41 59 85 87 99 100\n", "output": "0\n1\n2\n"}, {"type": "stdin_stdout", "input": "3\n1 2\n1\n1 4\n3 2\n1 3 4\n2 4\n9 14\n2 14 16 28 33 57 59 92 99\n3 9 14 19 25 26 28 35 41 59 85 87 99 100\n", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ chips arranged in a circle, numbered from $1$ to $n$. \n\nInitially each chip has black or white color. Then $k$ iterations occur. During each iteration the chips change their colors according to the followi...
[{"type": "stdin_stdout", "input": "101 2\nBWBWBWWWBWBWBWWWBWWWBWWWBWBBBBBWBWBBBWBWBWWBBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWWWBWBWBWB\n", "output": "BBBWWWWWWWBWWWWWWWWWWWWWWBBBBBBBBBBBBBBWWWWBBBBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWWWWWWWBWBBB\n"}, {"type": "stdin_stdout", "input": "101 2\nBWBWBWBWWWB...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nMobiles are widely known as moving works of art. The IOI Japan Committee has decided to create mobiles to publicize JOI. JOI public relations mobiles are sticks, strings, and weights. It is constructed as follo...
[{"type": "stdin_stdout", "input": "1\n7 22 0 0\n4\n2 2 0 4\n1 3 0 0\n9 10 2 1\n3 2 0 0\n0", "output": "29\n190\n"}, {"type": "stdin_stdout", "input": "1\n7 11 0 0\n4\n2 2 0 4\n1 3 0 0\n3 8 2 1\n3 2 0 0\n0", "output": "18\n110\n"}, {"type": "stdin_stdout", "input": "1\n7 22 0 0\n4\n2 2 0 4\n1 3 0 0\n3 8 2 1\n3 2 0 0\n0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nReading books is one of Sasha's passions. Once while he was reading one book, he became acquainted with an unusual character. The character told about himself like that: \"Many are my names in many countries. Mithrandir a...
[{"type": "stdin_stdout", "input": "tttdddssstttssstttdddddddddttttttdddsssdddtttsssdddsssssstttddddddtttdddssstttsssttttttdddtttsssssstttssssssssstttsssssstttssstttdddddddddsssdddssssssdddssstttsssdddssstttdddttttttdddddddddsssssstttdddtttssssssdddddddddttttttdddtttsssdddssstttsssdddssssssdddsssdddddddddtttssstttsssss...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's introduce a coo...
[{"type": "stdin_stdout", "input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\n3 0 1\n\n\nOutput\n\n2\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.\n\nWrite Python code to solve this problem. Your progra...
[{"type": "stdin_stdout", "input": "3\n152 -3 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "3\n13 -2 3", "output": "0\n"}, {"type": "stdin_stdout", "input": "3\n25 -2 3", "output": "0\n"}, {"type": "stdin_stdout", "input": "3\n25 -2 4", "outpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn 2N - 1 boxes there are apples and oranges. Your task is to choose N boxes so, that they will contain not less than half of all the apples and not less than half of all the oranges.\n\nInput\n\nThe first input line cont...
[{"type": "stdin_stdout", "input": "2\n2\n10 15\n5 7\n20 18\n1\n0 0\n", "output": "YES\n1 3 \nYES\n1 \n"}, {"type": "stdin_stdout", "input": "2\n2\n10 15\n5 7\n20 18\n1\n0 0\n", "output": "YES\n1 3 \nYES\n1 \n"}, {"type": "stdin_stdout", "input": "2\n2\n10 15\n5 11\n20 22\n1\n0 0\n", "output": "YES\n1 3\nYES\n1\n"}, {"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA: four tea\n\nproblem\n\nTea is indispensable for programming contests. Tea has the effect of relieving constant tension [citation needed]\n\nThere are N players participating in the contest, so I would like to prepare t...
[{"type": "stdin_stdout", "input": "10\n1 2 10 2\n0 0 0 15", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n1 1 3 2\n0 2 3 16", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n0 1 3 2\n1 2 3 16", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n0 1 6 1\n0 0 1 50", "output": "1\n"}, {"type": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPresident of Berland has a very vast office-room, where, apart from him, work his subordinates. Each subordinate, as well as President himself, has his own desk of a unique colour. Each desk is rectangular, and its sides ...
[{"type": "stdin_stdout", "input": "24 11 N\n.NNNNNNNNNN\n.NNNNNNNNNN\n........RRR\n........RRR\n........RRR\n..MMMMMMRRR\n..MMMMMMRRR\n..MMMMMMRRR\n..MMMMMM...\n....XXXXXXX\n...........\n.....CCCCCC\n.....CCCCCC\n.HHHHHHHHHH\n..VVVVV....\n..VVVVV....\n..VVVVV....\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV.I..\n.....
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nModern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the number of characters.\n\nIn this problem you should implement the simila...
[{"type": "stdin_stdout", "input": "255\nT___J(M_XZJlr_lH___mqJA_p__kW)ko__F_M_Aro__ZA_G_M_P_____j_V(J_Jk_dkR_ta_lbIUhKFfo_y_DluW)IVFj_gouRfMhabn()_e___q_vo__QPEGBI_TpVVI_clPwwb_m_yL_cMVKgi___RJb_J_f____tPCyntLOr_s_x_N_SyqQw_zP_mycsW_o_c_o_Yzb_UVa_ATd(BYH_gl___Y__Uzok_Y_IA_XL_D__bkJ____e__K_quk)\n", "output": "10 25\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider a currency system in which there are notes of six denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100.\nIf the sum of Rs. N is input, write a program to computer smallest number of notes that will...
[{"type": "stdin_stdout", "input": "3 \n1200\n1258\n242", "output": "12\n16\n7\n"}, {"type": "stdin_stdout", "input": "3 \n1200\n493\n380", "output": "12\n11\n7\n"}, {"type": "stdin_stdout", "input": "3 \n1200\n806\n380", "output": "12\n10\n7\n"}, {"type": "stdin_stdout", "input": "3\n1200\n500\n242\n", "output": "12\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to find Amir, one of his schoolmates and good friends.\n\nThere are n schools numerated from 1 to n. One can travel...
[{"type": "stdin_stdout", "input": "300997\n", "output": "150498\n"}, {"type": "stdin_stdout", "input": "273658\n", "output": "136828\n"}, {"type": "stdin_stdout", "input": "222057\n", "output": "111028\n"}, {"type": "stdin_stdout", "input": "456496\n", "output": "228247\n"}, {"type": "stdin_stdout", "input": "220343\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWith one die of 6 sides we will have six different possible results:``` 1, 2, 3, 4, 5, 6``` .\n\nWith 2 dice of six sides, we will have 36 different possible results:\n``` \n(1,1),(1,2),(2,1),(1,3),(3,1),(1,4),(4,1),(1,5...
[{"input": "[3, 15, 8, 20]", "output": "[44]", "fn_name": "eq_dice"}, {"input": "[5, 6, 4]", "output": "[5]", "fn_name": "eq_dice"}, {"input": "[6, 6]", "output": "[3]", "fn_name": "eq_dice"}, {"input": "[3, 3]", "output": "[0]", "fn_name": "eq_dice"}, {"input": "[3, 6]", "output": "[0]", "fn_name": "eq_dice"}, {"input...
code_functional