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\nPROBLEM SPECIFICATION:\nYou are given three positive integers 'n' , 'a' and 'b' . In the given range from 1 to 'n' how many distinct numbers are completely divisible by\n'a' or 'b' or both?\nNOTE: The range includes both... | [{"type": "stdin_stdout", "input": "100\n1681692778 887 84\n424238336 7794 16\n596516650 493 87\n1350490028 2363 22\n2044897764 60 91\n1636794921 541 26\n35005212 5737 73\n1726956430 2568 69\n333046344 1531 104\n468703136 4068 24\n1315634023 9803 51\n1532562280 3070 59\n628175012 8457 94\n1653377374 6230 43\n608413785 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs Gudi escapes the room and moves onto to the next floor, the Wizard of UD receives her at the gate!\nThe wizard questions her intelligence and does not allow her to move ahead unless she answers his puzzle correctly. T... | [{"type": "stdin_stdout", "input": "10\n20\nqeevevbtaewcbtrqtyvbauyrauactw\nbutqrcbeebtayaqyuauvwwuaebavqe\nwuvtbbvqaqwuacqbvbwuyureeyayyt\ncavtwevvytcerrerurycqrwbrbebqv\nbcbvqwqatrvbyctbarqacbwtttqbcc\netcyrubybuwrtbuqubtcybbqwyuuwt\nweeqatybwyettcqarcwcvwyqwrwwwt\nectucwtratbwwacbwaqrawarywtuey\ntecyuywvrructbytttbe... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTak performed the following action N times: rolling two dice. The result of the i-th roll is D_{i,1} and D_{i,2}.\n\nCheck if doublets occurred at least three times in a row. Specifically, check if there exists at lease o... | [{"type": "stdin_stdout", "input": "6\n1 0\n2 2\n3 3\n4 4\n5 5\n10 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n1 0\n2 2\n3 3\n4 4\n5 0\n10 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n-4 1\n1 3\n-1 1\n4 12\n2 0\n0 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "6\n-4 1\n1 ... | 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. Each integer from 1 to NM is written in this grid once. The number written in the square at the i-th row from the top and the j-th column from the left is A_{ij}.\n\nYo... | [{"type": "stdin_stdout", "input": "3 4\n2 4 7 10\n1 5 8 11\n3 6 12 12", "output": "10 4 7 2 \n8 11 1 5 \n3 6 12 12 \n3 4 1 2 \n8 6 7 5 \n10 11 12 12 \n"}, {"type": "stdin_stdout", "input": "3 4\n1 4 7 10\n1 5 8 11\n3 6 12 12", "output": "10 4 7 1 \n8 11 1 5 \n3 6 12 12 \n3 4 1 1 \n8 6 7 5 \n10 11 12 12 \n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given three integers A, B and C.\n\nDetermine if there exists an equilateral triangle whose sides have lengths A, B and C.\n\nConstraints\n\n* All values in input are integers.\n* 1 \\leq A,B,C \\leq 100\n\nInput\... | [{"type": "stdin_stdout", "input": "-1 -1 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "-2 -1 -2", "output": "No\n"}, {"type": "stdin_stdout", "input": "-3 10 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "-3 1 -11", "output": "N... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAmidakuji is a traditional method of lottery in Japan.\n\nTo make an amidakuji, we first draw W parallel vertical lines, and then draw horizontal lines that connect them. The length of each vertical line is H+1 [cm], and ... | [{"type": "stdin_stdout", "input": "16 8 5", "output": "698231265\n"}, {"type": "stdin_stdout", "input": "15 8 3", "output": "978283490\n"}, {"type": "stdin_stdout", "input": "16 8 7", "output": "876814452\n"}, {"type": "stdin_stdout", "input": "16 9 3", "output": "996082491\n"}, {"type": "stdin_stdout", "input": "15 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (literally \"material of pastry\", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Dou... | [{"type": "stdin_stdout", "input": "5 3000\n150\n130\n150\n130\n100", "output": "28\n"}, {"type": "stdin_stdout", "input": "5 3000\n236\n130\n150\n130\n100", "output": "27\n"}, {"type": "stdin_stdout", "input": "5 3000\n150\n173\n150\n212\n101", "output": "26\n"}, {"type": "stdin_stdout", "input": "5 3000\n150\n130\n15... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer has three cards, one red, one green and one blue.\nAn integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.\nWe will arrange the cards in the ... | [{"type": "stdin_stdout", "input": "7 3 2", "output": "YES\n"}, {"type": "stdin_stdout", "input": "7 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "0 6 0", "output": "YES\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absol... | [{"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-20 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-16 4 1 -2 3 -3 0", "output": "0\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor integers b (b \\geq 2) and n (n \\geq 1), let the function f(b,n) be defined as follows:\n\n* f(b,n) = n, when n < b\n* f(b,n) = f(b,\\,{\\rm floor}(n / b)) + (n \\ {\\rm mod} \\ b), when n \\geq b\n\n\n\nHere, {\\rm ... | [{"type": "stdin_stdout", "input": "31415926535\n13", "output": "15707963262\n"}, {"type": "stdin_stdout", "input": "31415926535\n2", "output": "31415926534\n"}, {"type": "stdin_stdout", "input": "31415926535\n4", "output": "31415926532\n"}, {"type": "stdin_stdout", "input": "31415926535\n3", "output": "15707963267\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA smelt fishing tournament was held at Lake Hibara. It seems that catch and release is recommended this time.\n\nCreate a program that reads the participant number and the number of fish caught or released in order as one... | [{"type": "stdin_stdout", "input": "3 5\n1 14\n2 5\n1 3\n3 4\n2 11", "output": "1 14\n1 14\n1 17\n1 17\n1 17\n"}, {"type": "stdin_stdout", "input": "3 5\n1 4\n2 10\n1 5\n3 4\n3 11", "output": "1 4\n2 10\n2 10\n2 10\n3 15\n"}, {"type": "stdin_stdout", "input": "3 5\n1 4\n2 19\n1 5\n3 4\n3 11", "output": "1 4\n2 19\n2 19... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Aizuwakamatsu Village, which is located far north of Aizuwakamatsu City, a bridge called \"Yabashi\" is the only way to move to the surrounding villages. Despite the large number of passers-by, the bridge is so old tha... | [{"type": "stdin_stdout", "input": "3\n125 -1 15\n108 12 25\n149 10 50\n3\n32 -1 10\n70 10 41\n22 67 84\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "3\n125 -1 15\n108 8 25\n246 10 42\n3\n32 -1 10\n70 10 41\n22 67 129\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "3\n125 -1 15\n108 7 25... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice is spending his time on an independent study to apply to the Nationwide Mathematics Contest. This year’s theme is \"Beautiful Sequence.\" As Alice is interested in the working of computers, she wants to create a bea... | [{"type": "stdin_stdout", "input": "126 1", "output": "319908070\n"}, {"type": "stdin_stdout", "input": "143 1", "output": "990388601\n"}, {"type": "stdin_stdout", "input": "37 12", "output": "452771840\n"}, {"type": "stdin_stdout", "input": "143 2", "output": "798128291\n"}, {"type": "stdin_stdout", "input": "108 2", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPablo Squarson is a well-known cubism artist. This year's theme for Pablo Squarson is \"Squares\". Today we are visiting his studio to see how his masterpieces are given birth.\n\nAt the center of his studio, there is a h... | [{"type": "stdin_stdout", "input": "1\n5\n0 0\n0 -1\n0 2\n0 3\n12\n0 0\n0 0\n2 0\n3 0\n4 1\n5 1\n6 2\n3 2\n8 2\n9 3\n10 3\n10\n0 2\n1 3\n2 2\n3 2\n2 1\n5 1\n6 1\n7 1\n3 0\n0", "output": "1 1\n3 2\n4 5\n4 5\n"}, {"type": "stdin_stdout", "input": "1\n5\n0 -1\n0 1\n0 2\n0 3\n12\n0 0\n1 0\n2 0\n3 1\n4 1\n5 1\n6 2\n7 1\n8 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"Balloons should be captured efficiently\", the game designer says. He is designing an oldfashioned game with two dimensional graphics. In the game, balloons fall onto the ground one after another, and the player manipul... | [{"type": "stdin_stdout", "input": "2\n10 100\n100 270\n2\n12 100\n100 280\n3\n100 150\n10 360\n40 450\n3\n100 150\n17 360\n40 440\n2\n100 10\n50 200\n2\n100 100\n50 110\n1\n15 10\n4\n1 10\n2 20\n3 100\n90 200\n0", "output": "OK 220\nOK 200\nOK 260\nOK 246\nNG 1\nNG 2\nNG 1\nOK 188\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro had his own personal computer and set a password for login. However, Taro inadvertently forgot the password. Then, remembering that there was a piece of paper with the password written down, Taro found the paper and ... | [{"type": "stdin_stdout", "input": "KUSATSU\nLSATSU", "output": "No\n"}, {"type": "stdin_stdout", "input": "RUPCUAOC\n__PC", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "KUSATSU\nLSATRU", "output": "No\n"}, {"type": "stdin_stdout", "input": "RUPCUAOC\n__OC", "output": "Yes\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always the root node of T. Consider the following two operations on T:\n\n* M v: (Mark) Mark node v.\n* Q v: (Query) Print ... | [{"type": "stdin_stdout", "input": "6 3\n1\n1\n-1\n2\n3\nQ 5\nM 4\nQ 5\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 3\n1\n1\n2\n3\n2\nQ 5\nM 12\nQ 5\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 3\n-1\n1\n0\n3\n0\nQ 5\nL 4\nQ 5\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInternational Carpenters Professionals Company (ICPC) is a top construction company with a lot of expert carpenters. What makes ICPC a top company is their original language.\n\nThe syntax of the language is simply given ... | [{"type": "stdin_stdout", "input": "3\n-1 ( 10\n10 ) 5\n10 ) 5", "output": "No\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "3\n-1 ( 0\n10 ) 4\n20 ( 4", "output": "Yes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "3\n-1 ) 10\n10 ( 12\n10 ( 7", "output": "No\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "3\n-1 ( ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem statement\n\nN-winged rabbit is on a balance beam of length L-1. The initial position of the i-th rabbit is the integer x_i, which satisfies 0 ≤ x_ {i} \\ lt x_ {i + 1} ≤ L−1. The coordinates increase as you move ... | [{"type": "stdin_stdout", "input": "1 11\n0\n1", "output": "11\n"}, {"type": "stdin_stdout", "input": "1 15\n0\n1", "output": "15\n"}, {"type": "stdin_stdout", "input": "1 13\n0\n1", "output": "13\n"}, {"type": "stdin_stdout", "input": "1 11\n1\n1", "output": "10\n"}, {"type": "stdin_stdout", "input": "1 15\n1\n1", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nGiven the sequence $ A $ of length $ N $. Find the maximum value of $ \\ sum B_i $, where $ B $ is one of the longest increasing subsequences of the sequence $ A $.\n\nThe longest increasing subsequence of the ... | [{"type": "stdin_stdout", "input": "4\n14 15 0 10", "output": "29\n"}, {"type": "stdin_stdout", "input": "4\n17 19 0 20", "output": "56\n"}, {"type": "stdin_stdout", "input": "4\n12 23 0 10", "output": "35\n"}, {"type": "stdin_stdout", "input": "4\n14 8 0 10", "output": "18\n"}, {"type": "stdin_stdout", "input": "4\n7 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExtended Euclid Algorithm\n\n\n\n\nGiven positive integers a and b, find the integer solution (x, y) to ax + by = gcd(a, b), where gcd(a, b) is the greatest common divisor of a and b.\n\nConstraints\n\n* 1 ≤ a, b ≤ 109\n\... | [{"type": "stdin_stdout", "input": "810 11", "output": "-3 221\n"}, {"type": "stdin_stdout", "input": "277 5", "output": "-2 111\n"}, {"type": "stdin_stdout", "input": "195 10", "output": "1 -19\n"}, {"type": "stdin_stdout", "input": "174 10", "output": "-2 35\n"}, {"type": "stdin_stdout", "input": "41 52", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are \"a\", \"o\", \"u\", \"i\", and \"e\". Other letters are consonant.\n\nIn Berlanese, there has to b... | [{"type": "stdin_stdout", "input": "auuaoonntanonnuewannnnpuuinniwoonennyolonnnvienonpoujinndinunnenannmuveoiuuhikucuziuhunnnmunzancenen\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "auuaoonntanonnuewannnopuuinniwoonennyolonnnvienonpoujinndinunnenannmuveoiuuhikucuziuhunnnmunzancenen\n", "output": "YES\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n points on the plane. The polygon formed from all the n points is strictly convex, that is, the polygon is convex, and there are no three collinear points (i.e. lying in the same straight line). The points ... | [{"type": "stdin_stdout", "input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA permutation of size n is an array of size n such that each integer from 1 to n occurs exactly once in this array. An inversion in a permutation p is a pair of indices (i, j) such that i > j and a_i < a_j. For example, a... | [{"type": "stdin_stdout", "input": "69\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": " ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwo integer sequences existed initially — one of them was strictly increasing, and the other one — strictly decreasing.\n\nStrictly increasing sequence is a sequence of integers [x_1 < x_2 < ... < x_k]. And strictly decre... | [{"type": "stdin_stdout", "input": "12\n13 2 1 3 5 8 9 10 7 12 4 12\n", "output": "YES\n11\n1 2 3 4 5 7 8 9 10 12 13 \n1\n12 \n"}, {"type": "stdin_stdout", "input": "12\n12 8 1 3 7 5 9 6 8 10 11 2\n", "output": "YES\n11\n1 2 3 5 6 7 8 9 10 11 12 \n1\n8 \n"}, {"type": "stdin_stdout", "input": "12\n13 2 1 3 5 8 9 10 7 6 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp wants to train before another programming competition. During the first day of his training he should solve exactly 1 problem, during the second day — exactly 2 problems, during the third day — exactly 3 problems... | [{"type": "stdin_stdout", "input": "5\n200000 200000 200000 200000 200000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n200000 200000 200000 200000 329398\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n330358 200000 200000 200000 200000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Cybermen and the Daleks have long been the Doctor's main enemies. Everyone knows that both these species enjoy destroying everything they encounter. However, a little-known fact about them is that they both also love ... | [{"type": "stdin_stdout", "input": "10\n11 11\n11 12\n11 15\n11 17\n11 18\n11 19\n11 28\n11 33\n11 38\n11 40\n12 11\n15 46\n17 11\n17 46\n18 46\n19 11\n19 46\n20 11\n20 46\n24 46\n25 46\n26 11\n32 11\n32 46\n33 11\n34 46\n36 11\n39 11\n40 46\n43 11\n44 0\n46 14\n46 15\n46 17\n46 22\n46 26\n46 28\n46 32\n46 43\n46 45\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor her birthday Alice received an interesting gift from her friends – The Light Square. The Light Square game is played on an N × N lightbulbs square board with a magical lightbulb bar of size N × 1 that has magical prop... | [{"type": "stdin_stdout", "input": "3\n110\n011\n100\n100\n011\n100\n100\n", "output": "1\ncol 1\n"}, {"type": "stdin_stdout", "input": "3\n110\n010\n101\n100\n010\n101\n100\n", "output": "1\ncol 1\n"}, {"type": "stdin_stdout", "input": "3\n110\n010\n101\n110\n110\n101\n100\n", "output": "1\nrow 1\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a tree consisting of n vertices. A tree is an undirected connected acyclic graph.\n\n<image> Example of a tree.\n\nYou have to paint each vertex into one of three colors. For each vertex, you know the cost o... | [{"type": "stdin_stdout", "input": "15\n10 34 69 39 82 49 57 22 50 25 82 37 33 62 69\n35 14 68 31 26 8 33 98 33 95 19 22 89 18 67\n80 24 10 5 26 85 69 21 29 38 89 24 78 68 88\n13 1\n6 12\n8 4\n11 9\n14 11\n15 5\n3 15\n1 10\n13 9\n7 12\n14 6\n3 2\n2 7\n4 5\n", "output": "620\n2 3 2 2 3 3 1 1 3 3 2 2 1 1 1 \n"}, {"type":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn integer sequence is called beautiful if the difference between any two consecutive numbers is equal to 1. More formally, a sequence s_1, s_2, …, s_{n} is beautiful if |s_i - s_{i+1}| = 1 for all 1 ≤ i ≤ n - 1.\n\nTrans... | [{"type": "stdin_stdout", "input": "139 140 2362 2360\n", "output": "YES\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday, as a friendship gift, Bakry gave Badawy n integers a_1, a_2, ..., a_n and challenged him to choose an integer X such that the value \\underset{1 ≤ i ≤ n}{max} (a_i ⊕ X) is minimum possible, where ⊕ denotes the [bit... | [{"type": "stdin_stdout", "input": "5\n1073741823 1073741823 181085488 1073741823 1073741823\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "5\n1073741823 29972487 1073741823 1073741823 1073741823\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "5\n219338430 29972487 1073741823 10737418... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor the multiset of positive integers s=\\\\{s_1,s_2,...,s_k\\}, define the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of s as follow:\n\n * \\gcd(s) is the maximum positive integer x, such that all in... | [{"type": "stdin_stdout", "input": "10\n972 972 324 972 324 648 1944 243 324 474\n", "output": "162\n"}, {"type": "stdin_stdout", "input": "10\n540 648 1116 648 720 540 594 864 972 648\n", "output": "36\n"}, {"type": "stdin_stdout", "input": "10\n972 1224 324 972 324 507 1868 392 324 474\n", "output": "2\n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA binary matrix is called good if every even length square sub-matrix has an odd number of ones. \n\nGiven a binary matrix a consisting of n rows and m columns, determine the minimum number of cells you need to change to ... | [{"type": "stdin_stdout", "input": "2 58\n1100001110010010100001000000000110110001101001100010101110\n1110110010101111001110010001100010001010100011111110110100\n", "output": "27\n"}, {"type": "stdin_stdout", "input": "7 15\n000100001010010\n100111010110001\n101101111100100\n010000111111010\n111010010100001\n0000110011... | 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 (recall th... | [{"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": "3\n5\n1 2 3 4 2\n5\n4 1 1 4 2\n6\n1 4 3 5 1 1\n", "output": "-1 -1 2 2 1\n-1 -1 1 1 1\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\nHomer has two friends Alice and Bob. Both of them are string fans. \n\nOne day, Alice and Bob decide to play a game on a string s = s_1 s_2 ... s_n of length n consisting of lowercase English letters. They move in turns a... | [{"type": "stdin_stdout", "input": "5\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nazazazazazazazazazazazazazazazazazazazazazazazazaz\nzazazazazazazazazazazazazazazazazazazazazazazazaza\nzzazzazzazzazzazzazzazzazzazzazzazzazzazzazza\n", "output": "bzbzbzbzbzbz... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string s, consisting of lowercase Latin letters. While there is at least one character in the string s that is repeated at least twice, you perform the following operation: \n\n * you choose the index i (... | [{"type": "stdin_stdout", "input": "1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "ba\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarpus analyzes a string called abracadabra. This string is constructed using the following algorithm: \n\n * On the first step the string consists of a single character \"a\". \n * On the k-th step Polycarpus conca... | [{"type": "stdin_stdout", "input": "156642200 503020953 296806626 871864091\n", "output": "234585497\n"}, {"type": "stdin_stdout", "input": "462616550 929253987 199885647 365920450\n", "output": "166034804\n"}, {"type": "stdin_stdout", "input": "166724572 472113234 358126054 528083792\n", "output": "125430608\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant very much loves sums on intervals.\n\nThis time he has a pair of integers l and r (l ≤ r). The Little Elephant has to find the number of such integers x (l ≤ x ≤ r), that the first digit of integer x e... | [{"type": "stdin_stdout", "input": "100000000000000000 1000000000000000000\n", "output": "90000000000000000\n"}, {"type": "stdin_stdout", "input": "645762257531682046 885295120956158518\n", "output": "23953286342447648\n"}, {"type": "stdin_stdout", "input": "819875140559301752 946247219812473271\n", "output": "12637207... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest ... | [{"type": "stdin_stdout", "input": "100 100\n-98 -97 -96 -93 -92 -91 -90 -87 -86 -84 -81 -80 -79 -78 -76 -75 -73 -71 -69 -67 -65 -64 -63 -62 -61 -54 -51 -50 -49 -48 -46 -45 -44 -37 -36 -33 -30 -28 -27 -16 -15 -13 -12 -10 -9 -7 -6 -5 -4 2 3 5 8 9 10 11 13 14 15 16 17 19 22 24 25 26 27 28 30 31 32 36 40 43 45 46 47 50 51... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe winner of the card game popular in Berland \"Berlogging\" is determined according to the following rules. If at the end of the game there is only one player with the maximum number of points, he is the winner. The sit... | [{"type": "stdin_stdout", "input": "12\natrtthfpcvishmqbakprquvnejr 185\natrtthfpcvishmqbakprquvnejr -699\natrtthfpcvishmqbakprquvnejr -911\natrtthfpcvishmqbakprquvnejr -220\nfcgslzkicjrpbqaifgweyzreajjfdo 132\nfcgslzkicjrpbqaifgweyzreajjfdo -242\nm 177\nm -549\natrtthfpcvishmqbakprquvnejr -242\nm 38\natrtthfpcvishmqba... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three decent ingredients to make hamburgers from: a bread, sausage and cheese. ... | [{"type": "stdin_stdout", "input": "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n100 100 100\n100 100 100\n1000000000000\n", "output": "100000001\n"}, {"type": "stdin_stdout", "input": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlexandra has a paper strip with n numbers on it. Let's call them ai from left to right.\n\nNow Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:\n\n * Each piece should... | [{"type": "stdin_stdout", "input": "2 0000000000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 0000100000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 0000000000 3\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). The i-th fox is ai years old.\n\nThey will have dinner around some round tables. You want to distribute foxes such that:\n... | [{"type": "stdin_stdout", "input": "178\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 12 6 6 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the game takes place on an h × w field, and it is painted in two colors, but not like in chess. Almost all cells ... | [{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100000 100000 4\n50001 50001\n5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently, Duff has been practicing weight lifting. As a hard practice, Malek gave her a task. He gave her a sequence of weights. Weight of i-th of them is 2wi pounds. In each step, Duff can lift some of the remaining weig... | [{"type": "stdin_stdout", "input": "100\n196 1681 196 0 61 93 196 196 196 196 196 0 0 96 18 1576 0 93 666463 18 93 0 1278 8939 93 196 196 1278 3 0 67416 869956 10 56489 196 745 39 783 317 8939 196 81 69634 4552 39 3 14 20 25 8 10 4 7302 0 12860 20 1140 15990 7302 0 19579 4142 11 1354 149297 93 311 2338 0 79475 10 75252... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the school computer room there are n servers which are responsible for processing several computing tasks. You know the number of scheduled tasks for each server: there are mi tasks assigned to the i-th server.\n\nIn o... | [{"type": "stdin_stdout", "input": "10\n19999 19999 20000 20000 29860 20000 12103 20000 19999 17191\n", "output": "10536\n"}, {"type": "stdin_stdout", "input": "10\n19999 19999 20000 39539 29860 20000 12103 20000 19999 17191\n", "output": "25661\n"}, {"type": "stdin_stdout", "input": "10\n11328 19999 20000 39539 29860 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe city administration of IT City decided to fix up a symbol of scientific and technical progress in the city's main square, namely an indicator board that shows the effect of Moore's law in real time.\n\nMoore's law is ... | [{"type": "stdin_stdout", "input": "10000 671249297\n", "output": "16096020.300745647400617599487304687500"}, {"type": "stdin_stdout", "input": "10001 671249297\n", "output": "16097629.902775721624493598937988281250"}, {"type": "stdin_stdout", "input": "11001 671249297\n", "output": "17707231.93285028636455535888671875... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\n\nInput\n\nThe only line of the input is a string of 7 characters. The first character is letter A, followed by 6 digits. The input is guaranteed to be valid (for certain definition of \"valid\").\n\nOutput\n\nOutput a ... | [{"type": "stdin_stdout", "input": "A232726\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "A223635\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "A221033\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "A222222\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "A101010\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA little bear Limak plays a game. He has five cards. There is one number written on each card. Each number is a positive integer.\n\nLimak can discard (throw out) some cards. His goal is to minimize the sum of numbers wri... | [{"type": "stdin_stdout", "input": "100 100 100 100 100\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "100 100 100 100 000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 100 100 000 000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "98 99 100 99 100\n", "output": "296\n"}, {"type":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe crowdedness of the discotheque would never stop our friends from having fun, but a bit more spaciousness won't hurt, will it?\n\nThe discotheque can be seen as an infinite xy-plane, in which there are a total of n dan... | [{"type": "stdin_stdout", "input": "20\n-961747 0 961747\n-957138 0 957138\n-921232 0 921232\n-887450 0 887450\n-859109 0 859109\n-686787 0 686787\n-664613 0 664613\n-625553 0 625553\n-464803 0 464803\n-422784 0 422784\n-49107 0 49107\n-37424 0 37424\n134718 0 134718\n178903 0 178903\n304415 0 304415\n335362 0 335362\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne quite ordinary day Valera went to school (there's nowhere else he should go on a week day). In a maths lesson his favorite teacher Ms. Evans told students about divisors. Despite the fact that Valera loved math, he di... | [{"type": "stdin_stdout", "input": "1000000000 2000000000 2\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "200000000 2000000000 1800000011\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1500000000 2000000000 11\n", "output": "10389612\n"}, {"type": "stdin_stdout", "input": "1100000000 200000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a program you want to execute as a set of tasks organized in a dependency graph. The dependency graph is a directed acyclic graph: each task can depend on results of one or several other tasks, and there are... | [{"type": "stdin_stdout", "input": "10 39\n1 0 1 1 1 1 1 1 1 1\n0 1\n0 2\n0 3\n0 5\n0 6\n0 7\n0 8\n0 9\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n3 4\n3 5\n3 7\n3 8\n3 9\n4 5\n4 6\n5 6\n5 7\n5 8\n5 9\n6 7\n6 8\n7 8\n7 9\n8 9\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 39... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe last stage of Football World Cup is played using the play-off system.\n\nThere are n teams left in this stage, they are enumerated from 1 to n. Several rounds are held, in each round the remaining teams are sorted in ... | [{"type": "stdin_stdout", "input": "256 107 129\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 107 240\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 128 129\n", "output": "Final!"}, {"type": "stdin_stdout", "input": "256 128 256\n", "output": "Final!"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem Statement \nUnseen gang is the team of most wanted criminal. Unseen gang has planted bombs in different street and corner of the city. Gang members are sitting in the other part of the city, far away from the bomb... | [{"type": "stdin_stdout", "input": "cetnalpevbhU bpma @tllahd noitadol CY/JTehtnh\n1\n\nDLQMAR", "output": "c\ne\nt\nn\na\nl\np\ne\nv\nb\nh\nU\n \nb\np\nm\na\n \n@\nt\nl\nl\na\nh\nd\n \nn\no\ni\nt\na\nd\no\nl\n \nC\nY\n/\nJ\nT\ne\nh\nt\nn\nh\n"}, {"type": "stdin_stdout", "input": "cetnalpevbhU bpma @tllahd noitadol JY/... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he... | [{"type": "stdin_stdout", "input": "328 15\n16 23 1 34 5 24 79 3 19 8 7 0 -1 70 -1", "output": "41\n"}, {"type": "stdin_stdout", "input": "328 15\n16 23 0 34 5 24 79 3 19 8 7 0 -1 70 -1", "output": "42\n"}, {"type": "stdin_stdout", "input": "253 15\n8 23 12 34 5 16 79 3 23 8 46 0 0 70 1", "output": "-1\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.\n\nConstraints\n\n* 1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n* All values in input are integ... | [{"type": "stdin_stdout", "input": "115 -5 1", "output": "bust\n"}, {"type": "stdin_stdout", "input": "-2 -10 -1", "output": "win\n"}, {"type": "stdin_stdout", "input": "-4 -10 -1", "output": "win\n"}, {"type": "stdin_stdout", "input": "-4 -13 -1", "output": "win\n"}, {"type": "stdin_stdout", "input": "-4 -13 -2", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a s... | [{"type": "stdin_stdout", "input": "15 5\n3 3\n1 1\n5 2\n3 6\n4 5", "output": "101\n101\n103\n104\n105\n"}, {"type": "stdin_stdout", "input": "16 5\n2 4\n4 2\n0 2\n2 4\n4 3", "output": "114\n114\n117\n119\n120\n"}, {"type": "stdin_stdout", "input": "12 5\n1 3\n2 -1\n5 6\n3 5\n7 1", "output": "61\n62\n64\n65\n66\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has decided to use a robot to clean his room.\n\nThere are N pieces of trash on a number line. The i-th piece from the left is at position x_i. We would like to put all of them in a trash bin at position 0.\n\nFor t... | [{"type": "stdin_stdout", "input": "16 10\n1 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775590\n"}, {"type": "stdin_stdout", "input": "16 10\n0 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi has N blue cards and M red cards. A string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i.\n\nTakahashi will now announce a string, a... | [{"type": "stdin_stdout", "input": "1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nuoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nuoldemort\nvoldemort\nvoldemort\nvoleemo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKode Festival is an anual contest where the hardest stone in the world is determined. (Kode is a Japanese word for \"hardness\".)\n\nThis year, 2^N stones participated. The hardness of the i-th stone is A_i.\n\nIn the con... | [{"type": "stdin_stdout", "input": "3\n2\n1\n-3\n4\n-1\n25\n110\n1014", "output": "872\n"}, {"type": "stdin_stdout", "input": "3\n2\n1\n-3\n4\n-1\n25\n111\n1014", "output": "871\n"}, {"type": "stdin_stdout", "input": "3\n2\n1\n-3\n4\n-2\n25\n111\n1014", "output": "870\n"}, {"type": "stdin_stdout", "input": "3\n2\n1\n-3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n<image>\n\n\nAt the request of a friend who started learning abacus, you decided to create a program to display the abacus beads. Create a program that takes a certain number as input and outputs a row of abacus beads. Ho... | [{"type": "stdin_stdout", "input": "2006\n1101", "output": "**** \n *\n=====\n * *\n**** \n* ***\n*****\n*****\n\n*****\n \n=====\n ** *\n* * \n*****\n*****\n*****\n"}, {"type": "stdin_stdout", "input": "2006\n0101", "output": "**** \n *\n=====\n * *\n**** \n* ***\n*****\n*****\n\n*****\n \n=====\n * ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAka Beko, trying to escape from 40 bandits, got lost in the city of A. Aka Beko wants to go to City B, where the new hideout is, but the map has been stolen by a bandit.\n\nKobborg, one of the thieves, sympathized with Ak... | [{"type": "stdin_stdout", "input": "0100\n0101\n10100\n10000\n0101011\n1011\n011111\n#", "output": "Yes\nNo\nYes\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "0100\n0100\n10100\n10000\n0101011\n1001\n011111\n#", "output": "Yes\nYes\nYes\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "0100\n0100\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nAt IOI Confectionery, rice crackers are baked using the traditional method since the company was founded. This traditional method is to bake the front side for a certain period of time with charcoal, turn it ov... | [{"type": "stdin_stdout", "input": "2 5\n0 1 1 1 0\n1 0 0 0 1\n3 6\n1 0 0 0 1 0\n1 1 1 0 1 0\n1 0 1 1 0 1\n0 0", "output": "10\n15\n"}, {"type": "stdin_stdout", "input": "2 5\n1 1 1 1 0\n0 0 0 0 1\n3 6\n1 0 0 0 0 1\n0 1 1 0 1 0\n1 0 1 1 0 1\n0 0", "output": "10\n16\n"}, {"type": "stdin_stdout", "input": "2 5\n1 1 1 1 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShe catched the thrown coin that draws parabolic curve with her sparkling fingers. She is an ESPer. Yes, she is an electro-master who has the third strongest power among more than one million ESPers in the city. Being fli... | [{"type": "stdin_stdout", "input": "10.328181706040372\n1.2129508820938308 0.8573113359511872 1.4723271231711133 0.8719653577025106\n2.7936576829562947\n1.6284720172281655 0.042076349022347914 1.0082063051036116 0.8077902409181328\n0", "output": "impossible\nimpossible\n"}, {"type": "stdin_stdout", "input": "11.3176862... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA mobile phone company ACMICPC (Advanced Cellular, Mobile, and Internet-Connected Phone Corporation) is planning to set up a collection of antennas for mobile phones in a city called Maxnorm. The company ACMICPC has sever... | [{"type": "stdin_stdout", "input": "3\n4.0 4.919471432458173 3.0\n5.0 6.0 3.0\n5.5 5.905781212152949 1.4338480515274736\n2\n3.425881146117804 3.0 3.9422533178461854\n2.0201718577591117 2.4837552710328548 2.0844959491534008\n0", "output": "1 47.40\n2 62.17\n"}, {"type": "stdin_stdout", "input": "3\n4.0 4.919471432458173... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA straight tunnel without branches is crowded with busy ants coming and going. Some ants walk left to right and others right to left. All ants walk at a constant speed of 1 cm/s. When two ants meet, they try to pass each ... | [{"type": "stdin_stdout", "input": "3 11\nR 1\nL 2\nL 5\n1 20\nR 1\n2 10\nR 5\nL 7\n2 10\nR 2\nL 8\n2 99\nR 1\nL 98\n4 10\nL 1\nR 4\nL 8\nR 9\n6 10\nR 2\nR 3\nL 4\nR 6\nL 7\nL 8\n0 0", "output": "10 3\n19 1\n7 1\n8 1\n98 2\n8 2\n8 3\n"}, {"type": "stdin_stdout", "input": "3 11\nR 1\nL 2\nL 5\n1 10\nR 1\n2 10\nR 5\nL 7\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nGiven a natural number N less than or equal to 12, find the smallest natural number such that the number of divisors is exactly N.\n\nConstraints\n\n* 1 ≤ N ≤ 12\n\nInput\n\nOne natural number N is given in one... | [{"type": "stdin_stdout", "input": "011", "output": "1024\n"}, {"type": "stdin_stdout", "input": "011", "output": "1024\n"}, {"type": "stdin_stdout", "input": "11", "output": "1024\n"}, {"type": "stdin_stdout", "input": "11", "output": "1024\n"}, {"type": "stdin_stdout", "input": "010", "output": "48\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given N non-overlapping circles in xy-plane. The radius of each circle varies, but the radius of the largest circle is not double longer than that of the smallest.\n\n<image>\n\nFigure 1: The Sample Input\n\nThe d... | [{"type": "stdin_stdout", "input": "4\n3.307280934588015 0.7642036899017219 2.9975443060138307\n3.0890161534289398 0.6780678528661457 4.906860770397891\n3.468973691756493 5.995537907012198 0.06334557687080211\n2.4219246439893203 3.2220571965352227 5.068471740319732\n0", "output": "-4.485038669176\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nAOR Co., Ltd. (Association Of Return home) has $ N $ employees.\n\nEmployee $ i $ wants to use the elevator to go down to the $ 1 $ floor and arrives in front of the elevator on the $ F_i $ floor at time $ t_i ... | [{"type": "stdin_stdout", "input": "3 1\n-1 24\n1 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 1\n-2 24\n1 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 1\n-4 24\n1 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 -2\n11 4\n2 8", "output": "-1\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant loves lucky strings. Everybody knows that the lucky string is a string of digits that contains only the lucky digits 4 and 7. For example, strings \"47\", \"744\", \"4\" are lucky while \"5\", \"17\", ... | [{"type": "stdin_stdout", "input": "4\n4\n14\n707\n479\n7\n8\n1675475\n9756417", "output": "4\n77\n\n777744\n"}, {"type": "stdin_stdout", "input": "4\n4\n7\n707\n479\n7\n8\n1675475\n9756417", "output": "7\n77\n\n777744\n"}, {"type": "stdin_stdout", "input": "4\n0\n7\n435\n479\n7\n8\n1675475\n9756417", "output": "7\n74\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPavel made a photo of his favourite stars in the sky. His camera takes a photo of all points of the sky that belong to some rectangle with sides parallel to the coordinate axes.\n\nStrictly speaking, it makes a photo of a... | [{"type": "stdin_stdout", "input": "2\n282238675 111160538 526707498 169652181\n", "output": "14299383119546189\n"}, {"type": "stdin_stdout", "input": "2\n229872385 40870434 715428884 160550871\n", "output": "46761413035493300\n"}, {"type": "stdin_stdout", "input": "2\n186213023 111160538 526707498 169652181\n", "outpu... | 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 ≤ x ≤ n) can be formed using some (possibly one or all) number of these packets.\n\nEach packet may only be used ent... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "723061816\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "517188853\n", "output": "29\n"}, {"type": "stdin_stdout", "input": "237913214\n", "output": "28\n"}, {"type": "stdin_stdout", "input": "536870911\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDark Assembly is a governing body in the Netherworld. Here sit the senators who take the most important decisions for the player. For example, to expand the range of the shop or to improve certain characteristics of the c... | [{"type": "stdin_stdout", "input": "8 1 8109\n1944 40\n9732 40\n9214 80\n1770 40\n7837 50\n7430 100\n1753 30\n3991 60\n", "output": "0.6441514424\n"}, {"type": "stdin_stdout", "input": "8 3 6395\n8159 90\n4143 50\n6954 50\n5011 20\n9872 10\n7689 90\n8811 70\n2058 10\n", "output": "0.5175644027\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn his free time, Chouti likes doing some housework. He has got one new task, paint some bricks in the yard.\n\nThere are n bricks lined in a row on the ground. Chouti has got m paint buckets of different colors at hand, ... | [{"type": "stdin_stdout", "input": "1411 1081 1082\n", "output": "238077838\n"}, {"type": "stdin_stdout", "input": "2000 1234 1800\n", "output": "550745740\n"}, {"type": "stdin_stdout", "input": "1841 1185 1765\n", "output": "773828348\n"}, {"type": "stdin_stdout", "input": "2000 2000 1999\n", "output": "694730459\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles:\n\n<image>\n\nIt turned o... | [{"type": "stdin_stdout", "input": "249 35\n", "output": "0.44721996534695957\n"}, {"type": "stdin_stdout", "input": "87 010\n", "output": "0.37454615226200993\n"}, {"type": "stdin_stdout", "input": "101 100\n", "output": "3.2098109040106433\n"}, {"type": "stdin_stdout", "input": "263 35\n", "output": "0.42312695404372... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is a simplified version of the task Toy Train. These two versions differ only in the constraints. Hacks for this version are disabled.\n\nAlice received a set of Toy Train™ from Bob. It consists of one train and a co... | [{"type": "stdin_stdout", "input": "5000 1\n4008 1126\n", "output": "6125 6124 6123 6122 6121 6120 6119 6118 6117 6116 6115 6114 6113 6112 6111 6110 6109 6108 6107 6106 6105 6104 6103 6102 6101 6100 6099 6098 6097 6096 6095 6094 6093 6092 6091 6090 6089 6088 6087 6086 6085 6084 6083 6082 6081 6080 6079 6078 6077 6076 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's define a number ebne (even but not even) if and only if its sum of digits is divisible by 2 but the number itself is not divisible by 2. For example, 13, 1227, 185217 are ebne numbers, while 12, 2, 177013, 265918 ar... | [{"type": "stdin_stdout", "input": "36\n6\n165310\n6\n177978\n6\n211759\n6\n212643\n6\n229540\n6\n250029\n6\n211519\n6\n256097\n6\n163478\n5\n91505\n5\n79280\n6\n260629\n6\n128051\n6\n121972\n6\n261633\n6\n172044\n6\n119055\n6\n208323\n6\n149942\n6\n161236\n6\n177150\n6\n233766\n5\n97949\n6\n230107\n6\n175822\n6\n21354... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKate has a set S of n integers \\{1, ..., n\\} . \n\nShe thinks that imperfection of a subset M ⊆ S is equal to the maximum of gcd(a, b) over all pairs (a, b) such that both a and b are in M and a ≠ b. \n\nKate is a very ... | [{"type": "stdin_stdout", "input": "21031\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given three integers x, y and n. Your task is to find the maximum integer k such that 0 ≤ k ≤ n that k mod x = y, where mod is modulo operation. Many programming languages use percent operator % to implement it.\n... | [{"type": "stdin_stdout", "input": "7\n7 5 12345\n5 0 4\n10 5 15\n17 8 54321\n499999993 9 1000000000\n10 5 187\n2 0 999999999\n", "output": "12339\n0\n15\n54306\n999999995\n185\n999999998\n"}, {"type": "stdin_stdout", "input": "7\n7 5 12345\n5 0 4\n10 5 15\n17 8 54321\n499999993 5 1000000000\n10 5 187\n2 0 999999999\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call a list of positive integers a_0, a_1, ..., a_{n-1} a power sequence if there is a positive integer c, so that for every 0 ≤ i ≤ n-1 then a_i = c^i.\n\nGiven a list of n positive integers a_0, a_1, ..., a_{n-1},... | [{"type": "stdin_stdout", "input": "100\n881 479 355 759 257 497 690 598 275 446 439 787 257 326 436 713 322 5 253 781 434 307 164 154 241 381 38 942 680 906 240 11 431 478 628 1203 346 74 493 964 455 746 950 41 585 549 892 687 264 41 487 676 63 453 861 980 477 901 80 907 285 506 619 748 773 743 56 925 651 685 845 313 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the hard version of the problem. The difference between the versions is that the easy version has no swap operations. You can make hacks only if all versions of the problem are solved.\n\nPikachu is a cute and fri... | [{"type": "stdin_stdout", "input": "5\n2 0\n1 2\n2 1\n1 2\n1 2\n2 1\n2 1\n1 2\n3 9\n1 2 3\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n3 0\n3 2 1\n", "output": "2\n2\n2\n2\n2\n3\n4\n4\n3\n3\n3\n3\n4\n4\n3\n3\n"}, {"type": "stdin_stdout", "input": "5\n2 0\n1 2\n2 1\n1 2\n1 2\n2 1\n2 1\n1 2\n3 9\n1 2 3\n1 2\n1 3\n2 3\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected graph with n vertices and m edges. Also, you are given an integer k.\n\nFind either a clique of size k or a non-empty subset of vertices such that each vertex of this subset has at least k neig... | [{"type": "stdin_stdout", "input": "3\n5 9 4\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n10 15 3\n1 2\n2 3\n3 4\n4 5\n5 1\n1 7\n2 8\n3 9\n4 10\n5 6\n7 10\n10 8\n8 6\n6 9\n9 7\n4 5 4\n1 2\n2 3\n3 4\n4 1\n1 3\n", "output": "2\n4 1 2 3 \n1 10\n1 2 3 4 5 6 7 8 9 10 \n-1\n"}, {"type": "stdin_stdout", "input": "3\n5 9 4\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAthenaeus has just finished creating his latest musical composition and will present it tomorrow to the people of Athens. Unfortunately, the melody is rather dull and highly likely won't be met with a warm reception. \n\n... | [{"type": "stdin_stdout", "input": "5\n6\n1 2 2 2 5 11\n2\n2 4\n6\n1 1 3 4 4 10\n1\n1\n6\n1 1 1 2 2 2\n", "output": "5\n2\n6\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n6\n1 2 2 4 6 11\n2\n1 4\n6\n1 1 1 4 4 10\n1\n1\n6\n1 1 2 2 2 2\n", "output": "6\n2\n5\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n6\n1 2 2 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer x. Check whether the number x is representable as the sum of the cubes of two positive integers.\n\nFormally, you need to check if there are two integers a and b (1 ≤ a, b) such that a^3+b... | [{"type": "stdin_stdout", "input": "8\n420587971613\n681238648792\n817378345476\n509923060101\n202232821384\n387799635832\n215157629382\n698361920355\n", "output": "NO\nYES\nYES\nYES\nYES\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "8\n187759228040\n681238648792\n817378345476\n509923060101\n202232821384\n387799... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp is wondering about buying a new computer, which costs c tugriks. To do this, he wants to get a job as a programmer in a big company.\n\nThere are n positions in Polycarp's company, numbered starting from one. An ... | [{"type": "stdin_stdout", "input": "3\n4 15\n1 3 10 11\n1 2 7\n4 100\n1 5 10 50\n3 14 12\n2 1000000000\n1 1\n1\n", "output": "\n6\n13\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n4 15\n1 3 20 11\n1 2 13\n4 100\n2 5 10 50\n3 26 12\n2 1000000000\n1 1\n1\n", "output": "5\n14\n1000000000\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne must train much to do well on wizardry contests. So, there are numerous wizardry schools and magic fees.\n\nOne of such magic schools consists of n tours. A winner of each tour gets a huge prize. The school is organis... | [{"type": "stdin_stdout", "input": "86 81 36\n84 44 92 12 39 24 70 73 17 43 50 59 9 89 87 67 80 35 7 49 6 23 1 19 2 70 40 84 4 28 18 60 13 97 3 76 69 5 13 26 55 27 21 62 17 3 6 40 55 69 16 56 13 55 20 72 35 13 38 24 14 73 73 92 75 46 92 39 22 86 0 70 12 95 48 40 37 69 4 83 42 9 4 63 66 56\n16 5 2 16 -1 21 11 -1 1 48 -1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n cities numbered from 1 to n in Berland. Some of them are connected by two-way roads. Each road has its own length — an integer number from 1 to 1000. It is known that from each city it is possible to get to an... | [{"type": "stdin_stdout", "input": "5\n0 954 1255 266 751\n954 0 1677 688 1173\n1255 1677 0 989 504\n266 688 989 0 485\n751 1173 504 485 0\n5\n5 2 1509\n3 4 692\n3 5 756\n3 1 151\n2 5 262\n", "output": "8742 7851 7851 6398 5111 "}, {"type": "stdin_stdout", "input": "5\n0 954 1255 266 751\n954 0 1677 688 1173\n1255 1677... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way that the leftmost item has number 1, the rightmost item has number n. Each item has a weight, the i-th item weig... | [{"type": "stdin_stdout", "input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 100 00000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 100 00001 10000\n000 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "2 100 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwo semifinals have just been in the running tournament. Each semifinal had n participants. There are n participants advancing to the finals, they are chosen as follows: from each semifinal, we choose k people (0 ≤ 2k ≤ n... | [{"type": "stdin_stdout", "input": "8\n100 101\n200 201\n300 301\n310 400\n320 500\n330 600\n340 700\n350 800\n", "output": "11111000\n11110000\n"}, {"type": "stdin_stdout", "input": "8\n100 101\n200 201\n300 157\n310 400\n320 500\n330 600\n340 700\n350 800\n", "output": "11111000\n11110000\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou can find anything whatsoever in our Galaxy! A cubical planet goes round an icosahedral star. Let us introduce a system of axes so that the edges of the cubical planet are parallel to the coordinate axes and two opposi... | [{"type": "stdin_stdout", "input": "0 0 0\n0 1 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1 0\n0 1 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 0 0\n0 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1 1\n0 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJzzhu has picked n apples from his big apple tree. All the apples are numbered from 1 to n. Now he wants to sell them to an apple store. \n\nJzzhu will pack his apples into groups and then sell them. Each group must conta... | [{"type": "stdin_stdout", "input": "15686\n", "output": "7422\n3 6\n9 12\n15 18\n21 24\n27 30\n33 36\n39 42\n45 48\n51 54\n57 60\n63 66\n69 72\n75 78\n81 84\n87 90\n93 96\n99 102\n105 108\n111 114\n117 120\n123 126\n129 132\n135 138\n141 144\n147 150\n153 156\n159 162\n165 168\n171 174\n177 180\n183 186\n189 192\n195 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya is studying in the last class of school and soon he will take exams. He decided to study polynomials. Polynomial is a function P(x) = a0 + a1x1 + ... + anxn. Numbers ai are called coefficients of a polynomial, non-n... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1001000000000000000 1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1001000000000000000 1000000000000000000 1000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIlya got tired of sports programming, left university and got a job in the subway. He was given the task to determine the escalator load factor. \n\nLet's assume that n people stand in the queue for the escalator. At each... | [{"type": "stdin_stdout", "input": "2000 1.00 2000\n", "output": "2000.000000000000\n"}, {"type": "stdin_stdout", "input": "2000 0.99 2000\n", "output": "1980.000000000000\n"}, {"type": "stdin_stdout", "input": "2000 0.61 2000\n", "output": "1220.000000000000\n"}, {"type": "stdin_stdout", "input": "1000 0.90 1733\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAri the monster is not an ordinary monster. She is the hidden identity of Super M, the Byteforces’ superhero. Byteforces is a country that consists of n cities, connected by n - 1 bidirectional roads. Every road connects ... | [{"type": "stdin_stdout", "input": "63 20\n35 26\n54 5\n32 56\n56 53\n59 46\n37 31\n46 8\n4 1\n2 47\n59 42\n55 11\n62 6\n30 7\n60 24\n41 36\n34 22\n24 34\n21 2\n12 52\n8 44\n60 21\n24 30\n48 35\n48 25\n32 57\n20 37\n11 54\n11 62\n42 58\n31 43\n12 23\n55 48\n51 55\n41 27\n25 33\n21 18\n42 12\n4 15\n51 60\n62 39\n46 41\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: given the number of tanks that go into the battle from e... | [{"type": "stdin_stdout", "input": "6\n1000000000000000000000000000000000000 11965651543 1000000000000000000000000000000000000 1000000000000000000000000000000000000 1000000000000000000000000000000000000 1000000000000000000000000000000000000\n", "output": "1196565154300000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected graph that consists of n vertices and m edges. Initially, each edge is colored either red or blue. Each turn a player picks a single vertex and switches the color of all edges incident to it. T... | [{"type": "stdin_stdout", "input": "11 7\n1 2 B\n1 3 R\n3 2 R\n4 5 R\n6 7 R\n8 9 R\n10 11 R\n", "output": "5\n3 4 6 8 10 \n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 R\n1 3 R\n2 3 R\n4 5 B\n5 6 B\n5 6 B\n", "output": "1\n5\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 R\n1 3 R\n2 6 R\n4 5 B\n5 6 B\n5 6 B\n", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy is the number of subsequences of length 2 of the string s equal to the sequence {x, y}. \n\nIn these pro... | [{"type": "stdin_stdout", "input": "999961560 999983920 999983921 999961560\n", "output": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWell, the series which Stepan watched for a very long time, ended. In total, the series had n episodes. For each of them, Stepan remembers either that he definitely has watched it, or that he definitely hasn't watched it,... | [{"type": "stdin_stdout", "input": "100 100\n????????????????????????????????????????????????????????????????????????????????????????????????????\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 000\n????????????????????????????????????????????????????????????????????????????????????????????????????\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still needs a CV to apply for a job.\n\nDuring all his career Hideo has produced n game... | [{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n1 1 1 1 1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's another Start[c]up finals, and that means there is pizza to order for the onsite contestants. There are only 2 types of pizza (obviously not, but let's just pretend for the sake of the problem), and all pizzas contai... | [{"type": "stdin_stdout", "input": "25 6\n1 10 5\n1 8 4\n1 8 2\n4 8 9\n3 2 8\n1 9 5\n2 10 10\n3 9 6\n3 5 4\n2 7 8\n2 3 2\n2 6 8\n3 7 8\n4 3 7\n1 8 1\n3 6 4\n3 2 8\n2 2 1\n4 8 8\n4 15 4\n3 10 2\n3 6 6\n2 2 5\n1 6 2\n4 1 5\n", "output": "477\n"}, {"type": "stdin_stdout", "input": "25 6\n1 10 5\n1 8 4\n1 8 2\n4 8 9\n3 2 8... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.