task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Title: Sum Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has found a piece of paper with an array written on it. The array consists of *n* integers *a*1,<=*a*2,<=...,<=*a**n*. Vasya noticed that the following condition holds for the array *a**i*<=≀<=*a**i*<=+<=1<=≀<=2Β·*a**i* for an...
3,300
Title: Money Transfers Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are *n* banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their indices differ by no more than 1. Also, bank 1 and bank *n* are neighbours if *n*<=&gt;<...
3,301
Title: Duff in Love Time Limit: None seconds Memory Limit: None megabytes Problem Description: 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*<=&gt;<=1 such that *a*2 is a divisor of *x*. Malek has a number store! In his store, he has...
3,302
Title: Partition Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a sequence *a* consisting of *n* integers. You may partition this sequence into two sequences *b* and *c* in such a way that every element belongs exactly to one of these sequences. Let *B* be the sum of eleme...
3,303
Title: Arpa's weak amphitheater and Mehrdad's valuable Hoses Time Limit: None seconds Memory Limit: None megabytes Problem Description: Just to remind, girls in Arpa's land are really nice. Mehrdad wants to invite some Hoses to the palace for a dancing party. Each Hos has some weight *w**i* and some beauty *b**i*. ...
3,304
Title: Kuro and Walking Route Time Limit: None seconds Memory Limit: None megabytes Problem Description: Kuro is living in a country called Uberland, consisting of $n$ towns, numbered from $1$ to $n$, and $n - 1$ bidirectional roads connecting these towns. It is possible to reach each town from any other. Each road ...
3,305
Title: Leha and security system Time Limit: None seconds Memory Limit: None megabytes Problem Description: Bankopolis, the city you already know, finally got a new bank opened! Unfortunately, its security system is not yet working fine... Meanwhile hacker Leha arrived in Bankopolis and decided to test the system! B...
3,306
Title: Barrels and boxes Time Limit: None seconds Memory Limit: None megabytes Problem Description: Tarly has two different type of items, food boxes and wine barrels. There are *f* food boxes and *w* wine barrels. Tarly stores them in various stacks and each stack can consist of either food boxes or wine barrels bu...
3,307
Title: Nanami's Power Plant Time Limit: None seconds Memory Limit: None megabytes Problem Description: Nanami likes playing games, and is also really good at it. This day she was playing a new game which involved operating a power plant. Nanami's job is to control the generators in the plant and produce maximum outp...
3,308
Title: Public Service Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are *N* cities in Bob's country connected by roads. Some pairs of cities are connected by public transport. There are two competing transport companiesΒ β€” Boblines operating buses and Bobrail running trains. When tr...
3,309
Title: Continued Fractions Time Limit: None seconds Memory Limit: None megabytes Problem Description: A continued fraction of height *n* is a fraction of form . You are given two rational numbers, one is represented as and the other one is represented as a finite fraction of height *n*. Check if they are equal. In...
3,310
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mojtaba and Arpa are playing a game. They have a list of *n* numbers in the game. In a player's turn, he chooses a number *p**k* (where *p* is a prime number and *k* is a positive integer) such that *p**k* divides at least one nu...
3,311
Title: The least round way Time Limit: 2 seconds Memory Limit: 64 megabytes Problem Description: There is a square matrix *n*<=Γ—<=*n*, consisting of non-negative integer numbers. You should find such a way on it that - starts in the upper left cell of the matrix; - each following cell is to the right or down fro...
3,312
Title: An express train to reveries Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sengoku still remembers the mysterious "colourful meteoroids" she discovered with Lala-chan when they were little. In particular, one of the nights impressed her deeply, giving her the illusion that all her...
3,313
Title: Cutting Banner Time Limit: None seconds Memory Limit: None megabytes Problem Description: A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforcesω that takes place on the Miami beach. Unfortunately, the company that made the banner mixed up two orders and delivered somebody ...
3,314
Title: Bill Total Value Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasily exited from a store and now he wants to recheck the total price of all purchases in his bill. The bill is a string in which the names of the purchases and their prices are printed in a row without any spaces. Ch...
3,315
Title: Quiz League Time Limit: None seconds Memory Limit: None megabytes Problem Description: A team quiz game called "What? Where? When?" is very popular in Berland. The game is centered on two teams competing. They are the team of six Experts versus the team of the Audience. A person from the audience asks a quest...
3,316
Title: The Tag Game Time Limit: None seconds Memory Limit: None megabytes Problem Description: Alice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. Now the game should be played on an undirected rooted tree of *n* vertices. Vertex 1 is the root of the tree. Alic...
3,317
Title: Squares Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has found a piece of paper with a coordinate system written on it. There are *n* distinct squares drawn in this coordinate system. Let's number the squares with integers from 1 to *n*. It turned out that points with coord...
3,318
Title: Planting Trees Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into *n*<=Γ—<=*m* squares and decided to plant a forest there. Vasya will plant *nm* trees of all differen...
3,319
Title: Divisibility Rules Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya studies divisibility rules at school. Here are some of them: - Divisibility by 2. A number is divisible by 2 if and only if its last digit is divisible by 2 or in other words, is even.- Divisibility by 3. A n...
3,320
Title: Space Voyage Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit *n* planets. For planet *i* *a**i* is the maximum number of suitcases that an alien tourist is allowed to br...
3,321
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a sequence of positive integers *x*1,<=*x*2,<=...,<=*x**n* and two non-negative integers *a* and *b*. Your task is to transform *a* into *b*. To do that, you can perform the following moves: - subtract 1 from the c...
3,322
Title: Coprocessor Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a program you want to execute as a set of tasks organized in a dependency graph. The dependency graph is a directed acyclic graph: each task can depend on results of one or several other tasks, and there are n...
3,323
Title: White, Black and White Again Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarpus is sure that his life fits the description: "first there is a white stripe, then a black one, then a white one again". So, Polycarpus is sure that this rule is going to fulfill during the next *n...
3,324
Title: Sereja and Intervals Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sereja is interested in intervals of numbers, so he has prepared a problem about intervals for you. An interval of numbers is a pair of integers [*l*,<=*r*] (1<=≀<=*l*<=≀<=*r*<=≀<=*m*). Interval [*l*1,<=*r*1] belon...
3,325
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Have you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version of the game. Overall, the game has 25 types of cards (5 distinct colors and 5 distinct values). Borya is holding *n*...
3,326
Title: Divisibility by Eight Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a non-negative integer *n*, its decimal representation consists of at most 100 digits and doesn't contain leading zeroes. Your task is to determine if it is possible in this case to remove some of t...
3,327
Title: Polycarp and Div 3 Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarp likes numbers that are divisible by 3. He has a huge number $s$. Polycarp wants to cut from it the maximum number of numbers that are divisible by $3$. To do this, he makes an arbitrary number of vertical c...
3,328
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, '<=+<=' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are *n*<=+<=1 levels in the game a...
3,329
Title: Array and Operations Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have written on a piece of paper an array of *n* positive integers *a*[1],<=*a*[2],<=...,<=*a*[*n*] and *m* good pairs of integers (*i*1,<=*j*1),<=(*i*2,<=*j*2),<=...,<=(*i**m*,<=*j**m*). Each good pair (*i**k*...
3,330
Title: Valera and Antique Items Time Limit: None seconds Memory Limit: None megabytes Problem Description: Valera is a collector. Once he wanted to expand his collection with exactly one antique item. Valera knows *n* sellers of antiques, the *i*-th of them auctioned *k**i* items. Currently the auction price of the...
3,331
Title: Blown Garland Time Limit: None seconds Memory Limit: None megabytes Problem Description: Nothing is eternal in the world, Kostya understood it on the 7-th of January when he saw partially dead four-color garland. Now he has a goal to replace dead light bulbs, however he doesn't know how many light bulbs for ...
3,332
Title: Varying Kibibits Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given *n* integers *a*1,<=*a*2,<=...,<=*a**n*. Denote this list of integers as *T*. Let *f*(*L*) be a function that takes in a non-empty list of integers *L*. The function will output another integer as follo...
3,333
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given an infinite checkered field. You should get from a square (*x*1; *y*1) to a square (*x*2; *y*2). Using the shortest path is not necessary. You can move on the field squares in four directions. That is, when you are p...
3,334
Title: Bus Game Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: After Fox Ciel won an onsite round of a programming contest, she took a bus to return to her castle. The fee of the bus was 220 yen. She met Rabbit Hanako in the bus. They decided to play the following game because they got bored ...
3,335
Title: Star sky Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Cartesian coordinate system is set in the sky. There you can see *n* stars, the *i*-th has coordinates (*x**i*, *y**i*), a maximum brightness *c*, equal for all stars, and an initial brightness *s**i* (0<=≀<=*s**i*<=≀<=*c*...
3,336
Title: Tree and Queries Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have a rooted tree consisting of *n* vertices. Each vertex of the tree has some color. We will assume that the tree vertices are numbered by integers from 1 to *n*. Then we represent the color of vertex *v* as *c**...
3,337
Title: F1 Champions Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Formula One championship consists of series of races called Grand Prix. After every race drivers receive points according to their final position. Only the top 10 drivers receive points in the following order 25, 18, 15, 12, 1...
3,338
Title: Cinema Time Limit: None seconds Memory Limit: None megabytes Problem Description: The capital of Berland has the only movie theater in the country. Besides, it consists of only one room. The room is divided into *n* rows, each row consists of *m* seats. There are *k* people lined up to the box office, each p...
3,339
Title: Barcode Time Limit: None seconds Memory Limit: None megabytes Problem Description: You've got an *n*<=Γ—<=*m* pixel picture. Each pixel can be white or black. Your task is to change the colors of as few pixels as possible to obtain a barcode picture. A picture is a barcode if the following conditions are fulf...
3,340
Title: Cifera Time Limit: None seconds Memory Limit: None megabytes Problem Description: When Petya went to school, he got interested in large numbers and what they were called in ancient times. For instance, he learned that the Russian word "tma" (which now means "too much to be counted") used to stand for a thousa...
3,341
Title: Award Ceremony Time Limit: None seconds Memory Limit: None megabytes Problem Description: All-Berland programming contest comes to an end. In total, *n* teams participated in it. Like in ACM-ICPC, current results stopped refreshing one hour before the contest ends. So at the Award Ceremony, results are partia...
3,342
Title: Big Maximum Sum Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Ahmed and Mostafa used to compete together in many programming contests for several years. Their coach Fegla asked them to solve one challenging problem, of course Ahmed was able to solve it but Mostafa couldn't. This prob...
3,343
Title: Corridor Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Consider a house plan. Let the house be represented by an infinite horizontal strip defined by the inequality <=-<=*h*<=≀<=*y*<=≀<=*h*. Strictly outside the house there are two light sources at the points (0,<=*f*) and (0,<=<=-<...
3,344
Title: Splits Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's define a split of $n$ as a nonincreasing sequence of positive integers, the sum of which is $n$. For example, the following sequences are splits of $8$: $[4, 4]$, $[3, 3, 2]$, $[2, 2, 1, 1, 1, 1]$, $[5, 2, 1]$. The foll...
3,345
Title: Infinite Inversions Time Limit: None seconds Memory Limit: None megabytes Problem Description: There is an infinite sequence consisting of all positive integers in the increasing order: *p*<==<={1,<=2,<=3,<=...}. We performed *n* swap operations with this sequence. A *swap*(*a*,<=*b*) is an operation of swapp...
3,346
Title: Capture Valerian Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: It's now 260 AD. Shapur, being extremely smart, became the King of Persia. He is now called Shapur, His majesty King of kings of Iran and Aniran. Recently the Romans declared war on Persia. They dreamed to occupy Armenia....
3,347
Title: bHTML Tables Analisys Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: In this problem is used an extremely simplified version of HTML table markup. Please use the statement as a formal document and read it carefully. A string is a bHTML table, if it satisfies the grammar: Blanks in t...
3,348
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Iahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor-tree. After this new revolutionary discovery, he invented a game for kids which uses xor-trees. The game is played on a...
3,349
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sherlock Holmes found a mysterious correspondence of two VIPs and made up his mind to read it. But there is a problem! The correspondence turned out to be encrypted. The detective tried really hard to decipher the correspondence, ...
3,350
Title: Ilya and Diplomas Time Limit: None seconds Memory Limit: None megabytes Problem Description: Soon a school Olympiad in Informatics will be held in Berland, *n* schoolchildren will participate there. At a meeting of the jury of the Olympiad it was decided that each of the *n* participants, depending on the re...
3,351
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: One social network developer recently suggested a new algorithm of choosing ads for users. There are *n* slots which advertisers can buy. It is possible to buy a segment of consecutive slots at once. The more slots you own, the b...
3,352
Title: Olympiad Time Limit: None seconds Memory Limit: None megabytes Problem Description: The recent All-Berland Olympiad in Informatics featured *n* participants with each scoring a certain amount of points. As the head of the programming committee, you are to determine the set of participants to be awarded with ...
3,353
Title: Mr. Bender and Square 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'...
3,354
Title: Horse Races Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Petya likes horse racing very much. Horses numbered from *l* to *r* take part in the races. Petya wants to evaluate the probability of victory; for some reason, to do that he needs to know the amount of nearly lucky horses' num...
3,355
Title: Chess Placing Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a chessboard of size 1<=Γ—<=*n*. It is guaranteed that *n* is even. The chessboard is painted like this: "BWBW...BW". Some cells of the board are occupied by the chess pieces. Each cell contains no more than...
3,356
Title: Watermelon Time Limit: 1 seconds Memory Limit: 64 megabytes Problem Description: One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed *w* kilos. They rushed home, dyin...
3,357
Title: Tickets Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: As a big fan of Formula One, Charlie is really happy with the fact that he has to organize ticket sells for the next Grand Prix race in his own city. Unfortunately, the finacial crisis is striking everywhere and all the banknotes l...
3,358
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: After a drawn-out mooclear arms race, Farmer John and the Mischievous Mess Makers have finally agreed to establish peace. They plan to divide the territory of Bovinia with a line passing through at least two of the *n* outposts sc...
3,359
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are *n* people and *k* keys on a straight line. Every person wants to get to the office which is located on the line as well. To do that, he needs to reach some point with a key, take the key and then go to the office. Once ...
3,360
Title: Hide-and-Seek Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Victor and Peter are playing hide-and-seek. Peter has hidden, and Victor is to find him. In the room where they are playing, there is only one non-transparent wall and one double-sided mirror. Victor and Peter are points with...
3,361
Title: Ball Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: *N* ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Master of Ceremonies knows that ladies are very special creatures. If some lady understands that th...
3,362
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little boy Gerald studies at school which is quite far from his house. That's why he has to go there by bus every day. The way from home to school is represented by a segment of a straight line; the segment contains exactly *n*<=+...
3,363
Title: Convex Shape Time Limit: None seconds Memory Limit: None megabytes Problem Description: Consider an *n*<=Γ—<=*m* grid. Initially all the cells of the grid are colored white. Lenny has painted some of the cells (at least one) black. We call a painted grid convex if one can walk from any black cell to any anothe...
3,364
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Julia is conducting an experiment in her lab. She placed several luminescent bacterial colonies in a horizontal testtube. Different types of bacteria can be distinguished by the color of light they emit. Julia marks types of bacte...
3,365
Title: Nephren gives a riddle Time Limit: None seconds Memory Limit: None megabytes Problem Description: Nephren is playing a game with little leprechauns. She gives them an infinite array of strings, *f*0... ∞. *f*0 is "What are you doing at the end of the world? Are you busy? Will you save us?". She wants to ...
3,366
Title: Journey Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are *n* cities and *n*<=-<=1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roads. Theon and Yara Greyjoy are on a horse in the first city, they are starting tr...
3,367
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Autumn came late to the kingdom of Far Far Away. The harvest was exuberant and it is now time to get ready for the winter. As most people celebrate the Harvest festival, Simon the Caretaker tries to solve a very non-trivial task o...
3,368
Title: Largest Beautiful Number Time Limit: None seconds Memory Limit: None megabytes Problem Description: Yes, that's another problem with definition of "beautiful" numbers. Let's call a positive integer *x* beautiful if its decimal representation without leading zeroes contains even number of digits, and there ex...
3,369
Title: Reconnaissance 2 Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: *n* soldiers stand in a circle. For each soldier his height *a**i* is known. A reconnaissance unit can be made of such two neighbouring soldiers, whose heights difference is minimal, i.e. |*a**i*<=-<=*a**j*| is minimal. So...
3,370
Title: Bear and Up-Down Time Limit: None seconds Memory Limit: None megabytes Problem Description: The life goes up and down, just like nice sequences. Sequence *t*1,<=*t*2,<=...,<=*t**n* is called nice if the following two conditions are satisfied: - *t**i*<=&lt;<=*t**i*<=+<=1 for each odd *i*<=&lt;<=*n*; - *t*...
3,371
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little Chris is participating in a graph cutting contest. He's a pro. The time has come to test his skills to the fullest. Chris is given a simple undirected connected graph with *n* vertices (numbered from 1 to *n*) and *m* edge...
3,372
Title: Masha and Cactus Time Limit: None seconds Memory Limit: None megabytes Problem Description: Masha is fond of cacti. When she was a little girl, she decided to plant a tree. Now Masha wants to make a nice cactus out of her tree. Recall that tree is a connected undirected graph that has no cycles. Cactus is a ...
3,373
Title: Scheme Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: To learn as soon as possible the latest news about their favourite fundamentally new operating system, BolgenOS community from Nizhni Tagil decided to develop a scheme. According to this scheme a community member, who is the first t...
3,374
Title: Buses Time Limit: 2 seconds Memory Limit: 265 megabytes Problem Description: Little boy Gerald studies at school which is quite far from his house. That's why he has to go there by bus every day. The way from home to school is represented by a segment of a straight line; the segment contains exactly *n*<=+<=1...
3,375
Title: Sleeping Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: One day Vasya was lying in bed watching his electronic clock to fall asleep quicker. Vasya lives in a strange country, where days have *h* hours, and every hour has *m* minutes. Clock shows time in decimal number system, in forma...
3,376
Title: Little Girl and Problem on Trees Time Limit: None seconds Memory Limit: None megabytes Problem Description: A little girl loves problems on trees very much. Here's one of them. A tree is an undirected connected graph, not containing cycles. The degree of node *x* in the tree is the number of nodes *y* of the...
3,377
Title: Intellectual Inquiry Time Limit: None seconds Memory Limit: None megabytes Problem Description: After getting kicked out of her reporting job for not knowing the alphabet, Bessie has decided to attend school at the Fillet and Eggs Eater Academy. She has been making good progress with her studies and now knows...
3,378
Title: Table Compression Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many others. Inspired by the new knowledge, Petya is now developing the new compression algorithm which he wan...
3,379
Title: Cut Length Time Limit: None seconds Memory Limit: None megabytes Problem Description: Given simple (without self-intersections) *n*-gon. It is not necessary convex. Also you are given *m* lines. For each line find the length of common part of the line and the *n*-gon. The boundary of *n*-gon belongs to polyg...
3,380
Title: Lala Land and Apple Trees Time Limit: None seconds Memory Limit: None megabytes Problem Description: Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere. Lala Land has exactly *n* apple trees. Tree num...
3,381
Title: Wormhouse Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Arnie the Worm has finished eating an apple house yet again and decided to move. He made up his mind on the plan, the way the rooms are located and how they are joined by corridors. He numbered all the rooms from 1 to *n*. All th...
3,382
Title: Preorder Test Time Limit: None seconds Memory Limit: None megabytes Problem Description: For his computer science class, Jacob builds a model tree with sticks and balls containing *n* nodes in the shape of a tree. Jacob has spent *a**i* minutes building the *i*-th ball in the tree. Jacob's teacher will evalu...
3,383
Title: Second-Price Auction Time Limit: None seconds Memory Limit: None megabytes Problem Description: In this problem we consider a special type of an auction, which is called the second-price auction. As in regular auction *n* bidders place a bid which is price a bidder ready to pay. The auction is closed, that is...
3,384
Title: Point on Spiral Time Limit: None seconds Memory Limit: None megabytes Problem Description: Valera the horse lives on a plane. The Cartesian coordinate system is defined on this plane. Also an infinite spiral is painted on the plane. The spiral consists of segments: [(0,<=0),<=(1,<=0)], [(1,<=0),<=(1,<=1)], [(...
3,385
Title: The penguin's game Time Limit: None seconds Memory Limit: None megabytes Problem Description: Pay attention: this problem is interactive. Penguin Xoriy came up with a new game recently. He has *n* icicles numbered from 1 to *n*. Each icicle has a temperatureΒ β€” an integer from 1 to 109. Exactly two of these i...
3,386
Title: Anniversary Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are less than 60 years left till the 900-th birthday anniversary of a famous Italian mathematician Leonardo Fibonacci. Of course, such important anniversary needs much preparations. Dima is sure that it'll be great t...
3,387
Title: Company Income Growth Time Limit: 2 seconds Memory Limit: 64 megabytes Problem Description: Petya works as a PR manager for a successful Berland company BerSoft. He needs to prepare a presentation on the company income growth since 2001 (the year of its founding) till now. Petya knows that in 2001 the company...
3,388
Title: Round Table Knights Time Limit: 0 seconds Memory Limit: 256 megabytes Problem Description: There are *n* knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood. Merlin, the wizard predicted to King Arthur that the next month will turn out to...
3,389
Title: Rainbow Balls Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have a bag of balls of *n* different colors. You have *a**i* balls of the *i*-th color. While there are at least two different colored balls in the bag, perform the following steps: - Take out two random balls wit...
3,390
Title: Arithmetic Progression Time Limit: None seconds Memory Limit: None megabytes Problem Description: Everybody knows what an arithmetic progression is. Let us remind you just in case that an arithmetic progression is such sequence of numbers *a*1,<=*a*2,<=...,<=*a**n* of length *n*, that the following condition ...
3,391
Title: Crime Management Time Limit: 5 seconds Memory Limit: 256 megabytes Problem Description: Zeyad wants to commit *n* crimes in Egypt and not be punished at the end. There are several types of crimes. For example, bribery is a crime but is not considered such when repeated twice. Therefore, bribery is not conside...
3,392
Title: A Museum Robbery Time Limit: None seconds Memory Limit: None megabytes Problem Description: There's a famous museum in the city where KleofΓ‘Ε‘ lives. In the museum, *n* exhibits (numbered 1 through *n*) had been displayed for a long time; the *i*-th of those exhibits has value *v**i* and mass *w**i*. Then, t...
3,393
Title: Perfect Pair Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let us call a pair of integer numbers *m*-perfect, if at least one number in the pair is greater than or equal to *m*. Thus, the pairs (3, 3) and (0, 2) are 2-perfect while the pair (-1, 1) is not. Two integers *x*, *y* a...
3,394
Title: Turn Off The TV Time Limit: None seconds Memory Limit: None megabytes Problem Description: Luba needs your help again! Luba has *n* TV sets. She knows that *i*-th TV set will be working from moment of time *l**i* till moment *r**i*, inclusive. Luba wants to switch off one of TV sets in order to free the sock...
3,395
Title: Micro-World Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have a Petri dish with bacteria and you are preparing to dive into the harsh micro-world. But, unfortunately, you don't have any microscope nearby, so you can't watch them. You know that you have $n$ bacteria in the Pe...
3,396
Title: Constellation Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: A star map in Berland is a checked field *n*<=Γ—<=*m* squares. In each square there is or there is not a star. The favourite constellation of all Berland's astronomers is the constellation of the Cross. This constellation can ...
3,397
Title: Big Problems for Organizers Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Finals of the "Russian Code Cup" 2214 will be held in *n* hotels. Two hotels (let's assume that they are the main hotels), will host all sorts of events, and the remaining hotels will accommodate the par...
3,398
Title: The Number Games Time Limit: None seconds Memory Limit: None megabytes Problem Description: The nation of Panel holds an annual show called The Number Games, where each district in the nation will be represented by one contestant. The nation has $n$ districts numbered from $1$ to $n$, each district has exact...
3,399