task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Title: Help Kingdom of Far Far Away 2 Time Limit: None seconds Memory Limit: None megabytes Problem Description: For some time the program of rounding numbers that had been developed by the Codeforces participants during one of the previous rounds, helped the citizens of Far Far Away to convert numbers into a more e...
2,800
Title: Steps Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day Vasya went out for a walk in the yard but there weren't any of his friends outside and he had no one to play touch and run. But the boy didn't lose the high spirits and decided to play touch and run with himself. You may ...
2,801
Title: Famil Door and Roads Time Limit: None seconds Memory Limit: None megabytes Problem Description: Famil Door’s City map looks like a tree (undirected connected acyclic graph) so other people call it Treeland. There are *n* intersections in the city connected by *n*<=-<=1 bidirectional roads. There are *m* frie...
2,802
Title: Spectator Riots Time Limit: None seconds Memory Limit: None megabytes Problem Description: It’s riot time on football stadium Ramacana! Raging fans have entered the field and the police find themselves in a difficult situation. The field can be represented as a square in the coordinate system defined by two d...
2,803
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Pavel cooks barbecue. There are *n* skewers, they lay on a brazier in a row, each on one of *n* positions. Pavel wants each skewer to be cooked some time in every of *n* positions in two directions: in the one it was directed orig...
2,804
Title: Light It Up Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently, you bought a brand new smart lamp with programming features. At first, you set up a schedule to the lamp. Every day it will turn power on at moment $0$ and turn power off at moment $M$. Moreover, the lamp allows y...
2,805
Title: Magic multisets Time Limit: None seconds Memory Limit: None megabytes Problem Description: In the School of Magic in Dirtpolis a lot of interesting objects are studied on Computer Science lessons. Consider, for example, the magic multiset. If you try to add an integer to it that is already presented in the m...
2,806
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mr. Bender has a digital table of size *n*<=Γ—<=*n*, each cell can be switched on or off. He wants the field to have at least *c* switched on squares. When this condition is fulfilled, Mr Bender will be happy. We'll consider the t...
2,807
Title: LCM Challenge Time Limit: None seconds Memory Limit: None megabytes Problem Description: Some days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it. But I also don't want to use many numbers, so I'll choose three positive...
2,808
Title: Borze Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as Β«.Β», 1 as Β«-.Β» and 2 as Β«--Β». You are to decode the Borze code, i.e. to find out the ternary ...
2,809
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has *n* days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this *n* days: whether that gym opened and whether a contest was carried out in the Internet...
2,810
Title: Perpetual Motion Machine Time Limit: None seconds Memory Limit: None megabytes Problem Description: Developer Petr thinks that he invented a perpetual motion machine. Namely, he has a lot of elements, which work in the following way. Each element has one controller that can be set to any non-negative real va...
2,811
Title: Fox And Polygon Time Limit: None seconds Memory Limit: None megabytes Problem Description: Fox Ciel just designed a puzzle game called "Polygon"! It is played using triangulations of a regular *n*-edge polygon. The goal is to transform one triangulation to another by some tricky rules. Triangulation of an *n...
2,812
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Limak is a little polar bear. He plays by building towers from blocks. Every block is a cube with positive integer length of side. Limak has infinitely many blocks of each side length. A block with side *a* has volume *a*3. A tow...
2,813
Title: DZY Loves Chemistry Time Limit: None seconds Memory Limit: None megabytes Problem Description: DZY loves chemistry, and he enjoys mixing chemicals. DZY has *n* chemicals, and *m* pairs of them will react. He wants to pour these chemicals into a test tube, and he needs to pour them in one by one, in any order...
2,814
Title: Ultimate Weirdness of an Array Time Limit: None seconds Memory Limit: None megabytes Problem Description: Yasin has an array *a* containing *n* integers. Yasin is a 5 year old, so he loves ultimate weird things. Yasin denotes weirdness of an array as maximum *gcd*(*a**i*,<=<=*a**j*) value among all 1<=≀<=*i*...
2,815
Title: Little Elephant and Array Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Little Elephant loves playing with arrays. He has array *a*, consisting of *n* positive integers, indexed from 1 to *n*. Let's denote the number with index *i* as *a**i*. Additionally the Little Elephant...
2,816
Title: Team Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decid...
2,817
Title: Little Elephant and Tree Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Little Elephant loves trees very much, he especially loves root trees. He's got a tree consisting of *n* nodes (the nodes are numbered from 1 to *n*), with root at node number 1. Each node of the tree cont...
2,818
Title: Clear Symmetry Time Limit: None seconds Memory Limit: None megabytes Problem Description: Consider some square matrix *A* with side *n* consisting of zeros and ones. There are *n* rows numbered from 1 to *n* from top to bottom and *n* columns numbered from 1 to *n* from left to right in this matrix. We'll den...
2,819
Title: Byteland, Berland and Disputed Cities Time Limit: None seconds Memory Limit: None megabytes Problem Description: The cities of Byteland and Berland are located on the axis $Ox$. In addition, on this axis there are also disputed cities, which belong to each of the countries in their opinion. Thus, on the line ...
2,820
Title: Case of Chocolate Time Limit: None seconds Memory Limit: None megabytes Problem Description: Andrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolate out of boredom. A bar of chocolate can be presented as an *n*<=Γ—<=*n* table, where each cell represents o...
2,821
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix. The dot product of two integer number vectors *x* and *y* of size *n* is the sum of the products of...
2,822
Title: Greedy Arkady Time Limit: None seconds Memory Limit: None megabytes Problem Description: $k$ people want to split $n$ candies between them. Each candy should be given to exactly one of them or be thrown away. The people are numbered from $1$ to $k$, and Arkady is the first of them. To split the candies, Arka...
2,823
Title: Ants in Leaves Time Limit: None seconds Memory Limit: None megabytes Problem Description: Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex. You are given a tree with *n* vertices and a root in the vertex 1. There is an ant in each leaf of the tr...
2,824
Title: Stadium and Games Time Limit: None seconds Memory Limit: None megabytes Problem Description: Daniel is organizing a football tournament. He has come up with the following tournament format: 1. In the first several (possibly zero) stages, while the number of teams is even, they split in pairs and play one g...
2,825
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Andrey's favourite number is *n*. Andrey's friends gave him two identical numbers *n* as a New Year present. He hung them on a wall and watched them adoringly. Then Andrey got bored from looking at the same number and he started ...
2,826
Title: A and B and Team Training Time Limit: None seconds Memory Limit: None megabytes Problem Description: A and B are preparing themselves for programming contests. An important part of preparing for a competition is sharing programming knowledge from the experienced members to those who are just beginning to dea...
2,827
Title: Pearls in a Row Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are *n* pearls in a row. Let's enumerate them with integers from 1 to *n* from the left to the right. The pearl number *i* has the type *a**i*. Let's call a sequence of consecutive pearls a segment. Let's call a ...
2,828
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are $n$ startups. Startups can be active or acquired. If a startup is acquired, then that means it has exactly one active startup that it is following. An active startup can have arbitrarily many acquired startups that are f...
2,829
Title: Game with Points Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are playing the following game. There are *n* points on a plane. They are the vertices of a regular *n*-polygon. Points are labeled with integer numbers from 1 to *n*. Each pair of distinct points is connected by a...
2,830
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have been given *n* distinct integers *a*1,<=*a*2,<=...,<=*a**n*. You can remove at most *k* of them. Find the minimum modular *m* (*m*<=&gt;<=0), so that for every pair of the remaining integers (*a**i*,<=*a**j*), the followi...
2,831
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Priests of the Quetzalcoatl cult want to build a tower to represent a power of their god. Tower is usually made of power-charged rocks. It is built with the help of rare magic by levitating the current top of tower and adding rock...
2,832
Title: Is your horseshoe on the other hoof? Time Limit: None seconds Memory Limit: None megabytes Problem Description: Valera the Horse is going to the party with friends. He has been following the fashion trends for a while, and he knows that it is very popular to wear all horseshoes of different color. Valera has ...
2,833
Title: Permutations Time Limit: None seconds Memory Limit: None megabytes Problem Description: Ostap Bender is worried that people started to forget that he is the Great Combinator. Now he wants to show them his skills in combinatorics. Now he studies the permutations of length *n*. He has a list of *m* valid pairs,...
2,834
Title: Two-gram Time Limit: None seconds Memory Limit: None megabytes Problem Description: Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, "AZ", "AA", "ZA" β€” three distinct two-grams. You are given a string $s$ consisting of $n$ capital Latin letters. Your task is to f...
2,835
Title: Spider Time Limit: None seconds Memory Limit: None megabytes Problem Description: A plane contains a not necessarily convex polygon without self-intersections, consisting of *n* vertexes, numbered from 1 to *n*. There is a spider sitting on the border of the polygon, the spider can move like that: 1. Transf...
2,836
Title: Down the Hatch! Time Limit: None seconds Memory Limit: None megabytes Problem Description: Everybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough that all they drink is orange juice! Yesterday one student, Vasya and his mates made some barbecue and th...
2,837
Title: Vanya and Brackets Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vanya is doing his maths homework. He has an expression of form , where *x*1,<=*x*2,<=...,<=*x**n* are digits from 1 to 9, and sign represents either a plus '+' or the multiplication sign '*'. Vanya needs to add one...
2,838
Title: Tree Construction Time Limit: None seconds Memory Limit: None megabytes Problem Description: During the programming classes Vasya was assigned a difficult problem. However, he doesn't know how to code and was unable to find the solution in the Internet, so he asks you to help. You are given a sequence $a$, c...
2,839
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: On one of the planets of Solar system, in Atmosphere University, many students are fans of bingo game. It is well known that one month on this planet consists of $n^2$ days, so calendars, represented as square matrix $n$ by $n$ a...
2,840
Title: New Year Ratings Change Time Limit: None seconds Memory Limit: None megabytes Problem Description: One very well-known internet resource site (let's call it X) has come up with a New Year adventure. Specifically, they decided to give ratings to all visitors. There are *n* users on the site, for each user we ...
2,841
Title: Harmony Analysis Time Limit: None seconds Memory Limit: None megabytes Problem Description: The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil was very bored on this lesson until the teacher gave t...
2,842
Title: Hometask Time Limit: None seconds Memory Limit: None megabytes Problem Description: Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him a new task. Furik solved the task immediately. Can ...
2,843
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: The ancient Berlanders believed that the longer the name, the more important its bearer is. Thus, Berland kings were famous for their long names. But long names are somewhat inconvenient, so the Berlanders started to abbreviate th...
2,844
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Stepan has *n* pens. Every day he uses them, and on the *i*-th day he uses the pen number *i*. On the (*n*<=+<=1)-th day again he uses the pen number 1, on the (*n*<=+<=2)-th β€” he uses the pen number 2 and so on. On every working...
2,845
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: User ainta loves to play with cards. He has *a* cards containing letter "o" and *b* cards containing letter "x". He arranges the cards in a row, and calculates the score of the deck by the formula below. 1. At first, the score i...
2,846
Title: Bookshelves Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mr Keks is a typical white-collar in Byteland. He has a bookshelf in his office with some books on it, each book has an integer positive price. Mr Keks defines the value of a shelf as the sum of books prices on it. Mira...
2,847
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Fox Ciel has *n* boxes in her room. They have the same size and weight, but they might have different strength. The *i*-th box can hold at most *x**i* boxes on its top (we'll call *x**i* the strength of the box). Since all the b...
2,848
Title: Partial Teacher Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: A teacher decides to give toffees to his students. He asks *n* students to stand in a queue. Since the teacher is very partial, he follows the following rule to distribute toffees. He looks at the first two students and gi...
2,849
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya the programmer lives in the middle of the Programming subway branch. He has two girlfriends: Dasha and Masha, who live at the different ends of the branch, each one is unaware of the other one's existence. When Vasya has so...
2,850
Title: Ultra-Fast Mathematician Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Shapur was an extremely gifted student. He was great at everything including Combinatorics, Algebra, Number Theory, Geometry, Calculus, etc. He was not only smart but extraordinarily fast! He could manage to sum 10...
2,851
Title: Very Interesting Game Time Limit: None seconds Memory Limit: None megabytes Problem Description: In a very ancient country the following game was popular. Two people play the game. Initially first player writes a string *s*1, consisting of exactly nine digits and representing a number that does not exceed *a*...
2,852
Title: Painting Pebbles Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are *n* piles of pebbles on the table, the *i*-th pile contains *a**i* pebbles. Your task is to paint each pebble using one of the *k* given colors so that for each color *c* and any two piles *i* and *j* the dif...
2,853
Title: Mice Time Limit: 0 seconds Memory Limit: 256 megabytes Problem Description: Modern researches has shown that a flock of hungry mice searching for a piece of cheese acts as follows: if there are several pieces of cheese then each mouse chooses the closest one. After that all mice start moving towards the chose...
2,854
Title: Till I Collapse Time Limit: None seconds Memory Limit: None megabytes Problem Description: Rick and Morty want to find MR. PBH and they can't do it alone. So they need of Mr. Meeseeks. They Have generated *n* Mr. Meeseeks, standing in a line numbered from 1 to *n*. Each of them has his own color. *i*-th Mr. M...
2,855
Title: Water The Garden Time Limit: None seconds Memory Limit: None megabytes Problem Description: It is winter now, and Max decided it's about time he watered the garden. The garden can be represented as *n* consecutive garden beds, numbered from 1 to *n*. *k* beds contain water taps (*i*-th tap is located in the ...
2,856
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it. Given a sequence *a* consisting of *n* integers. The player can make sev...
2,857
Title: Yet Another String Matching Problem Time Limit: None seconds Memory Limit: None megabytes Problem Description: Suppose you have two strings *s* and *t*, and their length is equal. You may perform the following operation any number of times: choose two different characters *c*1 and *c*2, and replace every occu...
2,858
Title: Happy Tree Party Time Limit: None seconds Memory Limit: None megabytes Problem Description: Bogdan has a birthday today and mom gave him a tree consisting of *n* vertecies. For every edge of the tree *i*, some number *x**i* was written on it. In case you forget, a tree is a connected non-directed graph withou...
2,859
Title: Brain Network (easy) Time Limit: None seconds Memory Limit: None megabytes Problem Description: One particularly well-known fact about zombies is that they move and think terribly slowly. While we still don't know why their movements are so sluggish, the problem of laggy thinking has been recently resolved. I...
2,860
Title: Soldier and Badges Time Limit: None seconds Memory Limit: None megabytes Problem Description: Colonel has *n* badges. He wants to give one badge to every of his *n* soldiers. Each badge has a coolness factor, which shows how much it's owner reached. Coolness factor can be increased by one for the cost of one ...
2,861
Title: Maxim Buys an Apartment Time Limit: None seconds Memory Limit: None megabytes Problem Description: Maxim wants to buy an apartment in a new house at Line Avenue of Metropolis. The house has *n* apartments that are numbered from 1 to *n* and are arranged in a row. Two apartments are adjacent if their indices d...
2,862
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: It is nighttime and Joe the Elusive got into the country's main bank's safe. The safe has *n* cells positioned in a row, each of them contains some amount of diamonds. Let's make the problem more comfortable to work with and mark ...
2,863
Title: Pythagorean Theorem II Time Limit: None seconds Memory Limit: None megabytes Problem Description: In mathematics, the Pythagorean theorem β€” is a relation in Euclidean geometry among the three sides of a right-angled triangle. In terms of areas, it states: In any right-angled triangle, the area of the squar...
2,864
Title: Have You Ever Heard About the Word? Time Limit: None seconds Memory Limit: None megabytes Problem Description: A substring of a string is a contiguous subsequence of that string. So, string bca is substring of string abcabc, but string cc is not. A repeating block is a string formed by concatenating some str...
2,865
Title: Xenia and Bit Operations Time Limit: None seconds Memory Limit: None megabytes Problem Description: Xenia the beginner programmer has a sequence *a*, consisting of 2*n* non-negative integers: *a*1,<=*a*2,<=...,<=*a*2*n*. Xenia is currently studying bit operations. To better understand how they work, Xenia dec...
2,866
Title: Minimum number of steps Time Limit: None seconds Memory Limit: None megabytes Problem Description: We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of substrings "ab" in the string and replace it with the string "bba". If we have no "ab" as a substr...
2,867
Title: Liebig's Barrels Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have *m*<==<=*n*Β·*k* wooden staves. The *i*-th stave has length *a**i*. You have to assemble *n* barrels consisting of *k* staves each, you can use any *k* staves to construct a barrel. Each stave must belong to ex...
2,868
Title: Diverse Substrings Time Limit: None seconds Memory Limit: None megabytes Problem Description: String diversity is the number of symbols that occur in the string at least once. Diversity of *s* will be denoted by *d*(*s*). For example , *d*("aaa")=1, *d*("abacaba")=3. Given a string *s*, consisting of lowerca...
2,869
Title: Beaver Game Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: Two beavers, Timur and Marsel, play the following game. There are *n* logs, each of exactly *m* meters in length. The beavers move in turns. For each move a beaver chooses a log and gnaws it into some number (more than one) of...
2,870
Title: Inna and Candy Boxes Time Limit: None seconds Memory Limit: None megabytes Problem Description: Inna loves sweets very much. She has *n* closed present boxes lines up in a row in front of her. Each of these boxes contains either a candy (Dima's work) or nothing (Sereja's work). Let's assume that the boxes are...
2,871
Title: Andrew and Chemistry Time Limit: None seconds Memory Limit: None megabytes Problem Description: During the chemistry lesson Andrew learned that the saturated hydrocarbons (alkanes) enter into radical chlorination reaction. Andrew is a very curious boy, so he wondered how many different products of the reactio...
2,872
Title: Nuts Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have *a* nuts and lots of boxes. The boxes have a wonderful feature: if you put *x* (*x*<=β‰₯<=0) divisors (the spacial bars that can divide a box) to it, you get a box, divided into *x*<=+<=1 sections. You are minimalist. Ther...
2,873
Title: Ski Base Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: A ski base is planned to be built in Walrusland. Recently, however, the project is still in the constructing phase. A large land lot was chosen for the construction. It contains *n* ski junctions, numbered from 1 to *n*. Initially...
2,874
Title: Three Base Stations Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: The New Vasjuki village is stretched along the motorway and that's why every house on it is characterized by its shift relative to some fixed point β€” the *x**i* coordinate. The village consists of *n* houses, the *i*-th...
2,875
Title: Xenia and Divisors Time Limit: None seconds Memory Limit: None megabytes Problem Description: Xenia the mathematician has a sequence consisting of *n* (*n* is divisible by 3) positive integers, each of them is at most 7. She wants to split the sequence into groups of three so that for each group of three *a*,...
2,876
Title: Martian Dollar Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: One day Vasya got hold of information on the Martian dollar course in bourles for the next *n* days. The buying prices and the selling prices for one dollar on day *i* are the same and are equal to *a**i*. Vasya has *b* bour...
2,877
Title: Strange Addition Time Limit: None seconds Memory Limit: None megabytes Problem Description: Unfortunately, Vasya can only sum pairs of integers (*a*, *b*), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4. ...
2,878
Title: Magic Powder - 1 Time Limit: None seconds Memory Limit: None megabytes Problem Description: This problem is given in two versions that differ only by constraints. If you can solve this problem in large constraints, then you can just write a single solution to the both versions. If you find the problem too dif...
2,879
Title: Comparing Two Long Integers Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given two very long integers *a*,<=*b* (leading zeroes are allowed). You should check what number *a* or *b* is greater or determine that they are equal. The input size is very large so don't use th...
2,880
Title: Undoubtedly Lucky Numbers Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarpus loves lucky numbers. Everybody knows that lucky numbers are positive integers, whose decimal representation (without leading zeroes) contain only the lucky digits *x* and *y*. For example, if *x*<==...
2,881
Title: Translation Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pron...
2,882
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mike is the president of country What-The-Fatherland. There are *n* bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 to *n* from left to right. *i*-th bear is exactly *a**i...
2,883
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a tree with *n* vertices and you are allowed to perform no more than 2*n* transformations on it. Transformation is defined by three vertices *x*,<=*y*,<=*y*' and consists of deleting edge (*x*,<=*y*) and adding edge ...
2,884
Title: Mashmokh and Lights Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mashmokh works in a factory. At the end of each day he must turn off all of the lights. The lights on the factory are indexed from 1 to *n*. There are *n* buttons in Mashmokh's room indexed from 1 to *n* as well. ...
2,885
Title: The Intriguing Obsession Time Limit: None seconds Memory Limit: None megabytes Problem Description: β€” This is not playing but duty as allies of justice, Nii-chan! β€” Not allies but justice itself, Onii-chan! With hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire SistersΒ β€” K...
2,886
Title: Number of Triplets Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given *n* points on a plane. All points are different. Find the number of different groups of three points (*A*,<=*B*,<=*C*) such that point *B* is the middle of segment *AC*. The groups of three points ar...
2,887
Title: Way Too Long Words Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome. Let's consider a word too long, if its length is strictly more than 10 character...
2,888
Title: Serial Time! Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represe...
2,889
Title: New Year and Curling Time Limit: None seconds Memory Limit: None megabytes Problem Description: Carol is currently curling. She has *n* disks each with radius *r* on the 2D plane. Initially she has all these disks above the line *y*<==<=10100. She then will slide the disks towards the line *y*<==<=0 one b...
2,890
Title: Sweets for Everyone! Time Limit: None seconds Memory Limit: None megabytes Problem Description: Christmas celebrations are coming to Whoville. Cindy Lou Who and her parents Lou Lou Who and Betty Lou Who decided to give sweets to all people in their street. They decided to give the residents of each house on t...
2,891
Title: Mahmoud and a Triangle Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mahmoud has *n* line segments, the *i*-th of them has length *a**i*. Ehab challenged him to use exactly 3 line segments to form a non-degenerate triangle. Mahmoud doesn't accept challenges unless he is sure he ca...
2,892
Title: ALT Time Limit: None seconds Memory Limit: None megabytes Problem Description: ALT is a planet in a galaxy called "Encore". Humans rule this planet but for some reason there's no dog in their planet, so the people there are sad and depressed. Rick and Morty are universal philanthropists and they want to make ...
2,893
Title: Dividing Orange Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day Ms Swan bought an orange in a shop. The orange consisted of *n*Β·*k* segments, numbered with integers from 1 to *n*Β·*k*. There were *k* children waiting for Ms Swan at home. The children have recently learned a...
2,894
Title: Harry Vs Voldemort Time Limit: None seconds Memory Limit: None megabytes Problem Description: After destroying all of Voldemort's Horcruxes, Harry and Voldemort are up for the final battle. They each cast spells from their wands and the spells collide. The battle scene is Hogwarts, which can be represented i...
2,895
Title: Caisa and Sugar Time Limit: None seconds Memory Limit: None megabytes Problem Description: Caisa is going to have a party and he needs to buy the ingredients for a big chocolate cake. For that he is going to the biggest supermarket in town. Unfortunately, he has just *s* dollars for sugar. But that's not a r...
2,896
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are running for a governor in a small city in Russia. You ran some polls and did some research, and for every person in the city you know whom he will vote for, and how much it will cost to bribe that person to vote for you in...
2,897
Title: Isomorphic Strings Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a string *s* of length *n* consisting of lowercase English letters. For two given strings *s* and *t*, say *S* is the set of distinct characters of *s* and *T* is the set of distinct characters of *t*....
2,898
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Disclaimer: there are lots of untranslateable puns in the Russian version of the statement, so there is one more reason for you to learn Russian :) Rick and Morty like to go to the ridge High Cry for crying loudlyΒ β€” there is an e...
2,899