task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Title: Fox and Box Accumulation 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...
1,200
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: 'In Boolean logic, a formula is in conjunctive normal form (CNF) or clausal normal form if it is a conjunction of clauses, where a clause is a disjunction of literals' (cited from https://en.wikipedia.org/wiki/Conjunctive_normal_f...
1,201
Title: Yet Another Problem On a Subsequence Time Limit: None seconds Memory Limit: None megabytes Problem Description: The sequence of integers $a_1, a_2, \dots, a_k$ is called a good array if $a_1 = k - 1$ and $a_1 > 0$. For example, the sequences $[3, -1, 44, 0], [1, -99]$ are good arrays, and the sequences $[3...
1,202
Title: Modular Equations Time Limit: None seconds Memory Limit: None megabytes Problem Description: Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define *i* modulo *j* as the remainder of division of *i* by *j* and denote it by . A Modular Equation, as Hamed'...
1,203
Title: Ladies' Shop Time Limit: None seconds Memory Limit: None megabytes Problem Description: A ladies' shop has recently opened in the city of Ultima Thule. To get ready for the opening, the shop bought *n* bags. Each bag is characterised by the total weight *a**i* of the items you can put there. The weird thing i...
1,204
Title: Qualifying Contest Time Limit: None seconds Memory Limit: None megabytes Problem Description: Very soon Berland will hold a School Team Programming Olympiad. From each of the *m* Berland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and i...
1,205
Title: Pasha and Hamsters Time Limit: None seconds Memory Limit: None megabytes Problem Description: Pasha has two hamsters: Arthur and Alexander. Pasha put *n* apples in front of them. Pasha knows which apples Arthur likes. Similarly, Pasha knows which apples Alexander likes. Pasha doesn't want any conflict between...
1,206
Title: Dominoes Time Limit: None seconds Memory Limit: None megabytes Problem Description: During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put *nm* dominoes on the table as an *...
1,207
Title: Word Capitalization Time Limit: None seconds Memory Limit: None megabytes Problem Description: Capitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word. Note, that during capitalization all the letters except the first one remains unchanged. Input...
1,208
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from $1$ to $n$ and t...
1,209
Title: Tennis Tournament Time Limit: None seconds Memory Limit: None megabytes Problem Description: A tennis tournament with *n* participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out. The tournament takes place in the following way (below, *m* is ...
1,210
Title: A + B Strikes Back Time Limit: None seconds Memory Limit: None megabytes Problem Description: A + B is often used as an example of the easiest problem possible to show some contest platform. However, some scientists have observed that sometimes this problem is not so easy to get accepted. Want to try? Input ...
1,211
Title: Almost Identity Permutations Time Limit: None seconds Memory Limit: None megabytes Problem Description: A permutation *p* of size *n* is an array such that every integer from 1 to *n* occurs exactly once in this array. Let's call a permutation an almost identity permutation iff there exist at least *n*<=-<=*...
1,212
Title: Initial Bet Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are five people playing a game called "Generosity". Each person gives some non-zero number of coins *b* as an initial bet. After all players make their bets of *b* coins, the following operation is repeated for severa...
1,213
Title: Jon Snow and his Favourite Number Time Limit: None seconds Memory Limit: None megabytes Problem Description: Jon Snow now has to fight with White Walkers. He has *n* rangers, each of which has his own strength. Also Jon Snow has his favourite number *x*. Each ranger can fight with a white walker only if the s...
1,214
Title: Permutation Sum Time Limit: None seconds Memory Limit: None megabytes Problem Description: 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*...
1,215
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: The "BerCorp" company has got *n* employees. These employees can use *m* approved official languages for the formal correspondence. The languages are numbered with integers from 1 to *m*. For each employee we have the list of lang...
1,216
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Imagine that you are in a building that has exactly *n* floors. You can move between the floors in a lift. Let's number the floors from bottom to top with integers from 1 to *n*. Now you're on the floor number *a*. You are very bo...
1,217
Title: New Year and Entity Enumeration Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given an integer *m*. Let *M*<==<=2*m*<=-<=1. You are also given a set of *n* integers denoted as the set *T*. The integers will be provided in base 2 as *n* binary strings of length *m*. A se...
1,218
Title: Mind the Gap Time Limit: None seconds Memory Limit: None megabytes Problem Description: These days Arkady works as an air traffic controller at a large airport. He controls a runway which is usually used for landings only. Thus, he has a schedule of planes that are landing in the nearest future, each landing ...
1,219
Title: Valera and Fruits Time Limit: None seconds Memory Limit: None megabytes Problem Description: Valera loves his garden, where *n* fruit trees grow. This year he will enjoy a great harvest! On the *i*-th tree *b**i* fruit grow, they will ripen on a day number *a**i*. Unfortunately, the fruit on the tree get wit...
1,220
Title: Check the string Time Limit: None seconds Memory Limit: None megabytes Problem Description: A has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the end of this string. Since both A and B like the characters 'a' and 'b...
1,221
Title: Mike and Fish Time Limit: None seconds Memory Limit: None megabytes Problem Description: As everyone knows, bears love fish. But Mike is a strange bear; He hates fish! The even more strange thing about him is he has an infinite number of blue and red fish. He has marked *n* distinct points in the plane. *i*...
1,222
Title: Santa Clauses and a Soccer Championship Time Limit: None seconds Memory Limit: None megabytes Problem Description: The country Treeland consists of *n* cities connected with *n*<=-<=1 bidirectional roads in such a way that it's possible to reach every city starting from any other city using these roads. There...
1,223
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Dreamoon loves summing up something for no reason. One day he obtains two integers *a* and *b* occasionally. He wants to calculate the sum of all nice integers. Positive integer *x* is called nice if and , where *k* is some integ...
1,224
Title: Military Trainings Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Smart Beaver from ABBYY started cooperating with the Ministry of Defence. Now they train soldiers to move armoured columns. The training involves testing a new type of tanks that can transmit information. To test...
1,225
Title: Palindromic Supersequence Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a string *A*. Find a string *B*, where *B* is a palindrome and *A* is a subsequence of *B*. A subsequence of a string is a string that can be derived from it by deleting some (not necessarily co...
1,226
Title: Jumping Ball Time Limit: None seconds Memory Limit: None megabytes Problem Description: 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 b...
1,227
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: There is an *n*<=Γ—<=*m* rectangular grid, each cell of the grid contains a single integer: zero or one. Let's call the cell on the *i*-th row and the *j*-th column as (*i*,<=*j*). Let's define a "rectangle" as four integers *a*,<...
1,228
Title: Biologist Time Limit: None seconds Memory Limit: None megabytes Problem Description: SmallR is a biologist. Her latest research finding is how to change the sex of dogs. In other words, she can change female dogs into male dogs and vice versa. She is going to demonstrate this technique. Now SmallR has *n* do...
1,229
Title: Save the problem! Time Limit: None seconds Memory Limit: None megabytes Problem Description: Attention: we lost all the test cases for this problem, so instead of solving the problem, we need you to generate test cases. We're going to give you the answer, and you need to print a test case that produces the gi...
1,230
Title: Drawing Circles is Fun Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are a set of points *S* on the plane. This set doesn't contain the origin *O*(0,<=0), and for each two distinct points in the set *A* and *B*, the triangle *OAB* has strictly positive area. Consider a set ...
1,231
Title: Perfect Number Time Limit: None seconds Memory Limit: None megabytes Problem Description: We consider a positive integer perfect, if and only if the sum of its digits is exactly $10$. Given a positive integer $k$, your task is to find the $k$-th smallest perfect positive integer. Input Specification: A singl...
1,232
Title: World Cup Time Limit: None seconds Memory Limit: None megabytes Problem Description: The last stage of Football World Cup is played using the play-off system. There are *n* teams left in this stage, they are enumerated from 1 to *n*. Several rounds are held, in each round the remaining teams are sorted in th...
1,233
Title: Find Maximum Time Limit: None seconds Memory Limit: None megabytes Problem Description: Valera has array *a*, consisting of *n* integers *a*0,<=*a*1,<=...,<=*a**n*<=-<=1, and function *f*(*x*), taking an integer from 0 to 2*n*<=-<=1 as its single argument. Value *f*(*x*) is calculated by formula , where value...
1,234
Title: Dexterina’s Lab Time Limit: None seconds Memory Limit: None megabytes Problem Description: Dexterina and Womandark have been arch-rivals since they’ve known each other. Since both are super-intelligent teenage girls, they’ve always been trying to solve their disputes in a peaceful and nonviolent way. After go...
1,235
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: A monster is attacking the Cyberland! Master Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (*HP*), offensive power (*ATK*) and defensive power (*DEF*). During the battle, ev...
1,236
Title: Unfair Poll Time Limit: None seconds Memory Limit: None megabytes Problem Description: On the Literature lesson Sergei noticed an awful injustice, it seems that some students are asked more often than others. Seating in the class looks like a rectangle, where *n* rows with *m* pupils in each. The teacher a...
1,237
Title: Strange Sorting Time Limit: None seconds Memory Limit: None megabytes Problem Description: How many specific orders do you know? Ascending order, descending order, order of ascending length, order of ascending polar angle... Let's have a look at another specific order: *d*-sorting. This sorting is applied to ...
1,238
Title: Pie Rules Time Limit: None seconds Memory Limit: None megabytes Problem Description: You may have heard of the pie rule before. It states that if two people wish to fairly share a slice of pie, one person should cut the slice in half, and the other person should choose who gets which slice. Alice and Bob have...
1,239
Title: A Serial Killer Time Limit: None seconds Memory Limit: None megabytes Problem Description: Our beloved detective, Sherlock is currently trying to catch a serial killer who kills a person each day. Using his powers of deduction, he came to know that the killer has a strategy for selecting his next victim. The...
1,240
Title: Inna and Huge Candy Matrix Time Limit: None seconds Memory Limit: None megabytes Problem Description: Inna and Dima decided to surprise Sereja. They brought a really huge candy matrix, it's big even for Sereja! Let's number the rows of the giant matrix from 1 to *n* from top to bottom and the columns β€” from 1...
1,241
Title: Pairs of Numbers Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's assume that we have a pair of numbers (*a*,<=*b*). We can get a new pair (*a*<=+<=*b*,<=*b*) or (*a*,<=*a*<=+<=*b*) from the given pair in a single step. Let the initial pair of numbers be (1,1). Your task is to...
1,242
Title: Mishka and Divisors Time Limit: None seconds Memory Limit: None megabytes Problem Description: After playing with her beautiful array, Mishka decided to learn some math. After learning how to multiply, divide and what is divisibility, she is now interested in solving the following problem. You are given inte...
1,243
Title: Checkposts Time Limit: None seconds Memory Limit: None megabytes Problem Description: Your city has *n* junctions. There are *m* one-way roads between the junctions. As a mayor of the city, you have to ensure the security of all the junctions. To ensure the security, you have to build some police checkposts....
1,244
Title: Encoding Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarp invented a new way to encode strings. Let's assume that we have string *T*, consisting of lowercase English letters. Let's choose several pairs of letters of the English alphabet in such a way that each letter occurs ...
1,245
Title: As Fast As Possible Time Limit: None seconds Memory Limit: None megabytes Problem Description: On vacations *n* pupils decided to go on excursion and gather all together. They need to overcome the path with the length *l* meters. Each of the pupils will go with the speed equal to *v*1. To get to the excursion...
1,246
Title: Lie or Truth Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has a sequence of cubes and exactly one integer is written on each cube. Vasya exhibited all his cubes in a row. So the sequence of numbers written on the cubes in the order from the left to the right equals to *a*1,...
1,247
Title: Petr# Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Long ago, when Petya was a schoolboy, he was very much interested in the Petr# language grammar. During one lesson Petya got interested in the following question: how many different continuous substrings starting with the *s**begin* ...
1,248
Title: Sheldon and Ice Pieces Time Limit: None seconds Memory Limit: None megabytes Problem Description: Do you remember how Kai constructed the word "eternity" using pieces of ice as components? Little Sheldon plays with pieces of ice, each piece has exactly one digit between 0 and 9. He wants to construct his fav...
1,249
Title: Sherlock and his girlfriend Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sherlock has a new girlfriend (so unlike him!). Valentine's day is coming and he wants to gift her some jewelry. He bought *n* pieces of jewelry. The *i*-th piece has price equal to *i*<=+<=1, that is, the ...
1,250
Title: none 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*,<=*j**k*) meets...
1,251
Title: Animals and Puzzle Time Limit: None seconds Memory Limit: None megabytes Problem Description: Owl Sonya gave a huge lake puzzle of size *n*<=Γ—<=*m* to hedgehog Filya as a birthday present. Friends immediately started to assemble the puzzle, but some parts of it turned out to be emptyΒ β€” there was no picture on...
1,252
Title: Petya and Tree Time Limit: 3 seconds Memory Limit: 256 megabytes Problem Description: One night, having had a hard day at work, Petya saw a nightmare. There was a binary search tree in the dream. But it was not the actual tree that scared Petya. The horrifying thing was that Petya couldn't search for elements...
1,253
Title: Function Time Limit: None seconds Memory Limit: None megabytes Problem Description: Serega and Fedor play with functions. One day they came across a very interesting function. It looks like that: - *f*(1,<=*j*)<==<=*a*[*j*], 1<=≀<=*j*<=≀<=*n*. - *f*(*i*,<=*j*)<==<=*min*(*f*(*i*<=-<=1,<=*j*),<=*f*(*i*<=-<=1...
1,254
Title: Average Sleep Time Time Limit: None seconds Memory Limit: None megabytes Problem Description: It's been almost a week since Polycarp couldn't get rid of insomnia. And as you may already know, one week in Berland lasts *k* days! When Polycarp went to a doctor with his problem, the doctor asked him about his s...
1,255
Title: Mike and Fun Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mike and some bears are playing a game just for fun. Mike is the judge. All bears except Mike are standing in an *n*<=Γ—<=*m* grid, there's exactly one bear in each cell. We denote the bear standing in column number *j* of ...
1,256
Title: Array Time Limit: None seconds Memory Limit: None megabytes Problem Description: You've got an array *a*, consisting of *n* integers: *a*1,<=*a*2,<=...,<=*a**n*. Your task is to find a minimal by inclusion segment [*l*,<=*r*] (1<=≀<=*l*<=≀<=*r*<=≀<=*n*) such, that among numbers *a**l*,<=Β *a**l*<=+<=1,<=Β ...,<...
1,257
Title: k-Tree Time Limit: None seconds Memory Limit: None megabytes Problem Description: 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 ...
1,258
Title: Posterized Time Limit: None seconds Memory Limit: None megabytes Problem Description: Professor Ibrahim has prepared the final homework for his algorithm’s class. He asked his students to implement the Posterization Image Filter. Their algorithm will be tested on an array of integers, where the $i$-th intege...
1,259
Title: The Big Race Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vector Willman and Array Bolt are the two most famous athletes of Byteforces. They are going to compete in a race with a distance of *L* meters today. Willman and Bolt have exactly the same speed, so when they compete the...
1,260
Title: Perfect Groups Time Limit: None seconds Memory Limit: None megabytes Problem Description: SaMer has written the greatest test case of all time for one of his problems. For a given array of integers, the problem asks to find the minimum number of groups the array can be divided into, such that the product of a...
1,261
Title: Meta-universe Time Limit: None seconds Memory Limit: None megabytes Problem Description: Consider infinite grid of unit cells. Some of those cells are planets. Meta-universe *M*<==<={*p*1,<=*p*2,<=...,<=*p**k*} is a set of planets. Suppose there is an infinite row or column with following two properties: 1)...
1,262
Title: Bag of mice Time Limit: None seconds Memory Limit: None megabytes Problem Description: The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess thinks they should just go to bed ear...
1,263
Title: Marmots (hard) Time Limit: None seconds Memory Limit: None megabytes Problem Description: Your task is the exact same as for the easy version. But this time, the marmots subtract the village's population *P* from their random number before responding to Heidi's request. Also, there are now villages with as f...
1,264
Title: Okabe and Banana Trees Time Limit: None seconds Memory Limit: None megabytes Problem Description: Okabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees. Consider the point (*x*,<=*y*) in the 2D plane such that *x* and *y* are integers a...
1,265
Title: Polygons Time Limit: None seconds Memory Limit: None megabytes Problem Description: You've got another geometrical task. You are given two non-degenerate polygons *A* and *B* as vertex coordinates. Polygon *A* is strictly convex. Polygon *B* is an arbitrary polygon without any self-intersections and self-touc...
1,266
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: One department of some software company has $n$ servers of different specifications. Servers are indexed with consecutive integers from $1$ to $n$. Suppose that the specifications of the $j$-th server may be expressed with a singl...
1,267
Title: Freezing with Style Time Limit: None seconds Memory Limit: None megabytes Problem Description: This winter is so... well, you've got the idea :-) The Nvodsk road system can be represented as *n* junctions connected with *n*<=-<=1 bidirectional roads so that there is a path between any two junctions. The organ...
1,268
Title: Sereja and Cinema Time Limit: None seconds Memory Limit: None megabytes Problem Description: The cinema theater hall in Sereja's city is *n* seats lined up in front of one large screen. There are slots for personal possessions to the left and to the right of each seat. Any two adjacent seats have exactly one ...
1,269
Title: Caesar's Legions Time Limit: None seconds Memory Limit: None megabytes Problem Description: Gaius Julius Caesar, a famous general, loved to line up his soldiers. Overall the army had *n*1 footmen and *n*2 horsemen. Caesar thought that an arrangement is not beautiful if somewhere in the line there are strictly...
1,270
Title: Three Trees Time Limit: None seconds Memory Limit: None megabytes Problem Description: This problem consists of two subproblems: for solving subproblem E1 you will receive 11 points, and for solving subproblem E2 you will receive 13 points. A tree is an undirected connected graph containing no cycles. The di...
1,271
Title: Little Elephant and Interval Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Little Elephant very much loves sums on intervals. This time he has a pair of integers *l* and *r* (*l*<=≀<=*r*). The Little Elephant has to find the number of such integers *x* (*l*<=≀<=*x*<=≀<=*r*), ...
1,272
Title: Domino Principle Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Vasya is interested in arranging dominoes. He is fed up with common dominoes and he uses the dominoes of different heights. He put *n* dominoes on the table along one axis, going from left to right. Every domino stands per...
1,273
Title: Powerful array Time Limit: 5 seconds Memory Limit: 256 megabytes Problem Description: An array of positive integers *a*1,<=*a*2,<=...,<=*a**n* is given. Let us consider its arbitrary subarray *a**l*,<=*a**l*<=+<=1...,<=*a**r*, where 1<=≀<=*l*<=≀<=*r*<=≀<=*n*. For every positive integer *s* denote by *K**s* th...
1,274
Title: Restoring Table Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently Polycarpus has learned the "bitwise AND" operation (which is also called "AND") of non-negative integers. Now he wants to demonstrate the school IT teacher his superb manipulation with the learned operation. F...
1,275
Title: Inna and Nine Time Limit: None seconds Memory Limit: None megabytes Problem Description: Inna loves digit 9 very much. That's why she asked Dima to write a small number consisting of nines. But Dima must have misunderstood her and he wrote a very large number *a*, consisting of digits from 1 to 9. Inna wants...
1,276
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Bob recently read about bitwise operations used in computers: AND, OR and XOR. He have studied their properties and invented a new game. Initially, Bob chooses integer *m*, bit depth of the game, which means that all numbers in t...
1,277
Title: New Year Present Time Limit: None seconds Memory Limit: None megabytes Problem Description: The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception. Vasily knows that the best present is (no, it's not a contest) money. He's put *n* empt...
1,278
Title: Wonderful Randomized Sum Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Learn, learn and learn again β€” Valera has to do this every day. He is studying at mathematical school, where math is the main discipline. The mathematics teacher loves her discipline very much and tries to cultivat...
1,279
Title: Boxes Packing Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mishka has got *n* empty boxes. For every *i* (1<=≀<=*i*<=≀<=*n*), *i*-th box is a cube with side length *a**i*. Mishka can put a box *i* into another box *j* if the following conditions are met: - *i*-th box is not pu...
1,280
Title: Run For Your Prize Time Limit: None seconds Memory Limit: None megabytes Problem Description: You and your friend are participating in a TV show "Run For Your Prize". At the start of the show *n* prizes are located on a straight line. *i*-th prize is located at position *a**i*. Positions of all prizes are di...
1,281
Title: Word Cut Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's consider one interesting word game. In this game you should transform one word into another through special operations. Let's say we have word *w*, let's split this word into two non-empty parts *x* and *y* so, that *w...
1,282
Title: List Of Integers Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's denote as *L*(*x*,<=*p*) an infinite sequence of integers *y* such that *gcd*(*p*,<=*y*)<==<=1 and *y*<=&gt;<=*x* (where *gcd* is the greatest common divisor of two integer numbers), sorted in ascending order. Th...
1,283
Title: Candies Game Time Limit: None seconds Memory Limit: None megabytes Problem Description: Iahub is playing an uncommon game. Initially, he has *n* boxes, numbered 1, 2, 3, ..., *n*. Each box has some number of candies in it, described by a sequence *a*1, *a*2, ..., *a**n*. The number *a**k* represents the numbe...
1,284
Title: Arpa and an exam about geometry Time Limit: None seconds Memory Limit: None megabytes Problem Description: Arpa is taking a geometry exam. Here is the last problem of the exam. You are given three points *a*,<=*b*,<=*c*. Find a point and an angle such that if we rotate the page around the point by the angle...
1,285
Title: Third Month Insanity Time Limit: None seconds Memory Limit: None megabytes Problem Description: The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2*N* teams participating in the tournament, numbered from 1 to 2*N*...
1,286
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's consider the following game. We have a rectangular field *n*<=Γ—<=*m* in size. Some squares of the field contain chips. Each chip has an arrow painted on it. Thus, each chip on the field points in one of the following direct...
1,287
Title: Businessmen Problems Time Limit: None seconds Memory Limit: None megabytes Problem Description: Two famous competing companies ChemForces and TopChemist decided to show their sets of recently discovered chemical elements on an exhibition. However they know that no element should be present in the sets of both...
1,288
Title: Basketball Team Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: As a German University in Cairo (GUC) student and a basketball player, Herr Wafa was delighted once he heard the news. GUC is finally participating in the Annual Basketball Competition (ABC). A team is to be formed of *n*...
1,289
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given an integer *m*, and a list of *n* distinct integers between 0 and *m*<=-<=1. You would like to construct a sequence satisfying the properties: - Each element is an integer between 0 and *m*<=-<=1, inclusive. - Al...
1,290
Title: Mice problem Time Limit: None seconds Memory Limit: None megabytes Problem Description: Igor the analyst fell asleep on the work and had a strange dream. In the dream his desk was crowded with computer mice, so he bought a mousetrap to catch them. The desk can be considered as an infinite plane, then the mou...
1,291
Title: Gotta Go Fast Time Limit: None seconds Memory Limit: None megabytes Problem Description: You're trying to set the record on your favorite video game. The game consists of *N* levels, which must be completed sequentially in order to beat the game. You usually complete each level as fast as possible, but someti...
1,292
Title: Points and Segments (easy) Time Limit: None seconds Memory Limit: None megabytes Problem Description: Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinkin...
1,293
Title: Jabber ID Time Limit: 0 seconds Memory Limit: 256 megabytes Problem Description: Jabber ID on the national Berland service Β«BabberΒ» has a form &lt;username&gt;@&lt;hostname&gt;[/resource], where - &lt;username&gt; β€” is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters Β«...
1,294
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has *n* items lying in a line. The items are consecutively numbered by numbers from 1 to *n* in such a way that the leftmost item has number 1, the rightmost item has number *n*. Each item has a weight, the *i*-th item weigh...
1,295
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mike is a bartender at Rico's bar. At Rico's, they put beer glasses in a special shelf. There are *n* kinds of beer at Rico's numbered from 1 to *n*. *i*-th kind of beer has *a**i* milliliters of foam on it. Maxim is Mike's boss....
1,296
Title: Crash Time Limit: None seconds Memory Limit: None megabytes Problem Description: During the "Russian Code Cup" programming competition, the testing system stores all sent solutions for each participant. We know that many participants use random numbers in their programs and are often sent several solutions wi...
1,297
Title: Exploration plan Time Limit: None seconds Memory Limit: None megabytes Problem Description: The competitors of Bubble Cup X gathered after the competition and discussed what is the best way to get to know the host country and its cities. After exploring the map of Serbia for a while, the competitors came up ...
1,298
Title: Strongly Connected Tournament Time Limit: None seconds Memory Limit: None megabytes Problem Description: There is a chess tournament in All-Right-City. *n* players were invited to take part in the competition. The tournament is held by the following rules: 1. Initially, each player plays one game with every...
1,299