problem_id stringlengths 6 31 | task_type stringclasses 1
value | prompt stringlengths 29 13.2k | verification_info stringlengths 160 168M |
|---|---|---|---|
codeforces_primeintellect_500 | deepcoder | Solve the following coding problem using the programming language python:
Alice and Bob got very bored during a long car trip so they decided to play a game. From the window they can see cars of different colors running past them. Cars are going one after another.
The game rules are like this. Firstly Alice chooses s... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 1\\n2 1 4 2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 2\\n2 2 4 5 3\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 10\\n1 2 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 ... |
codeforces_primeintellect_501 | deepcoder | Solve the following coding problem using the programming language python:
A one-dimensional Japanese crossword can be represented as a binary string of length x. An encoding of this crossword is an array a of size n, where n is the number of segments formed completely of 1's, and a_{i} is the length of i-th segment. N... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 4\\n1 3\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 10\\n3 3 2\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 10\\n1 3\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n1\... |
codeforces_primeintellect_502 | deepcoder | Solve the following coding problem using the programming language python:
You have unlimited number of coins with values $1, 2, \ldots, n$. You want to select some set of coins having the total value of $S$.
It is allowed to have multiple coins with the same value in the set. What is the minimum number of coins requ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 11\\n\", \"output\": \"3\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 16\\n\", \"output\": \"3\"}, {\"type\": \"stdin_stdout\", \"input\": \"14 28\\n\", \"output\": \"2\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 29\\n\", \"output\": \"6\"}, {\"type\... |
codeforces_primeintellect_503 | deepcoder | Solve the following coding problem using the programming language python:
A string is called palindrome if it reads the same from left to right and from right to left. For example "kazak", "oo", "r" and "mikhailrubinchikkihcniburliahkim" are palindroms, but strings "abb" and "ij" are not.
You are given string s consi... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"aabc\\n\", \"output\": \"abba\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"aabcd\\n\", \"output\": \"abcba\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"u\\n\", \"output\": \"u\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"ttttt\\n\", \"output\": \"... |
codeforces_primeintellect_504 | deepcoder | Solve the following coding problem using the programming language python:
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is now stronger.
For each chess piece we know its we... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"...QK...\\n........\\n........\\n........\\n........\\n........\\n........\\n...rk...\\n\", \"output\": \"White\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"rnbqkbnr\\npppppppp\\n........\\n........\\n........\\n........\\nPPPPPPPP\\nRNBQKBNR\\n\", \"outp... |
codeforces_primeintellect_505 | deepcoder | Solve the following coding problem using the programming language python:
Jumbo Takahashi will play golf on an infinite two-dimensional grid.
The ball is initially at the origin (0, 0), and the goal is a grid point (a point with integer coordinates) (X, Y). In one stroke, Jumbo Takahashi can perform the following oper... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"11\\n-1 2\\n\", \"output\": \"3\\n7 4\\n2 10\\n-1 2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4600\\n52 149\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n9 9\\n\", \"output\": \"5\\n1 3\\n4 2\\n4 6\\n6 8\\n9 9\\n\"}, {\"ty... |
codeforces_primeintellect_506 | deepcoder | Solve the following coding problem using the programming language python:
Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible!
Aside from loving sweet things, thieves from this area are known to be very greedy. So after a thief takes his number of chocolates for... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n\", \"output\": \"54\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"27\\n\", \"output\": \"152\\n\"}, {\"... |
codeforces_primeintellect_507 | deepcoder | Solve the following coding problem using the programming language python:
You are given two circles. Find the area of their intersection.
-----Input-----
The first line contains three integers x_1, y_1, r_1 ( - 10^9 ≤ x_1, y_1 ≤ 10^9, 1 ≤ r_1 ≤ 10^9) — the position of the center and the radius of the first circle.
... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"0 0 4\\n6 0 4\\n\", \"output\": \"7.25298806364175601379\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 0 5\\n11 0 5\\n\", \"output\": \"0.00000000000000000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 0 10\\n9 0 1\\n\", \"output\": \"3.141592653... |
codeforces_primeintellect_508 | deepcoder | Solve the following coding problem using the programming language python:
Chouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent some small games.
He came up with the following game. The player has a positive integer $n$. Initially t... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"8\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"1\\n\"}, {\"type\"... |
codeforces_primeintellect_509 | deepcoder | Solve the following coding problem using the programming language python:
Bandits appeared in the city! One of them is trying to catch as many citizens as he can.
The city consists of $n$ squares connected by $n-1$ roads in such a way that it is possible to reach any square from any other square. The square number $1... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1 1\\n3 1 2\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 1\\n3 1 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 1\\n2 0 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": ... |
codeforces_primeintellect_510 | deepcoder | Solve the following coding problem using the programming language python:
Analyzing the mistakes people make while typing search queries is a complex and an interesting work. As there is no guaranteed way to determine what the user originally meant by typing some query, we have to use different sorts of heuristics.
P... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"7\\nreading\\ntrading\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\nsweet\\nsheep\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\ntoy\\ntry\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"inp... |
codeforces_primeintellect_511 | deepcoder | Solve the following coding problem using the programming language python:
Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, of which he sadly has none. To deal with the problem, he has decided to hack the banks. [Image]
There ar... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 5\\n1 2\\n2 3\\n3 4\\n4 5\\n\", \"output\": \"5\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n38 -29 87 93 39 28 -55\\n1 2\\n2 5\\n3 2\\n2 4\\n1 7\\n7 6\\n\", \"output\": \"93\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 7 6 7\\n1 5\\... |
codeforces_primeintellect_512 | deepcoder | Solve the following coding problem using the programming language python:
The three friends, Kuro, Shiro, and Katie, met up again! It's time for a party...
What the cats do when they unite? Right, they have a party. Since they wanted to have as much fun as possible, they invited all their friends. Now $n$ cats are at... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"7 4\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n\", \"output\": \"0\\n\"}, {... |
codeforces_primeintellect_513 | deepcoder | Solve the following coding problem using the programming language python:
Hongcow likes solving puzzles.
One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 3\\nXXX\\nXXX\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n.X\\nXX\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 5\\n.....\\n..X..\\n.....\\n.....\\n.....\\n\", \"output\": \"YES\\n\"}, {\"type\"... |
codeforces_primeintellect_514 | deepcoder | Solve the following coding problem using the programming language python:
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments parallel to... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 -1\\n1 1\\n1 2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"-1 -1\\n-1 3\\n4 3\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n2 3\\n3 2\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input... |
codeforces_primeintellect_515 | deepcoder | Solve the following coding problem using the programming language python:
An undirected graph is called k-regular, if the degrees of all its vertices are equal k. An edge of a connected graph is called a bridge, if after removing it the graph is being split into two connected components.
Build a connected undirected ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"YES\\n2 1\\n1 2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"YES\\n10 15\\n1 6\\n1 2\\n1 3\\n2 4\\n2 5\\n3 4\\n3 5\\n4 5\\n6 7\\n6 8\\n7 9\\n7 10\\n8 9\\n8 10\\n9 10\\n\"}, {\"type\": \"stdin_stdout\", \"input\"... |
codeforces_primeintellect_516 | deepcoder | Solve the following coding problem using the programming language python:
You are given two strings $s$ and $t$, both consisting only of lowercase Latin letters.
The substring $s[l..r]$ is the string which is obtained by taking characters $s_l, s_{l + 1}, \dots, s_r$ without changing the order.
Each of the occurrenc... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10 3 4\\ncodeforces\\nfor\\n1 3\\n3 10\\n5 6\\n5 7\\n\", \"output\": \"0\\n1\\n0\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"15 2 3\\nabacabadabacaba\\nba\\n1 15\\n3 4\\n2 14\\n\", \"output\": \"4\\n0\\n3\\n\"}, {\"type\": \"stdin_stdout\", \"input\"... |
codeforces_primeintellect_517 | deepcoder | Solve the following coding problem using the programming language python:
Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called a k-tree.
A k-tree is an infinite rooted tree where:
each vertex has exactly k children... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 3 2\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3 3\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 3 2\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 5 2\\n\", \"output\": \"7\... |
codeforces_primeintellect_518 | deepcoder | Solve the following coding problem using the programming language python:
Recently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a × b squares, and each square is colored white or black. There are integers to the left of the rows and to the top of the columns, en... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\nBBW\\n\", \"output\": \"1\\n2 \"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\nBWBWB\\n\", \"output\": \"3\\n1 1 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\nWWWW\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\nBBBB\\n... |
codeforces_primeintellect_519 | deepcoder | Solve the following coding problem using the programming language python:
Recently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as CBS).
Note that a bracket sequence is correct if it is possible to get a correct mathematical expression by adding "+"-s and "1"-... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"8 4 5\\n(())()()\\nRDLD\\n\", \"output\": \"()\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"12 5 3\\n((()())(()))\\nRRDLD\\n\", \"output\": \"(()(()))\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 8 8\\n(())()()\\nLLLLLLDD\\n\", \"output\": \"()()\\n... |
codeforces_primeintellect_520 | deepcoder | Solve the following coding problem using the programming language python:
A TV show called "Guess a number!" is gathering popularity. The whole Berland, the old and the young, are watching the show.
The rules are simple. The host thinks of an integer y and the participants guess it by asking questions to the host. Th... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n>= 1 Y\\n< 3 N\\n<= -3 N\\n> 55 N\\n\", \"output\": \"17\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n> 100 Y\\n< -100 Y\\n\", \"output\": \"Impossible\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n< 1 N\\n> 1 N\\n> 1 N\\n> 1 N\\n\", \"outp... |
codeforces_primeintellect_521 | deepcoder | Solve the following coding problem using the programming language python:
You are given $a$ uppercase Latin letters 'A' and $b$ letters 'B'.
The period of the string is the smallest such positive integer $k$ that $s_i = s_{i~mod~k}$ ($0$-indexed) for each $i$. Note that this implies that $k$ won't always divide $a+b ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 4\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 2\\n\", \"output\": \"2\\n\"}, {... |
codeforces_primeintellect_522 | deepcoder | Solve the following coding problem using the programming language python:
In 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 is a scouter, if there a... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"8 3\\nNO NO YES YES YES NO\\n\", \"output\": \"Ab Ac Ab Ac Af Ag Ah Ag \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 8\\nYES NO\\n\", \"output\": \"Ab Ac Ad Ae Af Ag Ah Ai Ac \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\nNO NO\\n\", \"output\"... |
codeforces_primeintellect_523 | deepcoder | Solve the following coding problem using the programming language python:
Two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. The bears are so greedy that they are ready to fight for the larger piece. That's where the fox comes in and starts the dialog: "Litt... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"15 20\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"14 8\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 6\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n\", \"output\": \"0\\n\"... |
codeforces_primeintellect_524 | deepcoder | Solve the following coding problem using the programming language python:
A group of $n$ dancers rehearses a performance for the closing ceremony. The dancers are arranged in a row, they've studied their dancing moves and can't change positions. For some of them, a white dancing suit is already bought, for some of the... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 100 1\\n0 1 2 1 2\\n\", \"output\": \"101\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 10 12\\n1 2 0\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 12 1\\n0 1 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"inp... |
codeforces_primeintellect_525 | deepcoder | Solve the following coding problem using the programming language python:
You are given a cube of size k × k × k, which consists of unit cubes. Two unit cubes are considered neighbouring, if they have common face.
Your task is to paint each of k^3 unit cubes one of two colours (black or white), so that the following ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"bb\\nww\\n\\nbb\\nww\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\":... |
codeforces_primeintellect_526 | deepcoder | Solve the following coding problem using the programming language python:
Duff is in love with lovely numbers! A positive integer x is called lovely if and only if there is no such positive integer a > 1 such that a^2 is a divisor of x. [Image]
Malek has a number store! In his store, he has only divisors of positive... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10\\n\", \"output\": \"10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"12\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"2\\n\"}, {\"typ... |
codeforces_primeintellect_527 | deepcoder | Solve the following coding problem using the programming language python:
Bajtek, known for his unusual gifts, recently got an integer array $x_0, x_1, \ldots, x_{k-1}$.
Unfortunately, after a huge array-party with his extraordinary friends, he realized that he'd lost it. After hours spent on searching for a new toy,... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 5\\n\", \"output\": \"5\\n1 2 3 4 5 \"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 3 5 6 8\\n\", \"output\": \"2\\n3 5 \"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 5 3\\n\", \"output\": \"1\\n3 \"}, {\"type\": \"stdin_stdout\", \"inp... |
codeforces_primeintellect_528 | deepcoder | Solve the following coding problem using the programming language python:
A positive integer is called a 2-3-integer, if it is equal to 2^{x}·3^{y} for some non-negative integers x and y. In other words, these integers are such integers that only have 2 and 3 among their prime divisors. For example, integers 1, 6, 9, ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 10\\n\", \"output\": \"7\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 200\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 2000000000\\n\", \"output\": \"326\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1088391168 1934917... |
codeforces_primeintellect_529 | deepcoder | Solve the following coding problem using the programming language python:
Each evening after the dinner the SIS's students gather together to play the game of Sport Mafia.
For the tournament, Alya puts candies into the box, which will serve as a prize for a winner. To do that, she performs $n$ actions. The first act... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 1\\n\", \"output\": \"0\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 11\\n\", \"output\": \"4\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 0\\n\", \"output\": \"3\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\n\", \"output\": \"1\"}, {\"type\": \... |
codeforces_primeintellect_530 | deepcoder | Solve the following coding problem using the programming language python:
Imp likes his plush toy a lot.
[Image]
Recently, he found a machine that can clone plush toys. Imp knows that if he applies the machine to an original toy, he additionally gets one more original toy and one copy, and if he applies the machin... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 3\\n\", \"output\": \"Yes\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 2\\n\", \"output\": \"No\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1000 1001\\n\", \"output\": \"Yes\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1000000000 999999999\\n... |
codeforces_primeintellect_531 | deepcoder | Solve the following coding problem using the programming language python:
Petya loves computer games. Finally a game that he's been waiting for so long came out!
The main character of this game has n different skills, each of which is characterized by an integer a_{i} from 0 to 100. The higher the number a_{i} is, th... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 4\\n7 9\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 8\\n17 15 19\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n99 100\\n\", \"output\": \"20\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 100... |
codeforces_primeintellect_532 | deepcoder | Solve the following coding problem using the programming language python:
На тренировку по подготовке к соревнованиям по программированию пришли n команд. Тренер для каждой команды подобрал тренировку, комплект задач для i-й команды занимает a_{i} страниц. В распоряжении тренера есть x листов бумаги, у которых обе сто... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 3 5\\n4 6\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 3 5\\n4 7\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 3 5\\n12 11 12 11 12 11\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\"... |
codeforces_primeintellect_533 | deepcoder | Solve the following coding problem using the programming language python:
Ivan has number $b$. He is sorting through the numbers $a$ from $1$ to $10^{18}$, and for every $a$ writes $\frac{[a, \,\, b]}{a}$ on blackboard. Here $[a, \,\, b]$ stands for least common multiple of $a$ and $b$. Ivan is very lazy, that's why t... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"1\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"2\"}, {\"type\": \"stdin_stdout\", \"input\": \"16\\n\", \"output\": \"5\"}, {\"type\": \"stdin_stdout\", \"input\": \"433494437\\n\", \"output\": \"2\"}, {\"type\": \... |
codeforces_primeintellect_534 | deepcoder | Solve the following coding problem using the programming language python:
In a new version of the famous Pinball game, one of the most important parts of the game field is a sequence of n bumpers. The bumpers are numbered with integers from 1 to n from left to right. There are two types of bumpers. They are denoted by... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n<<><\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n>>>>>\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n>><<\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n<<>\\n\", \"ou... |
codeforces_primeintellect_535 | deepcoder | Solve the following coding problem using the programming language python:
In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of n sticks and an instrument. Each stick is characterized by its length l_{i}.
Ilya decided to make a rectangle from the stic... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n2 4 4 2\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n2 2 3 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n100003 100004 100005 100006\\n\", \"output\": \"10000800015\\n\"}, {\"type\": \"stdin_std... |
codeforces_primeintellect_536 | deepcoder | Solve the following coding problem using the programming language python:
Petya has n positive integers a_1, a_2, ..., a_{n}.
His friend Vasya decided to joke and replaced all digits in Petya's numbers with a letters. He used the lowercase letters of the Latin alphabet from 'a' to 'j' and replaced all digits 0 with ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\nab\\nde\\naj\\n\", \"output\": \"47\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\nabcdef\\nghij\\nbdef\\naccbd\\ng\\n\", \"output\": \"136542\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\naa\\njj\\naa\\n\", \"output\": \"44\\n\"}, {\"type\":... |
codeforces_primeintellect_537 | deepcoder | Solve the following coding problem using the programming language python:
There was an epidemic in Monstropolis and all monsters became sick. To recover, all monsters lined up in queue for an appointment to the only doctor in the city.
Soon, monsters became hungry and began to eat each other.
One monster can eat ot... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n1 2 2 2 1 2\\n2\\n5 5\\n\", \"output\": \"YES\\n2 L\\n1 R\\n4 L\\n3 L\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 5\\n1\\n15\\n\", \"output\": \"YES\\n5 L\\n4 L\\n3 L\\n2 L\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 1 1 3 3\\n... |
codeforces_primeintellect_538 | deepcoder | Solve the following coding problem using the programming language python:
The Rebel fleet is afraid that the Empire might want to strike back again. Princess Heidi needs to know if it is possible to assign R Rebel spaceships to guard B bases so that every base has exactly one guardian and each spaceship has exactly on... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 3\\n0 0\\n2 0\\n3 1\\n-2 1\\n0 3\\n2 2\\n\", \"output\": \"Yes\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1\\n1 0\\n2 2\\n3 1\\n\", \"output\": \"No\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n3686 4362\\n-7485 5112\\n\", \"output\": \"Ye... |
codeforces_primeintellect_539 | deepcoder | Solve the following coding problem using the programming language python:
Поликарп мечтает стать программистом и фанатеет от степеней двойки. Среди двух чисел ему больше нравится то, которое делится на большую степень числа 2.
По заданной последовательности целых положительных чисел a_1, a_2, ..., a_{n} требуется на... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n80 7 16 4 48\\n\", \"output\": \"16 3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n21 5 3 33\\n\", \"output\": \"1 4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n8 112 52 86 93 102 24 24 100 826791168\\n\", \"output\": \"256 1\\n\"}, {\"t... |
codeforces_primeintellect_540 | deepcoder | Solve the following coding problem using the programming language python:
Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. After clicking the red button, device multiplies the displayed number by two. After clicking the... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 6\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 1\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1\\n\", \"output\": \"1\\n\"}, ... |
codeforces_primeintellect_541 | deepcoder | Solve the following coding problem using the programming language python:
As the name of the task implies, you are asked to do some work with segments and trees.
Recall that a tree is a connected undirected graph such that there is exactly one simple path between every pair of its vertices.
You are given $n$ segment... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n9 12\\n2 11\\n1 3\\n6 10\\n5 7\\n4 8\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 3\\n2 4\\n5 9\\n6 8\\n7 10\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n5 8\\n3 6\\n2 9\\n7 10\\n1 4\\n\", \... |
codeforces_primeintellect_542 | deepcoder | Solve the following coding problem using the programming language python:
We get more and more news about DDoS-attacks of popular websites.
Arseny 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$, where $t$ — the number of ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n100 200 1 1 1\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n101 99\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\... |
codeforces_primeintellect_543 | deepcoder | Solve the following coding problem using the programming language python:
Well, 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, or he is unsure, has he... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 2\\nNYNNY\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 1\\n????NN\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 8\\nNYNNY?YNNNNNN?NNNNNYNY?YYNYNN?NNNY??NNYNYNNNYNNNYNNNNNNNNY?NNNYNYN?NNNY?YY?NNYNN?... |
codeforces_primeintellect_544 | deepcoder | Solve the following coding problem using the programming language python:
We have an integer sequence A of length N, where A_1 = X, A_{i+1} = A_i + D (1 \leq i < N ) holds.
Takahashi will take some (possibly all or none) of the elements in this sequence, and Aoki will take all of the others.
Let S and T be the sum of... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 4 2\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 3 -3\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 14 20\\n\", \"output\": \"49805\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"17 3 -4\\n\", \"out... |
codeforces_primeintellect_545 | deepcoder | Solve the following coding problem using the programming language python:
Codeforces user' handle color depends on his rating — it is red if his rating is greater or equal to 2400; it is orange if his rating is less than 2400 but greater or equal to 2200, etc. Each time participant takes part in a rated contest, his r... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\nBurunduk1 2526 2537\\nBudAlNik 2084 2214\\nsubscriber 2833 2749\\n\", \"output\": \"YES\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\nApplejack 2400 2400\\nFluttershy 2390 2431\\nPinkie_Pie -2500 -2450\\n\", \"output\": \"NO\"}, {\"type\": \"stdin_std... |
codeforces_primeintellect_546 | deepcoder | Solve the following coding problem using the programming language python:
In the city of Saint Petersburg, a day lasts for $2^{100}$ minutes. From the main station of Saint Petersburg, a train departs after $1$ minute, $4$ minutes, $16$ minutes, and so on; in other words, the train departs at time $4^k$ for each integ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"100000000\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"101\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10100\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"11110100100001011001000011... |
codeforces_primeintellect_547 | deepcoder | Solve the following coding problem using the programming language python:
Let's assume that we are given a matrix b of size x × y, let's determine the operation of mirroring matrix b. The mirroring of matrix b is a 2x × y matrix c which has the following properties:
the upper half of matrix c (rows with numbers fro... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 3\\n0 0 1\\n1 1 0\\n1 1 0\\n0 0 1\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3\\n0 0 0\\n0 0 0\\n0 0 0\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 1\\n0\\n1\\n1\\n0\\n0\\n1\\n1\\n0\\n\", \"output\":... |
codeforces_primeintellect_548 | deepcoder | Solve the following coding problem using the programming language python:
A restaurant received n orders for the rental. Each rental order reserve the restaurant for a continuous period of time, the i-th order is characterized by two time values — the start time l_{i} and the finish time r_{i} (l_{i} ≤ r_{i}).
Restau... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n7 11\\n4 7\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2\\n2 3\\n3 4\\n4 5\\n5 6\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n4 8\\n1 5\\n4 7\\n2 5\\n1 3\\n6 8\\n\", \"output\": \"2\\n\"}, {\"... |
codeforces_primeintellect_549 | deepcoder | Solve the following coding problem using the programming language python:
Vova has taken his summer practice this year and now he should write a report on how it went.
Vova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will consist of exactly $n$ pa... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 2\\n5 5\\n2 2\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n5 6\\n2 2\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 1\\n4 1 10 1\\n3 2 10 1\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout... |
codeforces_primeintellect_550 | deepcoder | Solve the following coding problem using the programming language python:
100 years have passed since the last victory of the man versus computer in Go. Technologies made a huge step forward and robots conquered the Earth! It's time for the final fight between human and robot that will decide the faith of the planet.
... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 2\\n-1\\n?\\n\", \"output\": \"Yes\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 100\\n-10000\\n0\\n1\\n\", \"output\": \"Yes\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 5\\n?\\n1\\n?\\n1\\n?\\n\", \"output\": \"No\"}, {\"type\": \"stdin_stdout\", ... |
codeforces_primeintellect_551 | deepcoder | Solve the following coding problem using the programming language python:
Alice and Bob begin their day with a quick game. They first choose a starting number X_0 ≥ 3 and try to reach one million by the process described below.
Alice goes first and then they take alternating turns. In the i-th turn, the player whose... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"14\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"20\\n\", \"output\": \"15\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8192\\n\", \"output\": \"8191\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1000000\\n\", \"output\": \"998... |
codeforces_primeintellect_552 | deepcoder | Solve the following coding problem using the programming language python:
Vasya will fancy any number as long as it is an integer power of two. Petya, on the other hand, is very conservative and only likes a single integer $p$ (which may be positive, negative, or zero). To combine their tastes, they invented $p$-binar... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"24 0\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"24 1\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"24 -1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 -7\\n\", \"output\": \"2\\n\... |
codeforces_primeintellect_553 | deepcoder | Solve the following coding problem using the programming language python:
Ania has a large integer $S$. Its decimal representation has length $n$ and doesn't contain any leading zeroes. Ania is allowed to change at most $k$ digits of $S$. She wants to do it in such a way that $S$ still won't contain any leading zeroes... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 3\\n51528\\n\", \"output\": \"10028\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\n102\\n\", \"output\": \"100\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 3\\n7618... |
codeforces_primeintellect_554 | deepcoder | Solve the following coding problem using the programming language python:
Our bear's forest has a checkered field. The checkered field is an n × n table, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right. Let's denote a cell of the field on the intersection o... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 1 2 0 1 2\\n\", \"output\": \"3 1\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1 1 -1 -1 2\\n\", \"output\": \"1 1\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1 1 1 1 0\\n\", \"output\": \"1 1\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2 1 -2 -2... |
codeforces_primeintellect_555 | deepcoder | Solve the following coding problem using the programming language python:
ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length 26 where each letter of English alphabet appears exactly once. In particular, if the string has ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"ABC??FGHIJK???OPQR?TUVWXY?\\n\", \"output\": \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"}, {\"type\": \"stdin_stdout\", \"input\": \"WELCOMETOCODEFORCESROUNDTHREEHUNDREDANDSEVENTYTWO\\n\", \"output\": \"-1\"}, {\"type\": \"stdin_stdout\", \"input\": \"????????????????????... |
codeforces_primeintellect_556 | deepcoder | Solve the following coding problem using the programming language python:
Some people leave the lights at their workplaces on when they leave that is a waste of resources. As a hausmeister of DHBW, Sagheer waits till all students and professors leave the university building, then goes and turns all the lights off.
Th... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 2\\n0010\\n0100\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 4\\n001000\\n000010\\n000010\\n\", \"output\": \"12\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 3\\n01110\\n01110\\n01110\\n01110\\n\", \"output\": \"18\\n\"}, {... |
codeforces_primeintellect_557 | deepcoder | Solve the following coding problem using the programming language python:
Medicine faculty of Berland State University has just finished their admission campaign. As usual, about $80\%$ of applicants are girls and majority of them are going to live in the university dormitory for the next $4$ (hopefully) years.
The d... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 2 10\\n1 3 4 3 3\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n1 10 2 10\\n2 4 2 2\\n\", \"output\": \"10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n1 1 1 1 1 1 1\\n2 2 2 3 6 7 6\\n\", \"output\": \"2\\n\"}, {\... |
codeforces_primeintellect_558 | deepcoder | Solve the following coding problem using the programming language python:
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decided t... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 2 -5\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2 7\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1 0\\n\", \"output\": \"1... |
codeforces_primeintellect_559 | deepcoder | Solve the following coding problem using the programming language python:
Polycarpus develops an interesting theory about the interrelation of arithmetic progressions with just everything in the world. His current idea is that the population of the capital of Berland changes over time like an arithmetic progression. W... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"9\\n8 6 4 2 1 4 7 10 2\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n-1 6 -1 2 -1 4 7 -1 2\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n-1 -1 -1 -1 -1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_s... |
codeforces_primeintellect_560 | deepcoder | Solve the following coding problem using the programming language python:
High school student Vasya got a string of length n as a birthday present. This string consists of letters 'a' and 'b' only. Vasya denotes beauty of the string as the maximum length of a substring (consecutive subsequence) consisting of equal let... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 2\\nabba\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 1\\naabaabaa\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 0\\na\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\nb\\n\"... |
codeforces_primeintellect_561 | deepcoder | Solve the following coding problem using the programming language python:
Alice is the leader of the State Refactoring Party, and she is about to become the prime minister.
The elections have just taken place. There are $n$ parties, numbered from $1$ to $n$. The $i$-th party has received $a_i$ seats in the parliamen... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n100 50 50\\n\", \"output\": \"3\\n1 2 3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n80 60 60\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n6 5\\n\", \"output\": \"1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \... |
codeforces_primeintellect_562 | deepcoder | Solve the following coding problem using the programming language python:
3R2 - Standby for Action
Our dear Cafe's owner, JOE Miller, will soon take part in a new game TV-show "1 vs. $n$"!
The game goes in rounds, where in each round the host asks JOE and his opponents a common question. All participants failing to ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"1.000000000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"1.500000000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100000\\n\", \"output\": \"12.090146129863\\n\"}, {\"type\": \"stdin_stdout\", \"input\... |
codeforces_primeintellect_563 | deepcoder | Solve the following coding problem using the programming language python:
Santa Claus has n candies, he dreams to give them as gifts to children.
What is the maximal number of children for whose he can give candies if Santa Claus want each kid should get distinct positive integer number of candies. Santa Class wants ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n\", \"output\": \"2\\n1 4 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\n\", \"output\": \"3\\n1 2 6 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"1\\n2 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\":... |
codeforces_primeintellect_564 | deepcoder | Solve the following coding problem using the programming language python:
The following problem is well-known: given integers n and m, calculate $2^{n} \operatorname{mod} m$,
where 2^{n} = 2·2·...·2 (n factors), and $x \operatorname{mod} y$ denotes the remainder of division of x by y.
You are asked to solve the "re... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n42\\n\", \"output\": \"10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n58\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"98765432\\n23456789\\n\", \"output\": \"23456789\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n... |
codeforces_primeintellect_565 | deepcoder | Solve the following coding problem using the programming language python:
Victor tries to write his own text editor, with word correction included. However, the rules of word correction are really strange.
Victor thinks that if a word contains two consecutive vowels, then it's kinda weird and it needs to be replaced.... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\nweird\\n\", \"output\": \"werd\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\nword\\n\", \"output\": \"word\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\naaeaa\\n\", \"output\": \"a\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\naaaaa... |
codeforces_primeintellect_566 | deepcoder | Solve the following coding problem using the programming language python:
There are $n$ consecutive seat places in a railway carriage. Each place is either empty or occupied by a passenger.
The university team for the Olympiad consists of $a$ student-programmers and $b$ student-athletes. Determine the largest number ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 1 1\\n*...*\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 2 3\\n*...*.\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"11 3 10\\n.*....**.*.\\n\", \"output\": \"7\\n\"}, {\"type\": \"stdin_stdout\", \"input\... |
codeforces_primeintellect_567 | deepcoder | Solve the following coding problem using the programming language python:
Melody Pond was stolen from her parents as a newborn baby by Madame Kovarian, to become a weapon of the Silence in their crusade against the Doctor. Madame Kovarian changed Melody's name to River Song, giving her a new identity that allowed her ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"19\\n\", \"output\": \"1 8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"16\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"NO\\n\"}, {\... |
codeforces_primeintellect_568 | deepcoder | Solve the following coding problem using the programming language python:
There are quite a lot of ways to have fun with inflatable balloons. For example, you can fill them with water and see what happens.
Grigory and Andrew have the same opinion. So, once upon a time, they went to the shop and bought $n$ packets wit... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1 2 1\\n\", \"output\": \"1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n5 5\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n10\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1\\n\", \"o... |
codeforces_primeintellect_569 | deepcoder | Solve the following coding problem using the programming language python:
Vasya has his favourite number $n$. He wants to split it to some non-zero digits. It means, that he wants to choose some digits $d_1, d_2, \ldots, d_k$, such that $1 \leq d_i \leq 9$ for all $i$ and $d_1 + d_2 + \ldots + d_k = n$.
Vasya likes b... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"1\\n1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"4\\n1 1 1 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"27\\n\", \"output\": \"27\\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 \"}, {\"type\": \"std... |
codeforces_primeintellect_570 | deepcoder | Solve the following coding problem using the programming language python:
A tuple of positive integers {x_1, x_2, ..., x_{k}} is called simple if for all pairs of positive integers (i, j) (1 ≤ i < j ≤ k), x_{i} + x_{j} is a prime.
You are given an array a with n positive integers a_1, a_2, ..., a_{n} (not ne... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n2 3\\n\", \"output\": \"2\\n3 2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n2 2\\n\", \"output\": \"1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n2 1 1\\n\", \"output\": \"3\\n1 1 2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\... |
codeforces_primeintellect_571 | deepcoder | Solve the following coding problem using the programming language python:
Recently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of k + 1 consecutive ones, and then k consecutive zeroes.
Some examples of beautiful n... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"992\\n\", \"output\": \"496\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"81142\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"76920\\n\", \"output\": \"120\\n... |
codeforces_primeintellect_572 | deepcoder | Solve the following coding problem using the programming language python:
There are n children in Jzzhu's school. Jzzhu is going to give some candies to them. Let's number all the children from 1 to n. The i-th child wants to get at least a_{i} candies.
Jzzhu asks children to line up. Initially, the i-th child stands... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 2\\n1 3 1 4 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 4\\n1 1 2 2 3 3\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 3\\n6 1 5 4 2 3 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"inp... |
codeforces_primeintellect_573 | deepcoder | Solve the following coding problem using the programming language python:
Allen has a LOT of money. He has $n$ dollars in the bank. For security reasons, he wants to withdraw it in cash (we will not disclose the reasons here). The denominations for dollar bills are $1$, $5$, $10$, $20$, $100$. What is the minimum numb... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"125\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"43\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1000000000\\n\", \"output\": \"10000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \... |
codeforces_primeintellect_574 | deepcoder | Solve the following coding problem using the programming language python:
Permutation p is an ordered set of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element of permutation p as p_{i}. We'll call number n the size or the length o... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 1\\n\", \"output\": \"6\\n\"}, {... |
codeforces_primeintellect_575 | deepcoder | Solve the following coding problem using the programming language python:
Arkady decided to buy roses for his girlfriend.
A flower shop has white, orange and red roses, and the total amount of them is n. Arkady thinks that red roses are not good together with white roses, so he won't buy a bouquet containing both red... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 3\\n4 3 4 1 6\\nRROWW\\n\", \"output\": \"11\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 2\\n10 20 14 20 11\\nRRRRR\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"11 5\\n5 6 3 2 3 4 7 5 4 5 6\\nRWOORWORROW\\n\", \"output\": \... |
codeforces_primeintellect_576 | deepcoder | Solve the following coding problem using the programming language python:
A continued fraction of height n is a fraction of form $a_{1} + \frac{1}{a_{2} + \frac{1}{\ldots + \frac{1}{a_{n}}}}$. You are given two rational numbers, one is represented as [Image] and the other one is represented as a finite fraction of hei... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"9 4\\n2\\n2 4\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 4\\n3\\n2 3 1\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 4\\n3\\n1 2 4\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\... |
codeforces_primeintellect_577 | deepcoder | Solve the following coding problem using the programming language python:
When new students come to the Specialized Educational and Scientific Centre (SESC) they need to start many things from the beginning. Sometimes the teachers say (not always unfairly) that we cannot even count. So our teachers decided to teach us... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"||+|=|||||\\n\", \"output\": \"|||+|=||||\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"|||||+||=||\\n\", \"output\": \"Impossible\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"|+|=||||||\\n\", \"output\": \"Impossible\\n\"}, {\"type\": \"stdin_stdout\"... |
codeforces_primeintellect_578 | deepcoder | Solve the following coding problem using the programming language python:
Let us define the oddness of a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n} as \sum_{i = 1}^n |i - p_i|.
Find the number of permutations of {1,\ 2,\ ...,\ n} of oddness k, modulo 10^9+7.
-----Constraints-----
- All values in in... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"39 14\\n\", \"output\": \"74764168\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"44 350\\n\", \"output\": \"15060087\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"22 444\\n\", \"... |
codeforces_primeintellect_579 | deepcoder | Solve the following coding problem using the programming language python:
Snuke is introducing a robot arm with the following properties to his factory:
- The robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n-1 0\\n0 3\\n2 -1\\n\", \"output\": \"2\\n1 2\\nRL\\nUU\\nDR\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n0 0\\n1 0\\n2 0\\n3 0\\n4 0\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n1 1\\n1 1\\n\", \"output\": \"2\\n1 1... |
codeforces_primeintellect_580 | deepcoder | Solve the following coding problem using the programming language python:
Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters.
There is a filler word ogo in Oleg's speech. Al... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"7\\naogogob\\n\", \"output\": \"a***b\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"13\\nogogmgogogogo\\n\", \"output\": \"***gmg***\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9\\nogoogoogo\\n\", \"output\": \"*********\\n\"}, {\"type\": \"stdin_stdo... |
codeforces_primeintellect_581 | deepcoder | Solve the following coding problem using the programming language python:
Let's introduce some definitions that will be needed later.
Let $prime(x)$ be the set of prime divisors of $x$. For example, $prime(140) = \{ 2, 5, 7 \}$, $prime(169) = \{ 13 \}$.
Let $g(x, p)$ be the maximum possible integer $p^k$ where $k$ i... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10 2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"20190929 1605\\n\", \"output\": \"363165664\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"947 987654321987654321\\n\", \"output\": \"593574252\\n\"}, {\"type\": \"stdin_stdout\", \... |
codeforces_primeintellect_582 | deepcoder | Solve the following coding problem using the programming language python:
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to understand... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 5 4 6 1 3 6 2 5 5 1 2 3 5 3 1 1 2 4 6 6 4 3 4\\n\", \"output\": \"NO\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 3 5 3 2 5 2 5 6 2 6 2 4 4 4 4 1 1 1 1 6 3 6 3\\n\", \"output\": \"YES\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 6 3 3 5 5 2 6 1 1 6 4 ... |
codeforces_primeintellect_583 | deepcoder | Solve the following coding problem using the programming language python:
Not so long ago the Codecraft-17 contest was held on Codeforces. The top 25 participants, and additionally random 25 participants out of those who got into top 500, will receive a Codeforces T-shirt.
Unfortunately, you didn't manage to get into... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"239 10880 9889\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"26 7258 6123\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"493 8000 8000\\n\", \"output\": \"24\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"101... |
codeforces_primeintellect_584 | deepcoder | Solve the following coding problem using the programming language python:
Winnie-the-Pooh likes honey very much! That is why he decided to visit his friends. Winnie has got three best friends: Rabbit, Owl and Eeyore, each of them lives in his own house. There are winding paths between each pair of houses. The length o... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n2\\n3\\n1\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n2\\n3\\n5\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n1\\n8\\n3\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\... |
codeforces_primeintellect_585 | deepcoder | Solve the following coding problem using the programming language python:
You have a given picture with size $w \times h$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below:
A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empt... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 6\\n......\\n..*...\\n.****.\\n..*...\\n..*...\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 5\\n..*..\\n****.\\n.*...\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 7\\n.......\\n...*...\\n..****.\\n.... |
codeforces_primeintellect_586 | deepcoder | Solve the following coding problem using the programming language python:
Given three numbers $n, a, b$. You need to find an adjacency matrix of such an undirected graph that the number of components in it is equal to $a$, and the number of components in its complement is $b$. The matrix must be symmetric, and all dig... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 1 2\\n\", \"output\": \"YES\\n001\\n001\\n110\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3 3\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1 1\\n\", \"output\": \"YES\\n01000\\n10100\\n01010\\n00101\\n00010\\n\"}, {\"type... |
codeforces_primeintellect_587 | deepcoder | Solve the following coding problem using the programming language python:
The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds.
The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c proble... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 10\\n7 2\\n1\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n2 1\\n2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 9\\n2 2\\n3\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 5... |
codeforces_primeintellect_588 | deepcoder | Solve the following coding problem using the programming language python:
Let’s define a grid to be a set of tiles with 2 rows and 13 columns. Each tile has an English letter written in it. The letters don't have to be unique: there might be two or more tiles with the same letter written on them. Here is an example of... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"ABCDEFGHIJKLMNOPQRSGTUVWXYZ\\n\", \"output\": \"YXWVUTGHIJKLM\\nZABCDEFSRQPON\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"BUVTYZFQSNRIWOXXGJLKACPEMDH\\n\", \"output\": \"Impossible\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"DYCEUXXKMGZOINVPHWQSRTAB... |
codeforces_primeintellect_589 | deepcoder | Solve the following coding problem using the programming language python:
Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve creative tasks. Just like humans before.
It turns out that high school struggles are not gone... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 8\\n\", \"output\": \">\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 3\\n\", \"output\": \"<\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 6\\n\", \"output\": \"=\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"14 1\\n\", \"output\": \">\\n\"},... |
codeforces_primeintellect_590 | deepcoder | Solve the following coding problem using the programming language python:
Vasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinates x_1, x_2, ..., x_{n}. Vasya starts at the point with coordinate a. His goal is to visit at least n - 1 checkpoint in order to finish ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 10\\n1 7 12\\n\", \"output\": \"7\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 0\\n11 -10\\n\", \"output\": \"10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 0\\n0 0 1000 0 0\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \... |
codeforces_primeintellect_591 | deepcoder | Solve the following coding problem using the programming language python:
Let's consider equation:x^2 + s(x)·x - n = 0,
where x, n are positive integers, s(x) is the function, equal to the sum of digits of number x in the decimal number system.
You are given an integer n, find the smallest positive integer root of... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"110\\n\", \"output\": \"10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n\", \"output\": \"2\\n\"}, {\"ty... |
codeforces_primeintellect_592 | deepcoder | Solve the following coding problem using the programming language python:
George woke up and saw the current time s on the digital clock. Besides, George knows that he has slept for time t.
Help George! Write a program that will, given time s and t, determine the time p when George went to bed. Note that George coul... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"05:50\\n05:44\\n\", \"output\": \"00:06\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"00:00\\n01:00\\n\", \"output\": \"23:00\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"00:01\\n00:00\\n\", \"output\": \"00:01\\n\"}, {\"type\": \"stdin_stdout\", \"inp... |
codeforces_primeintellect_593 | deepcoder | Solve the following coding problem using the programming language python:
You are given array $a_1, a_2, \dots, a_n$. Find the subsegment $a_l, a_{l+1}, \dots, a_r$ ($1 \le l \le r \le n$) with maximum arithmetic mean $\frac{1}{r - l + 1}\sum\limits_{i=l}^{r}{a_i}$ (in floating-point numbers, i.e. without any rounding... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n6 1 6 6 0\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1000000000\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n1 1 0 1 1 1\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5... |
codeforces_primeintellect_594 | deepcoder | Solve the following coding problem using the programming language python:
On his free time, Chouti likes doing some housework. He has got one new task, paint some bricks in the yard.
There are $n$ bricks lined in a row on the ground. Chouti has got $m$ paint buckets of different colors at hand, so he painted each bri... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 3 0\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2 1\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3 2\\n\", \"output\": \"12\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"123 45 67\\n\", \"output\":... |
codeforces_primeintellect_595 | deepcoder | Solve the following coding problem using the programming language python:
A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not.
You're given a number. Determin... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"114114\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1111\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"441231\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"... |
codeforces_primeintellect_596 | deepcoder | Solve the following coding problem using the programming language python:
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in front o... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 7 1 3 2 2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 5 2 3 1 1\\n\", \"output\": \"Poor Inna and pony!\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1 1 1 1 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"inp... |
codeforces_primeintellect_597 | deepcoder | Solve the following coding problem using the programming language python:
ATMs of a well-known bank of a small country are arranged so that they can not give any amount of money requested by the user. Due to the limited size of the bill dispenser (the device that is directly giving money from an ATM) and some peculiar... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 20\\n10 50 100 500 1000 5000\\n8\\n4200\\n100000\\n95000\\n96000\\n99000\\n10100\\n2015\\n9950\\n\", \"output\": \"6\\n20\\n19\\n20\\n-1\\n3\\n-1\\n-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 2\\n1 2 3 5 8\\n8\\n1\\n3\\n5\\n7\\n9\\n11\\n13\\n15\\n... |
codeforces_primeintellect_598 | deepcoder | Solve the following coding problem using the programming language python:
The tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t_1 seconds in both directions. It means that the tram is always in the state of uniform rectilinear motion, instantly turning around at... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 2 4\\n3 4\\n1 1\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 4 0\\n1 2\\n3 1\\n\", \"output\": \"7\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 4 0\\n5 14\\n1 -1\\n\", \"output\": \"55\\n\"}, {\"type\": \"stdin_stdout\", \"... |
codeforces_primeintellect_599 | deepcoder | Solve the following coding problem using the programming language python:
Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains number i × j. The rows and columns are numbered starting from 1.
You are given a positive integer x. Your task ... | {"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10 5\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 12\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 13\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n\", \"output\": \"1\\n\"}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.