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\nD: Shiritori Compression\n\nproblem\n\nEbi-chan and Kana-chan did a shiritori. Ebi-chan is looking at the memo of the word that came out in Shiritori.\n\nEbi-chan wants to remove redundant continuous subsequences from thi...
[{"type": "stdin_stdout", "input": "7\nbanana\nta\ntomb\nbus\nsound\ndoes\nsome", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\nananab\nta\nsomb\nbus\nsound\ndoes\nsemo", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\nbanaoa\nta\ntomb\nbus\nsound\ndoes\nsome", "output": "2\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEric is the teacher of graph theory class. Today, Eric teaches independent set and edge-induced subgraph.\n\nGiven a graph $G=(V,E)$, an independent set is a subset of vertices $V' \\subset V$ such that for every pair $u,...
[{"type": "stdin_stdout", "input": "50\n21 10\n30 22\n3 37\n37 32\n4 27\n18 7\n2 30\n29 19\n6 37\n12 39\n47 25\n41 49\n45 9\n25 48\n16 14\n9 7\n33 28\n3 31\n34 16\n35 37\n27 40\n45 16\n29 44\n16 15\n26 15\n1 12\n2 13\n15 21\n43 14\n9 33\n44 15\n46 1\n38 5\n15 5\n1 32\n42 35\n20 27\n23 8\n1 16\n15 17\n36 50\n13 8\n49 45...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDexterina and Womandark have been arch-rivals since they’ve known each other. Since both are super-intelligent teenage girls, they’ve always been trying to solve their disputes in a peaceful and nonviolent way. After god ...
[{"type": "stdin_stdout", "input": "1000000 50\n0.034403 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.033928 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.071853 0.000000 0.000000 0.016440 0.000000 0.000000 0.000000 0.000000 0.023167 0.067938 0.000000 0.000000 0.000000 0.000000 0....
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese here \n\n------ Problem Statement ------ \n\nLira is a little girl form Bytenicut, a small and cozy village located in the country of Byteland.\n As the village is located on a...
[{"type": "stdin_stdout", "input": "2\n-1 -1 0 100 100 0\n1 2 0 11 14 1", "output": "2 1\n"}, {"type": "stdin_stdout", "input": "2\n-1 1 -1 010 000 0\n1 6 0 10 14 1", "output": "1 2\n"}, {"type": "stdin_stdout", "input": "2\n-1 1 -1 000 000 0\n1 6 0 10 14 1", "output": "1 2\n"}, {"type": "stdin_stdout", "input": "2\n-2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet f(A, B) be the exclusive OR of A, A+1, ..., B. Find f(A, B).\nWhat is exclusive OR?\nThe bitwise exclusive OR of integers c_1, c_2, ..., c_n (let us call it y) is defined as follows:\n - When y is written in base two,...
[{"type": "stdin_stdout", "input": "1000000000000 1000000000000\n", "output": "1000000000000\n"}, {"type": "stdin_stdout", "input": "123456789012 123456789012\n", "output": "123456789012\n"}, {"type": "stdin_stdout", "input": "250874886258 260155437540\n", "output": "260155437541\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have $n$ coins, each of the same value of $1$.\n\nDistribute them into packets such that any amount $x$ ($1 \\leq x \\leq n$) can be formed using some (possibly one or all) number of these packets.\n\nEach packet may ...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "30"}, {"type": "stdin_stdout", "input": "723061816\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "517188853\n", "output": "29\n"}, {"type": "stdin_stdout", "input": "237913214\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe smallest unit of data handled by a computer is called a bit, and the amount of information that represents multiple bits together is called a word. Currently, many computers process one word as 32 bits.\n\nFor a compu...
[{"type": "stdin_stdout", "input": "-322", "output": "-10304\n"}, {"type": "stdin_stdout", "input": "-542", "output": "-17344\n"}, {"type": "stdin_stdout", "input": "-130", "output": "-4160\n"}, {"type": "stdin_stdout", "input": "-133", "output": "-4256\n"}, {"type": "stdin_stdout", "input": "-199", "output": "-6368\n"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Chef commutes to work every day using the city's underground metro. The schedule for the trains has recently been changed and he wants to know how long it will take to travel from the station nearest to his house and ...
[{"type": "stdin_stdout", "input": "3\n2\n0 3 6\n0 6 8\n2\n0 -1 3\n12 4 1\n2\n0 1 8\n0 0 12", "output": "14\n16\n12\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 4 12\n-1 8 5\n2\n-1 1 2\n6 8 10\n2\n1 1 5\n0 2 3", "output": "12\n14\n5\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 3 7\n0 6 5\n2\n0 -1 3\n12 4 1\n2\n1 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA tree is a connected undirected graph consisting of n vertices and n - 1 edges. Vertices are numbered 1 through n.\n\nLimak is a little polar bear and Radewoosh is his evil enemy. Limak once had a tree but Radewoosh stol...
[{"type": "stdin_stdout", "input": "11005 209 166\n", "output": "1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n11 12\n12 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 33\n33 34\n34 35\n35 36\n36 37\n37 38\n38 39\n39 40\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n Given an array `arr`, find the rank of the element at the ith position.\n\n The `rank` of the arr[i] is a value equal to the number of elements `less than or equal to` arr[i] standing before arr[i], plus the numb...
[{"input": "[2, 1, 2, 1, 2]\n2", "output": "[3]", "fn_name": "rank_of_element"}, {"input": "[2, 1, 2, 2, 2]\n2", "output": "[2]", "fn_name": "rank_of_element"}, {"input": "[3, 2, 3, 4, 1]\n0", "output": "[2]", "fn_name": "rank_of_element"}, {"input": "[3, 2, 3, 4, 1]\n1", "output": "[1]", "fn_name": "rank_of_element"},...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nSet\n\nGiven the sequence a_1, a_2, .., a_N.\n\nHow many values ​​are there in this sequence?\n\ninput\n\n\nN\na_1 a_2 ... a_N\n\n\noutput\n\nOutput the number of types of values ​​in the sequence.\n\nConstraint\n\n* 1 \\...
[{"type": "stdin_stdout", "input": "6\n-4 -3 1 -1 27 -1", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 63 -1 3 -1", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n-2 -1 25 -2 4 0", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n-1 -1 25 -2 4 0", "output": "5\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer sequence $a_1, a_2, \\dots, a_n$.\n\nFind the number of pairs of indices $(l, r)$ ($1 \\le l \\le r \\le n$) such that the value of median of $a_l, a_{l+1}, \\dots, a_r$ is exactly the given numbe...
[{"type": "stdin_stdout", "input": "15 2\n1 2 3 1 2 3 1 2 3 1 2 3 1 2 3\n", "output": "97\n"}, {"type": "stdin_stdout", "input": "15 1\n1 2 3 1 2 3 1 2 3 1 2 3 1 2 3\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "15 1\n1 2 3 0 2 3 1 2 3 1 2 3 1 2 3\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "15...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMarcin is a coach in his university. There are n students who want to attend a training camp. Marcin is a smart coach, so he wants to send only the students that can work calmly with each other.\n\nLet's focus on the stud...
[{"type": "stdin_stdout", "input": "10\n206158430208 206162624513 68719476737 137506062337 206162624513 4194305 68719476737 206225539072 137443147777 68719476736\n202243898 470292528 170057449 290025540 127995253 514454151 607963029 768676450 611202521 68834463\n", "output": "2773043292\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSunuke-kun's dictionary contains the words s1, ..., sn, which consist of n lowercase letters. This satisfies s1 <... <sn when compared in lexicographical order. Unfortunately, some characters are faint and unreadable. Unr...
[{"type": "stdin_stdout", "input": "2\n?rum??mer\nc??a??mp", "output": "715167440\n"}, {"type": "stdin_stdout", "input": "2\n?sum??mer\nc??a??mp", "output": "703286064"}, {"type": "stdin_stdout", "input": "2\n?rum??mer\nc@?a??mp", "output": "0\n"}, {"type": "stdin_stdout", "input": "2\n?rum??mer\ncA?a??mp", "output": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAs a German University in Cairo (GUC) student and a basketball player, Herr Wafa was delighted once he heard the news. GUC is finally participating in the Annual Basketball Competition (ABC). \n\nA team is to be formed of...
[{"type": "stdin_stdout", "input": "65 173 136\n26 18 8 11 1 22 44 6 15 22 13 49 30 36 37 41 25 27 9 36 36 1 45 20 7 47 28 30 30 21 33 32 9 11 16 5 19 12 44 40 25 40 32 36 15 34 4 43 28 19 29 33 7 11 18 13 40 18 10 26 1 48 20 38 1 20 34 8 46 8 32 35 16 49 26 36 11 16 4 29 35 44 14 21 22 42 10 1 3 12 35 30 14 45 2 24 32...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFind the sum of weights of edges of the Minimum Spanning Tree for a given weighted undirected graph G = (V, E).\n\nConstraints\n\n* 1 ≤ |V| ≤ 10,000\n* 0 ≤ |E| ≤ 100,000\n* 0 ≤ wi ≤ 10,000\n* The graph is connected\n* The...
[{"type": "stdin_stdout", "input": "6 1\n0 1 -1\n1 0 2\n1 2 8\n-1 3 13\n0 0 -1\n1 -1 11\n7 0 0\n2 1 2\n1 8 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 9\n0 2 1\n0 2 3\n0 2 2\n0 3 7\n2 4 5\n1 4 3\n3 2 1\n3 3 1\n2 5 10", "output": "20\n"}, {"type": "stdin_stdout", "input": "6 9\n0 2 1\n0 2 3\n2 0 2\n1 3 7...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAndryusha is an orderly boy and likes to keep things in their place.\n\nToday he faced a problem to put his socks in the wardrobe. He has n distinct pairs of socks which are initially in a bag. The pairs are numbered from...
[{"type": "stdin_stdout", "input": "50\n50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 10 4 3 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSasha lives in a big happy family. At the Man's Day all the men of the family gather to celebrate it following their own traditions. There are n men in Sasha's family, so let's number them with integers from 1 to n.\n\nEa...
[{"type": "stdin_stdout", "input": "4 3\n1 2\n2 3\n3 4\n1 2 3 4\n", "output": "4\n4\n3\n2\n1\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n2 3\n3 4\n1 2 3 3\n", "output": "3\n3\n2\n1\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n2 3\n3 4\n1 1 3 4\n", "output": "3\n4\n3\n1\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMishka got an integer array $a$ of length $n$ as a birthday present (what a surprise!).\n\nMishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it \"Mishka's Adjacent Re...
[{"type": "stdin_stdout", "input": "10\n10100 18 108515962 1 16 111 2 999999999 60506056 1000000000\n", "output": "10099 17 108515961 1 15 111 1 999999999 60506055 999999999\n"}, {"type": "stdin_stdout", "input": "10\n10100 12 108515962 1 5 101 2 999999999 60506056 1000000000\n", "output": "10099 11 108515961 1 5 101 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.\n\nLet's assume that a song...
[{"type": "stdin_stdout", "input": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe get more and more news about DDoS-attacks of popular websites.\n\nArseny is an admin and he thinks that a website is under a DDoS-attack if the total number of requests for a some period of time exceeds $100 \\cdot t$,...
[{"type": "stdin_stdout", "input": "100\n70 111 5 73 69 22 79 62 101 99 249 88 75 31 27 49 7 36 37 62 61 77 75 38 203 61 81 43 98 224 114 48 98 8 67 46 80 83 81 64 15 72 95 39 79 93 79 140 27 65 67 44 294 170 89 97 73 48 18 53 31 49 47 13 88 70 5 46 256 81 26 9 89 38 43 28 219 30 10 71 96 95 241 96 98 96 82 29 219 85 5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlmost Identical Programs\n\nThe programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two...
[{"type": "stdin_stdout", "input": "print\"hello\";print133\nprint\"hello\";print123\nread\"B1input\";solve;output;\n;tuptuo;evlos;\"2B\"daer\nread\"C1\";solve;output\"C1ans\";\nread\"C2\";solve;output\"C2ans\";\n\"\"\"\"\"\"\"\"\n\"\"\"42\"\"#\"\"\nslow\"program\"\nfast\"code\"\n\"super\"fast\"program\"\n\"super\"fast...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPeter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so me...
[{"type": "stdin_stdout", "input": "2\ndevelopment:alice,bob,design,eve.\ndesign:carol,alice.\n3\none:another.\nanother:yetanother.\nxetanother:dave.\n3\nfriends:alice,bob,bestfriends,carol,fran,badcompany.\nbestfriends:eve,alice.\nbadcompany:dave,carol.\n5\na:b,c,d,e.\nb:c,d,e,f.\nc:d,e,f,g.\nd:e,f,g,h.\ne:f,g,h,i.\n4...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n---\n\n# Hint\n\n\nThis Kata is an extension of the earlier ones in this series. Completing those first will make this task easier.\n\n# Background\n\nMy TV remote control has arrow buttons and an `OK` button.\n\nI can us...
[{"input": "\"^~?!'\\\"()-:;+&%*=<>\\u20ac\\u00a3$\\u00a5\\u00a4\\\\[]{},.@\\u00a7#\\u00bf\\u00a1_/ \"", "output": "[88]", "fn_name": "tv_remote"}, {"input": "\"The Quick Brown Fox Jumps Over A Lazy Dog.\"", "output": "[262]", "fn_name": "tv_remote"}, {"input": "\"abcde123fghij456klmno789pqrst.@0uvwxyz_/ \"", "output":...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two strings. In a single move, you can choose any of them, and delete the first (i.e. leftmost) character.\n\nFor Example:\n\n* By applying a move to the string `\"where\"`, the result is the string `\"here\...
[{"input": "\"nogkvcdldfpvlbkpedsecl\"\n\"nogkvcdldfpvlbkpedsecl\"", "output": "[0]", "fn_name": "shift_left"}, {"input": "\"abacabadabacaba\"\n\"abacabadacaba\"", "output": "[18]", "fn_name": "shift_left"}, {"input": "\"test\"\n\"west\"", "output": "[2]", "fn_name": "shift_left"}, {"input": "\"dadc\"\n\"dddc\"", "outp...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nTetris is a game in which falling blocks are lined up on the board and erased. Here, let's consider a game that arranges it a little.\n\nThe size of the board of this game is 5 frames wide, and it is high enough to accomm...
[{"type": "stdin_stdout", "input": "4\n2 4 1\n1 3 1\n2 2 4\n2 3 5\n1\n1 5 1\n7\n2 2 2\n1 1 1\n2 1 3\n1 4 1\n1 1 1\n2 5 5\n1 4 2\n0", "output": "12\n0\n13\n"}, {"type": "stdin_stdout", "input": "4\n2 4 1\n1 3 1\n2 2 4\n2 3 5\n1\n1 5 1\n7\n2 2 2\n1 1 1\n2 0 3\n1 4 1\n1 1 1\n2 5 5\n1 4 2\n0", "output": "12\n0\n12\n"}, {"t...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOne day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes sh...
[{"type": "stdin_stdout", "input": "302 143 40 63 452\n100\nXXL\nM\nXL\nS\nXXL\nS\nL\nXL\nXL\nXL\nXXL\nS\nXXL\nS\nXXL\nXL\nXL\nXXL\nXL\nXXL\nM\nS\nS\nS\nS\nXXL\nS\nL\nXL\nXXL\nXXL\nS\nXXL\nL\nXXL\nM\nS\nL\nL\nXL\nXL\nS\nXL\nL\nXL\nM\nXL\nL\nM\nS\nXL\nXXL\nXL\nL\nXL\nXL\nXL\nM\nM\nXL\nL\nS\nS\nXL\nS\nXXL\nXXL\nXL\nS\nXL...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMake a wish to a shooting star\n\nThe mysterious organization JAG (Japanese Alumni Group) holds regular meetings. One day, the agenda was \"How to enable participating teams to demonstrate their strength in the upcoming I...
[{"type": "stdin_stdout", "input": "1\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\n2\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\n10.0000 0.0000 0.0000 -2.0000 0.0000 0.0000 4.0000 1.0000\n5\n-10.0000 0.5301491670709055 0.0000 10.0000 0.15723569039702578 0.6247894746810593 2.0000 1.0000\n-5.00...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBizon the Champion isn't just a bison. He also is a favorite of the \"Bizons\" team.\n\nAt a competition the \"Bizons\" got the following problem: \"You are given two distinct words (strings of English letters), s and t. ...
[{"type": "stdin_stdout", "input": "itwtyhhsdjjffmmoqkkhxjouypznewstyorotxhozlytndehmaxogrohccnqcgkrjrdmnuaogiwmnmsbdaizqkxnkqxxiihbwepc\nsnixfywvcntitcefsgqxjcodwtumurcglfmnamnowzbjzmfzspbfuldraiepeeiyasmrsneekydsbvazoqszyjxkjiotushsddet\n", "output": "need tree\n"}, {"type": "stdin_stdout", "input": "yyyyxxxxyxyyxxxy...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same color are indistinguishable. He draws balls from the bag one by one until the bag...
[{"type": "stdin_stdout", "input": "47\n20\n21\n16\n18\n24\n20\n25\n13\n20\n22\n26\n24\n17\n18\n21\n22\n21\n23\n17\n15\n24\n19\n18\n21\n20\n19\n26\n25\n20\n17\n17\n17\n26\n32\n20\n21\n25\n28\n24\n21\n21\n17\n28\n20\n20\n31\n19\n", "output": "295545118\n"}, {"type": "stdin_stdout", "input": "47\n20\n21\n16\n18\n24\n20\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTaro's Shopping\n\nMammy decided to give Taro his first shopping experience. Mammy tells him to choose any two items he wants from those listed in the shopping catalogue, but Taro cannot decide which two, as all the items...
[{"type": "stdin_stdout", "input": "3 13\n17 20 30\n6 7\n1 2 5 1 4 11\n7 000\n22 34 102 94 59 39 61\n4 100\n133 98 100 50\n4 5\n10 5 10 13\n0 0", "output": "NONE\n7\nNONE\nNONE\nNONE\n"}, {"type": "stdin_stdout", "input": "3 48\n17 20 30\n6 1\n1 2 5 1 4 11\n7 000\n22 34 102 94 59 39 70\n4 100\n80 70 119 50\n4 20\n10 5 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOne day Vasya went out for a walk in the yard but there weren't any of his friends outside and he had no one to play touch and run. But the boy didn't lose the high spirits and decided to play touch and run with himself. ...
[{"type": "stdin_stdout", "input": "1000 2000\n226 566\n20\n0 -100\n-100 100\n100 0\n42 0\n-100 -79\n-66 -16\n0 -7\n-1 0\n0 100\n100 91\n99 0\n1 0\n-100 0\n70 -100\n-100 100\n100 1\n66 0\n-100 1\n-47 -100\n-42 0\n", "output": "708\n"}, {"type": "stdin_stdout", "input": "1010 2000\n226 566\n20\n0 -100\n-100 100\n100 0\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya has got an array consisting of $n$ integers, and two integers $k$ and $len$ in addition. All numbers in the array are either between $1$ and $k$ (inclusive), or equal to $-1$. The array is good if there is no segmen...
[{"type": "stdin_stdout", "input": "10 42 7\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "645711643\n"}, {"type": "stdin_stdout", "input": "10 42 7\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "645711643\n"}, {"type": "stdin_stdout", "input": "10 32 7\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "61884984"}, {"type": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Bubblesort Algorithm\n\n## Overview\n\nThe Bubblesort Algorithm is one of many algorithms used to sort a list of similar items (e.g. all numbers or all letters) into either ascending order or descending order. Given a ...
[{"input": "[6, 3, 4, 15, 14, 9, 1, 2, 7, 8, 5, 14, 11, 15, 17, 19]", "output": "[[3, 4, 6, 14, 9, 1, 2, 7, 8, 5, 14, 11, 15, 15, 17, 19]]", "fn_name": "bubblesort_once"}, {"input": "[9, 7, 5, 3, 1, 2, 4, 6, 8]", "output": "[[7, 5, 3, 1, 2, 4, 6, 8, 9]]", "fn_name": "bubblesort_once"}, {"input": "[6, 3, 4, 9, 1, 2, 7, ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe ICPC committee would like to have its meeting as soon as possible to address every little issue of the next contest. However, members of the committee are so busy maniacally developing (possibly useless) programs that...
[{"type": "stdin_stdout", "input": "3 2\n2 1 2\n-1\n3 3 8 8\n3 2\n4 1 5 0 9\n3 2 5 9\n5 2 4 5 7 12\n3 3\n0 1 4\n3 2 5 9\n2 2 4\n3 3\n2 1 1\n3 1 2 9\n2 2 4\n0 0", "output": "8\n5\n0\n1\n"}, {"type": "stdin_stdout", "input": "3 2\n2 1 2\n-1\n3 3 8 8\n3 2\n4 1 5 0 9\n3 2 5 9\n5 2 4 5 7 12\n3 3\n0 1 4\n3 2 5 9\n2 2 4\n3 3\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet’s play a stone removing game.\n\nInitially, n stones are arranged on a circle and numbered 1, ... , n clockwise (Figure 1). You are also given two numbers k and m. From this state, remove stones one by one following t...
[{"type": "stdin_stdout", "input": "12 2 3\n100 15522 98\n10000 10000 10000\n0 0 0", "output": "10\n89\n2019\n"}, {"type": "stdin_stdout", "input": "12 2 3\n100 15914 98\n10000 10000 10000\n0 0 0", "output": "10\n16\n2019\n"}, {"type": "stdin_stdout", "input": "12 2 3\n100 15914 98\n10001 10000 10000\n0 0 0", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe country of Byalechinsk is running elections involving n candidates. The country consists of m cities. We know how many people in each city voted for each candidate.\n\nThe electoral system in the country is pretty unu...
[{"type": "stdin_stdout", "input": "100 1\n439 158 619 538 187 153 973 781 610 475 94 1829 449 531 220 51 788 118 189 501 54 434 465 902 280 635 688 214 737 327 682 690 683 519 261 923 254 388 529 659 662 276 376 735 976 664 521 285 42 147 187 259 407 977 879 465 522 17 550 701 114 921 577 265 668 812 232 267 135 371 4...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:\n\n$\\sum_{i = 1}^{a} \\sum_{j = 1}^{b} \\sum_{k = 1}^{c} d(i \\cd...
[{"type": "stdin_stdout", "input": "100 100 100\n", "output": "51103588\n"}, {"type": "stdin_stdout", "input": "100 100 100\n", "output": "51103588"}, {"type": "stdin_stdout", "input": "98 34 100\n", "output": "13589991\n"}, {"type": "stdin_stdout", "input": "90 82 100\n", "output": "35482866\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ products in the shop. The price of the $i$-th product is $a_i$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.\n\nIn fact, the owner of the s...
[{"type": "stdin_stdout", "input": "5\n8 19551489\n31131899 17585660 3913937 14521321 9846714 96097161 115568124 35051437\n1 93900441\n15578410\n7 19560555\n124492495 53703939 20259503 99698023 98868060 83313210 5487534\n6 72321938\n59271765 72426489 16625497 51598082 31475864 20946400\n7 44965081\n49955408 62397026 39...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAndrew was very excited to participate in Olympiad of Metropolises. Days flew by quickly, and Andrew is already at the airport, ready to go home. He has $n$ rubles left, and would like to exchange them to euro and dollar ...
[{"type": "stdin_stdout", "input": "100000000\n30\n30\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "100000000\n30\n30\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "100000000\n60\n30\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "100000000\n31\n33\n", "output": "0\n"}, {"type": "stdin_...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven the sum and gcd of two numbers, return those two numbers in ascending order. If the numbers do not exist, return `-1`, (or `NULL` in C, `tuple (-1,-1)` in C#, `pair (-1,-1)` in C++,`None` in Rust, `array {-1,-1} ` i...
[{"input": "1000\n5", "output": "[[5, 995]]", "fn_name": "solve"}, {"input": "50\n10", "output": "[[10, 40]]", "fn_name": "solve"}, {"input": "100\n5", "output": "[[5, 95]]", "fn_name": "solve"}, {"input": "12\n4", "output": "[[4, 8]]", "fn_name": "solve"}, {"input": "10\n5", "output": "[[5, 5]]", "fn_name": "solve"}, ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nLeha is playing a very interesting game. The game will be played on a rectangular grid consisting of N rows and M columns. Initially all th...
[{"type": "stdin_stdout", "input": "1\n16 -10", "output": "-326\n"}, {"type": "stdin_stdout", "input": "1\n32 -10", "output": "-662\n"}, {"type": "stdin_stdout", "input": "1\n23 -10", "output": "-473\n"}, {"type": "stdin_stdout", "input": "1\n23 -20", "output": "-923\n"}, {"type": "stdin_stdout", "input": "1\n17 -20", ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers numbered from $1$ to $n$.\n\nLet's define the $k$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $k...
[{"type": "stdin_stdout", "input": "3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1\n", "output": "-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1 \n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 1 2\n5\n4 4 4 3 2\n6\n1 4 3 5 1 1\n", "output": "-1 -1 1 1 1\n-1 -1 4 3 2\n-1 -1 -1 1 1 1\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have recently fallen through a hole and, after several hours of unconsciousness, have realized you are in an underground city. On one of your regular, daily walks through the unknown, you have encountered two unusuall...
[{"type": "stdin_stdout", "input": "11\nfghdgrakmnq\n8\nfgh 4\ngh 3\nh 10\nhdg 6\nhdgra 7\nakm 12\nrakm 5\na 15\n3\n", "output": "52\n"}, {"type": "stdin_stdout", "input": "11\nfghdgrakmnq\n8\nfgh 4\ngh 3\nh 10\nhdg 6\nargdh 7\nakm 12\nrakm 5\na 15\n3\n", "output": "52\n"}, {"type": "stdin_stdout", "input": "11\nfghdgr...
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 12\nR..R\nR..R\nRRRR\nRRRR\nR..R\nR..R\n5 5 4\nRRR..\nR.R..\nRRR..\nR..R.\nR.R..\n2 31 62\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n", "output": "aaabb\ncccbb\nccccc\naaaa\nbbbb\nccdd\nhgfe\nijjj\nlllk\naaabb\nbbbbb\nbcccc\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour job is to create a calculator which evaluates expressions in [Reverse Polish notation](http://en.wikipedia.org/wiki/Reverse_Polish_notation).\n\nFor example expression `5 1 2 + 4 * + 3 -` (which is equivalent to `5 +...
[{"input": "\"5 1 2 + 4 * + 3 -\"", "output": "[14]", "fn_name": "calc"}, {"input": "\"10000 123 +\"", "output": "[10123]", "fn_name": "calc"}, {"input": "\"1 3 -\"", "output": "[-2]", "fn_name": "calc"}, {"input": "\"3.5\"", "output": "[3.5]", "fn_name": "calc"}, {"input": "\"1 3 +\"", "output": "[4]", "fn_name": "cal...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ integer numbers $a_1, a_2, \\dots, a_n$. Consider graph on $n$ nodes, in which nodes $i$, $j$ ($i\\neq j$) are connected if and only if, $a_i$ AND $a_j\\neq 0$, where AND denotes the bitwise AND operatio...
[{"type": "stdin_stdout", "input": "150\n0 0 0 0 0 0 0 2537672836907008 0 0 0 0 0 0 16384 0 0 0 0 34360787232 0 0 70871155232 0 0 0 0 0 0 0 0 0 0 0 2256197860262016 0 0 0 0 0 0 0 0 0 0 536872961 0 0 0 0 0 0 0 0 0 0 33619968 0 0 0 0 0 0 0 0 0 0 0 0 37189881297899520 0 18031990695526400 0 0 1099511627776 0 0 0 0 0 0 0 0 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n### Description\nAs hex values can include letters `A` through to `F`, certain English words can be spelled out, such as `CAFE`, `BEEF`, or `FACADE`.\nThis vocabulary can be extended by using numbers to represent other le...
[{"input": "\"DO YOU SEE THAT BEE DRINKING DECAF COFFEE\"", "output": "[13565769]", "fn_name": "hex_word_sum"}, {"input": "\"ASSESS ANY BAD CODE AND TRY AGAIN\"", "output": "[10889952]", "fn_name": "hex_word_sum"}, {"input": "\"DEFACE\"", "output": "[14613198]", "fn_name": "hex_word_sum"}, {"input": "\"SAFE\"", "output...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya plays the sleuth with his friends. The rules of the game are as follows: those who play for the first time, that is Vasya is the sleuth, he should investigate a \"crime\" and find out what is happening. He can ask a...
[{"type": "stdin_stdout", "input": "ARIWmwqFqxsQXsXXzHqvFjxOCttAGPUzDtWzsenPYdNXuFOIUGYZsLLK IaoxiyjBBRThoelwdPTkuCQfcBLUEJpCPIrVZlvUWA?\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "ARIWmwqFqxsQXsXXzHqvFjxOCttAGPUzDtWzsenPYdNXuFOIUGYZsLLK IaoxiykBBRThoelwdPTkuCQfcBLUEJpCPIrVZlvUWA?\n", "output": "YES\n"},...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp has $26$ tasks. Each task is designated by a capital letter of the Latin alphabet.\n\nThe teacher asked Polycarp to solve tasks in the following way: if Polycarp began to solve some task, then he must solve it to...
[{"type": "stdin_stdout", "input": "5\n3\nABA\n11\nDDBBCCCBBEZ\n7\nFFGZZZY\n1\nZ\n2\nAB\n", "output": "\nNO\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n3\nABA\n11\nDDBBCCCBBEZ\n7\nFFGZZZY\n1\nZ\n2\nAB\n", "output": "NO\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1\n24\nDEBOOFORCEDMETODO...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have been recruited by an unknown organization for your cipher encrypting/decrypting skills. \nBeing new to the organization they decide to test your skills. \nYour first test is to write an algorithm that encrypts ...
[{"input": "\"welcome to the organization\"", "output": "[\"qibkyai ty tfi yvgmzenmteyz\"]", "fn_name": "encrypter"}, {"input": "\"my name is\"", "output": "[\"ao zmai eu\"]", "fn_name": "encrypter"}, {"input": "\"goodbye\"", "output": "[\"gyyjloi\"]", "fn_name": "encrypter"}, {"input": "\"hello\"", "output": "[\"fibby...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven n number of people in a room, calculate the probability that any two people in that room have the same birthday (assume 365 days every year = ignore leap year). Answers should be two decimals unless whole (0 or 1) e...
[{"input": "15", "output": "[0.25]", "fn_name": "calculate_probability"}, {"input": "5", "output": "[0.03]", "fn_name": "calculate_probability"}, {"input": "365", "output": "[1]", "fn_name": "calculate_probability"}, {"input": "366", "output": "[1]", "fn_name": "calculate_probability"}, {"input": "1", "output": "[0]", ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nFans of The Wire will appreciate this one. \nFor those that haven't seen the show, the Barksdale Organization has a simple method for encoding telephone numbers exchanged via pagers: \"Jump to the other side of the 5 on t...
[{"input": "\"4103432323\"", "output": "[\"6957678787\"]", "fn_name": "decode"}, {"input": "\"4103438970\"", "output": "[\"6957672135\"]", "fn_name": "decode"}, {"input": "\"4104305768\"", "output": "[\"6956750342\"]", "fn_name": "decode"}, {"input": "\"4102204351\"", "output": "[\"6958856709\"]", "fn_name": "decode"},...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe educational program (AHK Education) of the Aiz Broadcasting Association broadcasts a handicraft program for children, \"Play with Tsukuro\". Today is the time to make a rectangle with sticks, but I would like to see i...
[{"type": "stdin_stdout", "input": "-1 -2 1 11", "output": "no\n"}, {"type": "stdin_stdout", "input": "-1 -2 1 19", "output": "no\n"}, {"type": "stdin_stdout", "input": "-2 -2 1 1", "output": "yes\n"}, {"type": "stdin_stdout", "input": "-1 4 4 10", "output": "no\n"}, {"type": "stdin_stdout", "input": "-1 1 4 10", "outp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an initial 2-value array (x). You will use this to calculate a score.\n\nIf both values in (x) are numbers, the score is the sum of the two. If only one is a number, the score is that number. If neither is a...
[{"input": "[9, 3]", "output": "[[[9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3], [9, 3]]]", "fn_name": "explode"}, {"input": "[6, \"c\"]", "output": "[[[6, \"c\"], [6, \"c\"], [6, \"c\"], [6, \"c\"], [6, \"c\"], [6, \"c\"]]]", "fn_name": "explode"}, {"input": "[\"a\", 3]", "outp...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou play your favourite game yet another time. You chose the character you didn't play before. It has $str$ points of strength and $int$ points of intelligence. Also, at start, the character has $exp$ free experience poin...
[{"type": "stdin_stdout", "input": "5\n1 1 100000000\n100000000 100000000 100000000\n100000000 1 100000000\n1 100000000 100000000\n100000000 100000000 1\n", "output": "50000000\n50000000\n100000000\n1\n1\n"}, {"type": "stdin_stdout", "input": "5\n1 1 100000000\n100000000 100000000 100000000\n100000000 1 100000000\n1 10...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEach evening after the dinner the SIS's students gather together to play the game of Sport Mafia. \n\nFor the tournament, Alya puts candies into the box, which will serve as a prize for a winner. To do that, she performs ...
[{"type": "stdin_stdout", "input": "1000000000 846040702\n", "output": "999939239\n"}, {"type": "stdin_stdout", "input": "1000000000 315152540\n", "output": "999948715\n"}, {"type": "stdin_stdout", "input": "1000000000 315152540\n", "output": "999948715"}, {"type": "stdin_stdout", "input": "1000000000 846040702\n", "ou...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nCan the greatest common divisor and bitwise operations have anything in common? It is time to answer this question.\n\nSuppose you are given a positive integer $a$. You want to choose some integer $b$ from $1$ to $a - 1$ ...
[{"type": "stdin_stdout", "input": "9\n30\n11\n12\n122\n136\n92\n1984716\n217\n14628115\n", "output": "31\n15\n15\n127\n255\n127\n2097151\n255\n16777215\n"}, {"type": "stdin_stdout", "input": "9\n30\n7\n12\n122\n136\n92\n1984716\n204\n14628115\n", "output": "31\n1\n15\n127\n255\n127\n2097151\n255\n16777215\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have N points in a two-dimensional plane.\n\nThe coordinates of the i-th point (1 \\leq i \\leq N) are (x_i,y_i).\n\nLet us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more o...
[{"type": "stdin_stdout", "input": "4 3\n-1000000000 -1000000000\n1000000000 1000000000\n-999999999 999999999\n999999999 -999999999\n", "output": "3999999996000000001\n"}, {"type": "stdin_stdout", "input": "4 3\n-1000000000 -1000000000\n1000000000 1000000000\n-999999999 999999999\n999999999 -1704052742", "output": "400...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLeonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm × h mm sheet of glass, a diamond glass cutter and lots of enthusiasm. What he lac...
[{"type": "stdin_stdout", "input": "5 30 10\nH 8\nH 9\nV 1\nH 2\nH 5\nH 3\nH 1\nV 2\nH 13\nV 3\n", "output": "110\n105\n84\n84\n84\n84\n84\n63\n51\n34\n"}, {"type": "stdin_stdout", "input": "5 15 10\nH 8\nH 9\nV 1\nH 2\nH 6\nH 4\nH 1\nV 2\nH 13\nV 3\n", "output": "40\n40\n32\n24\n24\n24\n24\n18\n12\n8\n"}, {"type": "st...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nJohn Doe has an n × m table. John Doe can paint points in some table cells, not more than one point in one table cell. John Doe wants to use such operations to make each square subtable of size n × n have exactly k points...
[{"type": "stdin_stdout", "input": "100 1000000000000000000 5000\n", "output": "824224847\n"}, {"type": "stdin_stdout", "input": "100 1000000000000000000 1221\n", "output": "43180268\n"}, {"type": "stdin_stdout", "input": "79 1000000000000000000 3107\n", "output": "631080535\n"}, {"type": "stdin_stdout", "input": "100 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAsmany strings are strings of '0's and '1's that have as many 00 as 11. A string such as 00110001 consists of 3 \"00\" and\n1 \"11\". Of course this is not an Asmany string. 0011, 1100, 000111000111 are Asmany strings. An...
[{"type": "stdin_stdout", "input": "2\n12\n12", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n12\n4", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n18\n12", "output": "NO\nYES\n"}, {"type": "stdin_stdout", "input": "2\n12\n6", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n[Image] \n\n\n-----Input-----\n\nThe input consists of four lines, each line containing a single digit 0 or 1.\n\n\n-----Output-----\n\nOutput a single digit, 0 or 1.\n\n\n-----Example-----\nInput\n0\n1\n1\n0\n\nOutput\n0...
[{"type": "stdin_stdout", "input": "0\n1\n1\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "0\n0\n0\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n0\n0\n0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "0\n1\n0\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n1\n0\n0\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nGiven a sequence of n integers a1, a2, ..., an and a positive integer k (1 ≤ k ≤ n), then the sum of k consecutive integers Si = ai + ai + Create a program that outputs the maximum value of 1 + ... + ai + k-1 (...
[{"type": "stdin_stdout", "input": "5 1\n-1\n18\n-4\n17\n2\n0 0", "output": "18\n"}, {"type": "stdin_stdout", "input": "5 1\n-1\n3\n-4\n30\n2\n0 0", "output": "30\n"}, {"type": "stdin_stdout", "input": "5 3\n2\n13\n-3\n27\n1\n0 0", "output": "37\n"}, {"type": "stdin_stdout", "input": "5 1\n2\n10\n-4\n14\n2\n0 0", "outp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – ... - (2kx, 0) – (2kx + x, x) – .... \n\nWe know that the polyline passes through the point (a, b). Find minimum positive value x su...
[{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": " 1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "999999999.5000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 111111111\n", "output": "111111111...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya loves computer games. Finally a game that he's been waiting for so long came out!\n\nThe main character of this game has n different skills, each of which is characterized by an integer a_{i} from 0 to 100. The high...
[{"type": "stdin_stdout", "input": "100 10000\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nConstraints\n\n* 0 < r < 10000\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circ...
[{"type": "stdin_stdout", "input": "-210", "output": "138544.236023275 -1319.46891451\n"}, {"type": "stdin_stdout", "input": "-215", "output": "145220.120412152 -1350.88484104\n"}, {"type": "stdin_stdout", "input": "-113", "output": "40114.996593678 -709.999939711\n"}, {"type": "stdin_stdout", "input": "-114", "output"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nEnter a positive integer n of 4,000 or less, with a pair of integers a, b, c, d in the range 0-1000.\n\n\na + b + c + d = n\n\n\nCreate a program that outputs the number of combinations that satisfy the conditions.\n\n\n\...
[{"type": "stdin_stdout", "input": "2\n-1\n207", "output": "10\n0\n1521520\n"}, {"type": "stdin_stdout", "input": "2\n-1\n254", "output": "10\n0\n2796160\n"}, {"type": "stdin_stdout", "input": "2\n-1\n326", "output": "10\n0\n5881204\n"}, {"type": "stdin_stdout", "input": "2\n-1\n100", "output": "10\n0\n176851\n"}, {"ty...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no two soldiers should share a name (what would happen if they got an order that Bob ...
[{"type": "stdin_stdout", "input": "50 2\nYES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES\n", "output": "Aa Ab Ac Ad Ae Af Ag Ah Ai Aj Ak Al Am An Ao Ap Aq Ar As At Au Av A...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nHaving learned (not without some help from the Codeforces participants) to play the card game from the previous round optimally, Shrek and Donkey (as you may remember, they too live now in the Kingdom of Far Far Away) hav...
[{"type": "stdin_stdout", "input": "15 31 1\n--------R---------G------------\n-G----------------------------R\n--------------G--------------R-\n---G--------------------------R\n-----R---------G---------------\n--R--G-------------------------\n-----G-----------------R-------\n--R-------------------G--------\n-R---------...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe prime numbers are not regularly spaced. For example from `2` to `3` the step is `1`.\nFrom `3` to `5` the step is `2`. From `7` to `11` it is `4`.\nBetween 2 and 50 we have the following pairs of 2-steps primes:\n\n`3...
[{"input": "2\n10000000\n11000000", "output": "[[10000139, 10000141]]", "fn_name": "step"}, {"input": "2\n104000\n105000", "output": "[[104087, 104089]]", "fn_name": "step"}, {"input": "4\n30000\n100000", "output": "[[30109, 30113]]", "fn_name": "step"}, {"input": "6\n30000\n100000", "output": "[[30091, 30097]]", "fn_n...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet $f_{x} = c^{2x-6} \\cdot f_{x-1} \\cdot f_{x-2} \\cdot f_{x-3}$ for $x \\ge 4$.\n\nYou have given integers $n$, $f_{1}$, $f_{2}$, $f_{3}$, and $c$. Find $f_{n} \\bmod (10^{9}+7)$.\n\n\n-----Input-----\n\nThe only line...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "607659049\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "607659049"}, {"type": "stdin_stdout", "input": "1440135023384277212 29874180...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp found $n$ segments on the street. A segment with the index $i$ is described by two integers $l_i$ and $r_i$ — coordinates of the beginning and end of the segment, respectively. Polycarp realized that he didn't ne...
[{"type": "stdin_stdout", "input": "4\n3\n1 4\n2 3\n3 6\n4\n1 2\n2 3\n3 5\n2 5\n5\n0 0\n1 13\n4 1\n6 14\n9 10\n5\n1 5\n2 4\n3 5\n2 8\n4 8\n", "output": "0\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 4\n2 3\n3 6\n4\n1 2\n2 3\n3 5\n2 5\n5\n0 0\n1 13\n4 1\n6 14\n9 10\n5\n1 5\n2 4\n3 5\n2 9\n4 8\n", "output": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY was offered a job of a screenwriter for the ongoing TV series. In particular, he needs to automate the hard decision: which main characters will get married by the end of the series.\n\nThere a...
[{"type": "stdin_stdout", "input": "10 50 200\n10 1 22\n2 9 6\n4 2 98\n6 6 38\n5 1 67\n6 7 17\n10 4 29\n6 5 97\n3 8 51\n1 6 31\n5 9 72\n4 5 50\n2 1 3\n10 2 27\n1 10 78\n9 9 48\n8 7 81\n5 8 64\n9 4 78\n7 5 90\n9 8 83\n7 1 99\n5 5 43\n1 2 37\n3 3 6\n4 3 61\n9 6 25\n1 3 46\n2 10 18\n1 4 68\n2 4 75\n3 10 67\n7 8 82\n5 7 1\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou've arrived at a carnival and head straight for the duck shooting tent. Why wouldn't you?\n\nYou will be given a set amount of ammo, and an aim rating of between 1 and 0. No your aim is not always perfect - hey maybe s...
[{"input": "8\n0.92\n\"|~~~~2~2~~~~~22~~2~~~~2~~~2|\"", "output": "[\"|~~~~X~X~~~~~XX~~X~~~~X~~~X|\"]", "fn_name": "duck_shoot"}, {"input": "4\n0.64\n\"|~~2~~~22~2~~22~2~~~~2~~~|\"", "output": "[\"|~~X~~~X2~2~~22~2~~~~2~~~|\"]", "fn_name": "duck_shoot"}, {"input": "6\n0.41\n\"|~~~~~22~2~~~~~|\"", "output": "[\"|~~~~~XX...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is the constraints.\n\nVova likes pictures with kittens. The news feed in the social network he uses can be represented as an array of $n$ consecutive pictures (with kitt...
[{"type": "stdin_stdout", "input": "200 103 37\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 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nChouti is working on a strange math problem.\n\nThere was a sequence of $n$ positive integers $x_1, x_2, \\ldots, x_n$, where $n$ is even. The sequence was very special, namely for every integer $t$ from $1$ to $n$, $x_1+...
[{"type": "stdin_stdout", "input": "80\n24 192 896 1568 2907 4840 7475 9775 11109 29939 22475 45951 46552 36859 66787 106329 85211 94423 65627 147436 143259 128699 139277 167743 178063 192167 150133 162719 177103 160732 139859 157301 176681 199291 152867 182611 199632 199535 199905 199959\n", "output": "Yes\n1 24 39 19...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe 9-th grade student Gabriel noticed a caterpillar on a tree when walking around in a forest after the classes. The caterpillar was on the height h_1 cm from the ground. On the height h_2 cm (h_2 > h_1) on the same tree...
[{"type": "stdin_stdout", "input": "43951 66098\n1604 35654\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "35413 75637\n4087 30166\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "28473 80380\n2568 95212\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "43951 66098\n1604 35654\n", "output": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.\n\nPolycarpus continues working as a system administrator in ...
[{"type": "stdin_stdout", "input": "10 14\n3 2\n7 2\n6 4\n8 1\n3 9\n5 6\n6 3\n4 1\n2 5\n7 10\n9 5\n7 1\n8 10\n3 4\n", "output": "unknown topology\n"}, {"type": "stdin_stdout", "input": "10 14\n3 2\n7 2\n6 4\n8 1\n3 9\n5 6\n6 3\n4 1\n2 5\n7 10\n9 5\n7 1\n8 10\n3 4\n", "output": "unknown topology\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nColour plays an important role in our lifes. Most of us like this colour better then another. User experience specialists believe that certain colours have certain psychological meanings for us.\n\nYou are given a 2D arra...
[{"input": "[[\"red\", \"energy\"], [\"yellow\", \"creativity\"], [\"brown\", \"friendly\"], [\"green\", \"growth\"]]", "output": "[[{\"red\": \"energy\"}, {\"yellow\": \"creativity\"}, {\"brown\": \"friendly\"}, {\"green\": \"growth\"}]]", "fn_name": "colour_association"}, {"input": "[[\"white\", \"goodness\"], [\"blu...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nSome natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of th...
[{"type": "stdin_stdout", "input": "900\n13595314340746721027884681972026445045155446054797436718350397773609081581610067818125738383867204953\n", "output": "86\n"}, {"type": "stdin_stdout", "input": "200\n1000000010000000000000000000010000000000000001000001000000000000000000000000000000000000000000000000\n", "output":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has $a$ health points, the second has $b$ health points, and the thi...
[{"type": "stdin_stdout", "input": "13\n3 2 4\n10 2 4\n10 3 5\n5 4 6\n7 1 1\n3 3 3\n6 6 6\n14 2 2\n16 1 1\n9 9 9\n26 3 3\n9 8 10\n4 1 4\n", "output": "YES\nNO\nYES\nNO\nYES\nYES\nYES\nYES\nNO\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "13\n3 2 4\n10 2 4\n10 3 5\n5 4 6\n7 1 1\n3 3 3\n6 6 6\n14 2 2\n16 1 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA festival will be held in a town's main street. There are n sections in the main street. The sections are numbered 1 through n from left to right. The distance between each adjacent sections is 1.\n\nIn the festival m fi...
[{"type": "stdin_stdout", "input": "100 20 5\n47 93 3\n61 49 10\n14 69 10\n88 2 14\n35 86 18\n63 16 20\n39 49 22\n32 45 23\n66 54 25\n77 2 36\n96 85 38\n33 28 45\n29 78 53\n78 13 60\n58 96 64\n74 39 71\n18 80 80\n18 7 85\n97 82 96\n74 99 97\n", "output": " 877...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nHave you ever implemented a program adding two big integers that cannot be represented by the primitive data type of your programming language? The algorithm is just simulation of the column addition method that we have b...
[{"type": "stdin_stdout", "input": "3\n7\n1\n16", "output": "3.44444445\n0.45\n7.94444444444\n"}, {"type": "stdin_stdout", "input": "3\n4\n1\n16", "output": "1.94445\n0.45\n7.94444444444\n"}, {"type": "stdin_stdout", "input": "3\n4\n0\n16", "output": "1.94445\n0.0\n7.94444444444\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOur football team finished the championship.\nThe result of each match look like \"x:y\". Results of all matches are recorded in the collection.\n\nFor example:\n```[\"3:1\", \"2:2\", \"0:1\", ...]```\n\nWrite a function ...
[{"input": "[\"1:0\", \"2:0\", \"3:0\", \"4:0\", \"2:1\", \"3:1\", \"4:1\", \"3:2\", \"4:2\", \"4:3\"]", "output": "[30]", "fn_name": "points"}, {"input": "[\"1:1\", \"2:2\", \"3:3\", \"4:4\", \"2:2\", \"3:3\", \"4:4\", \"3:3\", \"4:4\", \"4:4\"]", "output": "[10]", "fn_name": "points"}, {"input": "[\"1:0\", \"2:0\", \...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the year 2020, a race of atomically energized cars will be held. Unlike today’s car races, fueling is not a concern of racing teams. Cars can run throughout the course without any refueling. Instead, the critical facto...
[{"type": "stdin_stdout", "input": "2\n2 3\n1.1946563976133233\n1 2.557093764182385 0.48719322387595776 0.3\n5\n5 6 15 20 25\n0.15\n1 1.0 0.04 1.0346326402545585\n10\n1783 3640 3991 4623 5465 5481 6369 6533 6865 8425\n5.110816362691462\n72 59.4705 0.6319554453888588 0.12728810127294996\n0", "output": "1.317231571615\n-...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $x$ and $y$ (it is guaranteed that $x > y$). You may choose any prime integer $p$ and subtract it any number of times from $x$. Is it possible to make $x$ equal to $y$?\n\nRecall that a prime nu...
[{"type": "stdin_stdout", "input": "69\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n4 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn 2300, the Life Science Division of Federal Republic of Space starts a very ambitious project to complete the genome sequencing of all living creatures in the entire universe and develop the genomic database of all spac...
[{"type": "stdin_stdout", "input": "ABC 3\nABC 2\n2(4()B)3(XY)A10C 30\n1000(1000(1000(1000(1000(1000(OM)))))) 1090860\n0 0", "output": "0\nC\n0\nO\n"}, {"type": "stdin_stdout", "input": "CBA 3\nABC 0\n2(4(AB)3(XY))10C 10\n1000(1000(1000(1000(1000(1000(NM)))))) 1889091\n0 0", "output": "0\nA\nX\nM\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nqd ucyhf yi q fhycu dkcruh mxeiu huluhiu yi q tyvvuhudj fhycu dkcruh. oekh jqia yi je vydt jxu djx ucyhf.\n\nInput\n\njxu ydfkj sediyiji ev q iydwbu ydjuwuh d (1 ≤ d ≤ 11184) — jxu edu-rqiut ydtun ev jxu ucyhf je vydt.\n\...
[{"type": "stdin_stdout", "input": "10526\n", "output": "971513\n"}, {"type": "stdin_stdout", "input": "11183\n", "output": "999931\n"}, {"type": "stdin_stdout", "input": "10107\n", "output": "953077\n"}, {"type": "stdin_stdout", "input": "10476\n", "output": "969481\n"}, {"type": "stdin_stdout", "input": "10962\n", "o...
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.\nDetermine whether we can turn S into a palindrome by repeating the operation of swapping two adjacent characters. If it is possible, find the minimum requ...
[{"type": "stdin_stdout", "input": "ataatmma\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "aatltmaa", "output": "-1\n"}, {"type": "stdin_stdout", "input": "aamtltaa", "output": "-1\n"}, {"type": "stdin_stdout", "input": "aamaltta", "output": "-1\n"}, {"type": "stdin_stdout", "input": "attlamaa", "output": "-...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe prime numbers are not regularly spaced. For example from `2` to `3` the gap is `1`.\nFrom `3` to `5` the gap is `2`. From `7` to `11` it is `4`.\nBetween 2 and 50 we have the following pairs of 2-gaps primes:\n`3-5, 5...
[{"input": "2\n10000000\n11000000", "output": "[[10000139, 10000141]]", "fn_name": "gap"}, {"input": "4\n30000\n100000", "output": "[[30109, 30113]]", "fn_name": "gap"}, {"input": "6\n30000\n100000", "output": "[[30091, 30097]]", "fn_name": "gap"}, {"input": "8\n30000\n100000", "output": "[[30161, 30169]]", "fn_name": ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nProblem A Secret of Chocolate Poles\n\nWendy, the master of a chocolate shop, is thinking of displaying poles of chocolate disks in the showcase. She can use three kinds of chocolate disks: white thin disks, dark thin dis...
[{"type": "stdin_stdout", "input": "88 3", "output": "2971215071\n"}, {"type": "stdin_stdout", "input": "73 3", "output": "102334153\n"}, {"type": "stdin_stdout", "input": "68 4", "output": "3956574\n"}, {"type": "stdin_stdout", "input": "87 6", "output": "8427403\n"}, {"type": "stdin_stdout", "input": "72 4", "output"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permutations. Iahubina is angry that she is no more important for Iahub. When Iahub goes away, Iahubina comes t...
[{"type": "stdin_stdout", "input": "20\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "927799753\n"}, {"type": "stdin_stdout", "input": "10\n4 10 -1 1 6 8 9 2 -1 -1\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n3 10 -1 1 6 8 9 2 -1 -1\n", "output": "6\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDr. Akita, who lives in the neighborhood, is a historical researcher in the field and recently discovered a new ancient document about Ono no Komachi.\n\nIt is widely known that Ono no Komachi has given General Fukakusa, ...
[{"type": "stdin_stdout", "input": "1 1\n3 2\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #", "output": "91\n92\n273\n93\n279\n88\n"}, {"type": "stdin_stdout", "input": "1 1\n3 4\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #", "output": "91\n94\n273\n93\n279\n88\n"}, {"type": "stdin_stdout", "input": "1 1\n3 4\n3 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite function alternateCase which switch every letter in string from upper to lower and from lower to upper.\nE.g: Hello World -> hELLO wORLD\n\nWrite your solution by modifying this code:\n\n```python\ndef alternateCase...
[{"input": "\"Jack JUMPED over THE CaNdLeStIcK\"", "output": "[\"jACK jumped OVER the cAnDlEsTiCk\"]", "fn_name": "alternateCase"}, {"input": "\"i LIKE MAKING KATAS VERY MUCH\"", "output": "[\"I like making katas very much\"]", "fn_name": "alternateCase"}, {"input": "\"HuMpTy DuMpTy SaT On A WaLl\"", "output": "[\"hUmP...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\nAt least how many sheets of paper does he need?\n\n-----Constraints-----\n - N is an integer.\n...
[{"type": "stdin_stdout", "input": "1073", "output": "537\n"}, {"type": "stdin_stdout", "input": "100\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "282", "output": "141\n"}, {"type": "stdin_stdout", "input": "557", "output": "279\n"}, {"type": "stdin_stdout", "input": "284", "output": "142\n"}, {"type": "st...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which reads an integer n and draws a Koch curve based on recursive calles of depth n.\n\nThe Koch curve is well known as a kind of fractals.\n\nYou can draw a Koch curve in the following algorithm:\n\n* Di...
[{"type": "stdin_stdout", "input": "5", "output": "0 0\n0.411522633745 0.0\n0.617283950617 0.356389055055\n0.82304526749 0.0\n1.23456790123 0.0\n1.44032921811 0.356389055055\n1.23456790123 0.712778110111\n1.64609053498 0.712778110111\n1.85185185185 1.06916716517\n2.05761316872 0.712778110111\n2.46913580247 0.7127781101...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Task\n\nGiven a positive integer as input, return the output as a string in the following format: \n\nEach element, corresponding to a digit of the number, multiplied by a power of 10 in such a way that with the sum of...
[{"input": "8964631", "output": "[\"8*1000000+9*100000+6*10000+4*1000+6*100+3*10+1\"]", "fn_name": "simplify"}, {"input": "196587", "output": "[\"1*100000+9*10000+6*1000+5*100+8*10+7\"]", "fn_name": "simplify"}, {"input": "10104", "output": "[\"1*10000+1*100+4\"]", "fn_name": "simplify"}, {"input": "999", "output": "[\...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer number $n$. The following algorithm is applied to it:\n\n if $n = 0$, then end algorithm; find the smallest prime divisor $d$ of $n$; subtract $d$ from $n$ and go to step $1$. \n\nDetermine the...
[{"type": "stdin_stdout", "input": "10000000000\n", "output": "5000000000\n"}, {"type": "stdin_stdout", "input": "10000000000\n", "output": "5000000000\n"}, {"type": "stdin_stdout", "input": "10000000010\n", "output": "5000000005\n"}, {"type": "stdin_stdout", "input": "10010000010\n", "output": "5005000005\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVictor tries to write his own text editor, with word correction included. However, the rules of word correction are really strange.\n\nVictor thinks that if a word contains two consecutive vowels, then it's kinda weird an...
[{"type": "stdin_stdout", "input": "90\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n", "output": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n"}, {"type": "stdin_stdout", "input": "90\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
code_stdio