task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Consider the following game for two players. There is one white token and some number of black tokens. Each token is placed on a plane in a point with integer coordinates *x* and *y*. The players take turn making moves, white sta...
1,300
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he measured the length of its sides, and found that each of them is equal to an integer number of centime...
1,301
Title: Purification Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an *n*<=×<=*n* grid. The rows are numbered 1 through *n* ...
1,302
Title: Position in Fraction Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have a fraction . You need to find the first occurrence of digit *c* into decimal notation of the fraction after decimal point. Input Specification: The first contains three single positive integers *a*, *b*, ...
1,303
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: In the capital city of Berland, Bertown, demonstrations are against the recent election of the King of Berland. Berland opposition, led by Mr. Ovalny, believes that the elections were not fair enough and wants to organize a demons...
1,304
Title: Berland Square Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Last year the world's largest square was built in Berland. It is known that the square can be represented as an infinite plane with an introduced Cartesian system of coordinates. On that square two sets of concentric circles...
1,305
Title: Fibonacci Number Time Limit: None seconds Memory Limit: None megabytes Problem Description: John Doe has a list of all Fibonacci numbers modulo 1013. This list is infinite, it starts with numbers 0 and 1. Each number in the list, apart from the first two, is a sum of previous two modulo 1013. That is, John's ...
1,306
Title: Lovely Matrix Time Limit: None seconds Memory Limit: None megabytes Problem Description: Lenny had an *n*<=×<=*m* matrix of positive integers. He loved the matrix so much, because each row of the matrix was sorted in non-decreasing order. For the same reason he calls such matrices of integers lovely. One day...
1,307
Title: How Many Squares? Time Limit: 2 seconds Memory Limit: 64 megabytes Problem Description: You are given a 0-1 rectangular matrix. What is the number of squares in it? A square is a solid square frame (border) with linewidth equal to 1. A square should be at least 2<=×<=2. We are only interested in two types of ...
1,308
Title: Number of Parallelograms Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given *n* points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points. Input Specification: The fir...
1,309
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn't show up, Yaroslav and Andrey play another game. Roman leaves a word for each of them. Each word consists of 2·*n* bi...
1,310
Title: Little Elephant and Sorting Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Little Elephant loves sortings. He has an array *a* consisting of *n* integers. Let's number the array elements from 1 to *n*, then the *i*-th element will be denoted as *a**i*. The Little Elephant can ...
1,311
Title: Cheap Travel Time Limit: None seconds Memory Limit: None megabytes Problem Description: Ann has recently started commuting by subway. We know that a one ride subway ticket costs *a* rubles. Besides, Ann found out that she can buy a special ticket for *m* rides (she can buy it several times). It costs *b* rubl...
1,312
Title: Mysterious strings Time Limit: None seconds Memory Limit: None megabytes Problem Description: The input contains a single integer *a* (1<=≤<=*a*<=≤<=40). Output a single string. Input Specification: The input contains a single integer *a* (1<=≤<=*a*<=≤<=40). Output Specification: Output a single string. D...
1,313
Title: An easy problem about trees Time Limit: None seconds Memory Limit: None megabytes Problem Description: Pieguy and Piegirl are playing a game. They have a rooted binary tree, that has a property that each node is either a leaf or has exactly two children. Each leaf has a number associated with it. On his/her ...
1,314
Title: Triangle Time Limit: 2 seconds Memory Limit: 64 megabytes Problem Description: Johnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she told his brother about the task that her kindergartener asked her to solve. The task was just to construct a triangle out o...
1,315
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: The game of Egg Roulette is played between two players. Initially 2*R* raw eggs and 2*C* cooked eggs are placed randomly into a carton. The shells are left on so there is no way to distinguish a raw egg from a cooked egg. One at a...
1,316
Title: Parallel Programming Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarpus has a computer with *n* processors. Also, his computer has *n* memory cells. We'll consider the processors numbered by integers from 1 to *n* and that the memory cells are consecutively numbered by integ...
1,317
Title: Number Busters Time Limit: None seconds Memory Limit: None megabytes Problem Description: Arthur and Alexander are number busters. Today they've got a competition. Arthur took a group of four integers *a*,<=*b*,<=*w*,<=*x* (0<=≤<=*b*<=&lt;<=*w*,<=0<=&lt;<=*x*<=&lt;<=*w*) and Alexander took integer *с*. Arth...
1,318
Title: Bear and Contribution Time Limit: None seconds Memory Limit: None megabytes Problem Description: Codeforces is a wonderful platform and one its feature shows how much someone contributes to the community. Every registered user has contribution — an integer number, not necessarily positive. There are *n* regis...
1,319
Title: Pizza, Pizza, Pizza!!! Time Limit: None seconds Memory Limit: None megabytes Problem Description: Katie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often share everything with each other and work together on some very hard problems. Today is Shiro's birthd...
1,320
Title: Sleepy Game Time Limit: None seconds Memory Limit: None megabytes Problem Description: Petya and Vasya arranged a game. The game runs by the following rules. Players have a directed graph consisting of *n* vertices and *m* edges. One of the vertices contains a chip. Initially the chip is located at vertex *s*...
1,321
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with *n* elements *a*1, *a*2, ..., *a**n* in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph ...
1,322
Title: Okabe and Boxes Time Limit: None seconds Memory Limit: None megabytes Problem Description: Okabe and Super Hacker Daru are stacking and removing boxes. There are *n* boxes numbered from 1 to *n*. Initially there are no boxes on the stack. Okabe, being a control freak, gives Daru 2*n* commands: *n* of which a...
1,323
Title: System Administrator Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarpus is a system administrator. There are two servers under his strict guidance — *a* and *b*. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping co...
1,324
Title: Depression Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: Do you remember a kind cartoon "Beauty and the Beast"? No, no, there was no firing from machine guns or radiation mutants time-travels! There was a beauty named Belle. Once she had violated the Beast's order and visited the Wes...
1,325
Title: Segments Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given an integer *N*. Consider all possible segments on the coordinate axis with endpoints at integer points with coordinates between 0 and *N*, inclusive; there will be of them. You want to draw these segments in se...
1,326
Title: Load Testing Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarp plans to conduct a load testing of its new project Fakebook. He already agreed with his friends that at certain points in time they will send requests to Fakebook. The load testing will last *n* minutes and in the...
1,327
Title: Landmarks Time Limit: None seconds Memory Limit: None megabytes Problem Description: We have an old building with *n*<=+<=2 columns in a row. These columns support the ceiling. These columns are located in points with coordinates 0<==<=*x*0<=&lt;<=*x*1<=&lt;<=...<=&lt;<=*x**n*<=&lt;<=*x**n*<=+<=1. The leftmos...
1,328
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Radewoosh is playing a computer game. There are *n* levels, numbered 1 through *n*. Levels are divided into *k* regions (groups). Each region contains some positive number of consecutive levels. The game repeats the the following...
1,329
Title: Shell Game Time Limit: None seconds Memory Limit: None megabytes Problem Description: Bomboslav likes to look out of the window in his room and watch lads outside playing famous shell game. The game is played by two persons: operator and player. Operator takes three similar opaque shells and places a ball ben...
1,330
Title: Dormitory Time Limit: None seconds Memory Limit: None megabytes Problem Description: Student Vasya came to study in Berland State University from the country, so he is living in a dormitory. A semester has *n* days, and in each of those days his parents send him some food. In the morning of the *i*-th day he ...
1,331
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of *n* meters. The given square is split into *n*<=×<=*n* cells (represented as unit squares), each cell has some number. At the b...
1,332
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Leha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immediately began to expand his network of hacked computers. During the week Leha managed to get access to *n* computer...
1,333
Title: Increase Sequence Time Limit: None seconds Memory Limit: None megabytes Problem Description: Peter has a sequence of integers *a*1,<=*a*2,<=...,<=*a**n*. Peter wants all numbers in the sequence to equal *h*. He can perform the operation of "adding one on the segment [*l*,<=*r*]": add one to all elements of th...
1,334
Title: On Sum of Fractions Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's assume that - *v*(*n*) is the largest prime number, that does not exceed *n*;- *u*(*n*) is the smallest prime number strictly greater than *n*. Find . Input Specification: The first line contains integer...
1,335
Title: Crunching Numbers Just for You Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are developing a new feature for the website which sells airline tickets: being able to sort tickets by price! You have already extracted the tickets' prices, so there's just the last step to be done....
1,336
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya's got a birthday coming up and his mom decided to give him an array of positive integers *a* of length *n*. Vasya thinks that an array's beauty is the greatest common divisor of all its elements. His mom, of course, wants t...
1,337
Title: Garden Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has a very beautiful country garden that can be represented as an *n*<=×<=*m* rectangular field divided into *n*·*m* squares. One beautiful day Vasya remembered that he needs to pave roads between *k* important squares tha...
1,338
Title: New Year and Finding Roots Time Limit: None seconds Memory Limit: None megabytes Problem Description: This is an interactive problem. In the interaction section below you will find the information about flushing the output. The New Year tree of height *h* is a perfect binary tree with vertices numbered 1 thr...
1,339
Title: Kamal-ol-molk's Painting Time Limit: None seconds Memory Limit: None megabytes Problem Description: Rumors say that one of Kamal-ol-molk's paintings has been altered. A rectangular brush has been moved right and down on the painting. Consider the painting as a *n*<=×<=*m* rectangular grid. At the beginning a...
1,340
Title: Color Stripe Time Limit: None seconds Memory Limit: None megabytes Problem Description: A colored stripe is represented by a horizontal row of *n* square cells, each cell is pained one of *k* colors. Your task is to repaint the minimum number of cells so that no two neighbouring cells are of the same color. Y...
1,341
Title: Hongcow Buys a Deck of Cards Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day, Hongcow goes to the store and sees a brand new deck of *n* special cards. Each individual card is either red or blue. He decides he wants to buy them immediately. To do this, he needs to play a gam...
1,342
Title: Kayaking Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vadim is really keen on travelling. Recently he heard about kayaking activity near his town and became very excited about it, so he joined a party of kayakers. Now the party is ready to start its journey, but firstly they hav...
1,343
Title: Voting for Photos Time Limit: None seconds Memory Limit: None megabytes Problem Description: After celebrating the midcourse the students of one of the faculties of the Berland State University decided to conduct a vote for the best photo. They published the photos in the social network and agreed on the rule...
1,344
Title: Lucky Ticket Time Limit: None seconds Memory Limit: None megabytes Problem Description: Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. ...
1,345
Title: Sereja and Stairs Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sereja loves integer sequences very much. He especially likes stairs. Sequence *a*1,<=*a*2,<=...,<=*a*|*a*| (|*a*| is the length of the sequence) is stairs if there is such index *i* (1<=≤<=*i*<=≤<=|*a*|), that the f...
1,346
Title: Ilya and Roads Time Limit: None seconds Memory Limit: None megabytes Problem Description: Everything is great about Ilya's city, except the roads. The thing is, the only ZooVille road is represented as *n* holes in a row. We will consider the holes numbered from 1 to *n*, from left to right. Ilya is really k...
1,347
Title: Borya's Diagnosis Time Limit: None seconds Memory Limit: None megabytes Problem Description: It seems that Borya is seriously sick. He is going visit *n* doctors to find out the exact diagnosis. Each of the doctors needs the information about all previous visits, so Borya has to visit them in the prescribed o...
1,348
Title: Car Repair Shop Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarp starts his own business. Tomorrow will be the first working day of his car repair shop. For now the car repair shop is very small and only one car can be repaired at a given time. Polycarp is good at marketing...
1,349
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: As Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas lights (he can turn them on and off with his mind). He can't directly tell his mom where he is, because the monster that took...
1,350
Title: Flawed Flow Time Limit: None seconds Memory Limit: None megabytes Problem Description: Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an undirected graph. The graph consists of *n* vertices and *m* edges. Vertices...
1,351
Title: Sum of Nestings Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recall that the bracket sequence is considered regular if it is possible to insert symbols '+' and '1' into it so that the result is a correct arithmetic expression. For example, a sequence "(()())" is regular, because ...
1,352
Title: Magic, Wizardry and Wonders Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya the Great Magician and Conjurer loves all kinds of miracles and wizardry. In one wave of a magic wand he can turn an object into something else. But, as you all know, there is no better magic in the Un...
1,353
Title: Rat Kwesh and Cheese Time Limit: None seconds Memory Limit: None megabytes Problem Description: Wet Shark asked Rat Kwesh to generate three positive real numbers *x*, *y* and *z*, from 0.1 to 200.0, inclusive. Wet Krash wants to impress Wet Shark, so all generated numbers will have exactly one digit after the...
1,354
Title: Dreamoon and Binary Time Limit: None seconds Memory Limit: None megabytes Problem Description: Dreamoon saw a large integer *x* written on the ground and wants to print its binary form out. Dreamoon has accomplished the part of turning *x* into its binary format. Now he is going to print it in the following m...
1,355
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have a map as a rectangle table. Each cell of the table is either an obstacle, or a treasure with a certain price, or a bomb, or an empty cell. Your initial position is also given to you. You can go from one cell of the map t...
1,356
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a table consisting of *n* rows and *m* columns. Each cell of the table contains either 0 or 1. In one move, you are allowed to pick any row or any column and invert all values, that is, replace 0 by 1 and vice versa....
1,357
Title: Comb Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: Having endured all the hardships, Lara Croft finally found herself in a room with treasures. To her surprise she didn't find golden mountains there. Lara looked around and noticed on the floor a painted table *n*<=×<=*m* panels in siz...
1,358
Title: Perfect Squares Time Limit: None seconds Memory Limit: None megabytes Problem Description: Given an array *a*1,<=*a*2,<=...,<=*a**n* of *n* integers, find the largest number in the array that is not a perfect square. A number *x* is said to be a perfect square if there exists an integer *y* such that *x*<==<...
1,359
Title: Traffic Jams in the Land Time Limit: None seconds Memory Limit: None megabytes Problem Description: Some country consists of (*n*<=+<=1) cities, located along a straight highway. Let's number the cities with consecutive integers from 1 to *n*<=+<=1 in the order they occur along the highway. Thus, the cities a...
1,360
Title: Exams Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day the Codeforces round author sat exams. He had *n* exams and he needed to get an integer from 2 to 5 for each exam. He will have to re-sit each failed exam, i.e. the exam that gets mark 2. The author would need to spend ...
1,361
Title: Jeff and Periods Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day Jeff got hold of an integer sequence *a*1, *a*2, ..., *a**n* of length *n*. The boy immediately decided to analyze the sequence. For that, he needs to find all values of *x*, for which these conditions hold: -...
1,362
Title: Roman and Numbers Time Limit: None seconds Memory Limit: None megabytes Problem Description: Roman is a young mathematician, very famous in Uzhland. Unfortunately, Sereja doesn't think so. To make Sereja change his mind, Roman is ready to solve any mathematical problem. After some thought, Sereja asked Roma t...
1,363
Title: Geometric Progression Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarp loves geometric progressions very much. Since he was only three years old, he loves only the progressions of length three. He also has a favorite integer *k* and a sequence *a*, consisting of *n* integers...
1,364
Title: Palindromic Times Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Tattah is asleep if and only if Tattah is attending a lecture. This is a well-known formula among Tattah's colleagues. On a Wednesday afternoon, Tattah was attending Professor HH's lecture. At 12:21, right before falling...
1,365
Title: Hiring Staff Time Limit: None seconds Memory Limit: None megabytes Problem Description: A new Berland businessman Vitaly is going to open a household appliances' store. All he's got to do now is to hire the staff. The store will work seven days a week, but not around the clock. Every day at least *k* people ...
1,366
Title: Felicity is Coming! Time Limit: None seconds Memory Limit: None megabytes Problem Description: It's that time of the year, Felicity is around the corner and you can see people celebrating all around the Himalayan region. The Himalayan region has *n* gyms. The *i*-th gym has *g**i* Pokemon in it. There are *m*...
1,367
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently, Dima met with Sasha in a philatelic store, and since then they are collecting coins together. Their favorite occupation is to sort collections of coins. Sasha likes having things in order, that is why he wants his coins ...
1,368
Title: Programming Language Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, desig...
1,369
Title: On Segment's Own Points Time Limit: None seconds Memory Limit: None megabytes Problem Description: Our old friend Alexey has finally entered the University of City N — the Berland capital. Alexey expected his father to get him a place to live in but his father said it was high time for Alexey to practice some...
1,370
Title: Newspaper Headline Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: A newspaper is published in Walrusland. Its heading is *s*1, it consists of lowercase Latin letters. Fangy the little walrus wants to buy several such newspapers, cut out their headings, glue them one to another in order...
1,371
Title: Little Pony and Sort by Shift Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day, Twilight Sparkle is interested in how to sort a sequence of integers *a*1,<=*a*2,<=...,<=*a**n* in non-decreasing order. Being a young unicorn, the only operation she can perform is a unit shift. ...
1,372
Title: Multi-judge Solving Time Limit: None seconds Memory Limit: None megabytes Problem Description: Makes solves problems on Decoforces and lots of other different online judges. Each problem is denoted by its difficulty — a positive integer number. Difficulties are measured the same across all the judges (the pro...
1,373
Title: Restoring Numbers Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya had two arrays consisting of non-negative integers: *a* of size *n* and *b* of size *m*. Vasya chose a positive integer *k* and created an *n*<=×<=*m* matrix *v* using the following formula: Vasya wrote down ma...
1,374
Title: Qualification Rounds Time Limit: None seconds Memory Limit: None megabytes Problem Description: Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of *n* problems, and they want to select any non-empty subset of it as a problemset. ...
1,375
Title: Cards 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 ...
1,376
Title: Marvolo Gaunt's Ring Time Limit: None seconds Memory Limit: None megabytes Problem Description: Professor Dumbledore is helping Harry destroy the Horcruxes. He went to Gaunt Shack as he suspected a Horcrux to be present there. He saw Marvolo Gaunt's Ring and identified it as a Horcrux. Although he destroyed i...
1,377
Title: Physical Education and Buns Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Physical education teacher at SESC is a sort of mathematician too. His most favorite topic in mathematics is progressions. That is why the teacher wants the students lined up in non-decreasing height for...
1,378
Title: Polo the Penguin and Houses Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little penguin Polo loves his home village. The village has *n* houses, indexed by integers from 1 to *n*. Each house has a plaque containing an integer, the *i*-th house has a plaque containing integer *p*...
1,379
Title: Vika and Segments Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system on this sheet and drew *n* black horizontal and vertical segments parallel to the coordi...
1,380
Title: Special Matrices Time Limit: None seconds Memory Limit: None megabytes Problem Description: An *n*<=×<=*n* square matrix is special, if: - it is binary, that is, each cell contains either a 0, or a 1; - the number of ones in each row and column equals 2. You are given *n* and the first *m* rows of the mat...
1,381
Title: Ostap and Grasshopper Time Limit: None seconds Memory Limit: None megabytes Problem Description: On the way to Rio de Janeiro Ostap kills time playing with a grasshopper he took with him in a special box. Ostap builds a line of length *n* such that some cells of this line are empty and some contain obstacles....
1,382
Title: Hamsters and Tigers Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: Today there is going to be an unusual performance at the circus — hamsters and tigers will perform together! All of them stand in circle along the arena edge and now the trainer faces a difficult task: he wants to swap ...
1,383
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: The GCD table *G* of size *n*<=×<=*n* for an array of positive integers *a* of length *n* is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers *x* and *y* is the greatest intege...
1,384
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: A dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day, people model a dragon with bamboo strips and clothes, raise them with rods, and hold the rods high and low to resemble a flying dragon. A performer holding th...
1,385
Title: Weak Memory Time Limit: None seconds Memory Limit: None megabytes Problem Description: Zart PMP is qualified for ICPC World Finals in Harbin, China. After team excursion to Sun Island Park for snow sculpture art exposition, PMP should get back to buses before they leave. But the park is really big and he does...
1,386
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Pavel loves grid mazes. A grid maze is an *n*<=×<=*m* rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side. Pavel drew a grid maze w...
1,387
Title: Ksusha and Array Time Limit: None seconds Memory Limit: None megabytes Problem Description: Ksusha is a beginner coder. Today she starts studying arrays. She has array *a*1,<=*a*2,<=...,<=*a**n*, consisting of *n* positive integers. Her university teacher gave her a task. Find such number in the array, that ...
1,388
Title: Fox And Snake Time Limit: None seconds Memory Limit: None megabytes Problem Description: Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead. A snake is a pattern on a *n* by *m* table. Denote *c*...
1,389
Title: Replacing Digits Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given an integer *a* that consists of *n* digits. You are also given a sequence of digits *s* of length *m*. The digit in position *j* (1<=≤<=*j*<=≤<=*m*) of sequence *s* means that you can choose an arbitrary ...
1,390
Title: Salazar Slytherin's Locket Time Limit: None seconds Memory Limit: None megabytes Problem Description: Harry came to know from Dumbledore that Salazar Slytherin's locket is a horcrux. This locket was present earlier at 12 Grimmauld Place, the home of Sirius Black's mother. It was stolen from there and is now p...
1,391
Title: Kefa and First Steps Time Limit: None seconds Memory Limit: None megabytes Problem Description: Kefa decided to make some money doing business on the Internet for exactly *n* days. He knows that on the *i*-th day (1<=≤<=*i*<=≤<=*n*) he makes *a**i* money. Kefa loves progress, that's why he wants to know the l...
1,392
Title: Free Ice Cream Time Limit: None seconds Memory Limit: None megabytes Problem Description: After their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer. At the start of the day they have *x* ice cream packs. Since the ice cream is free, p...
1,393
Title: Bayan Bus Time Limit: None seconds Memory Limit: None megabytes Problem Description: The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows. The ...
1,394
Title: Vasya and the Bus Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day Vasya heard a story: "In the city of High Bertown a bus number 62 left from the bus station. It had *n* grown-ups and *m* kids..." The latter events happen to be of no importance to us. Vasya is an accountant...
1,395
Title: Cube Problem Time Limit: None seconds Memory Limit: None megabytes Problem Description: Yaroslav, Andrey and Roman love playing cubes. Sometimes they get together and play cubes for hours and hours! Today they got together again and they are playing cubes. Yaroslav took unit cubes and composed them into an ...
1,396
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: As behooves any intelligent schoolboy, Kevin Sun is studying psycowlogy, cowculus, and cryptcowgraphy at the Bovinia State University (BGU) under Farmer Ivan. During his Mathematics of Olympiads (MoO) class, Kevin was confronted w...
1,397
Title: News About Credit Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarp studies at the university in the group which consists of *n* students (including himself). All they are registrated in the social net "TheContacnt!". Not all students are equally sociable. About each student...
1,398
Title: Ilya and Sticks Time Limit: None seconds Memory Limit: None megabytes Problem Description: In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of *n* sticks and an instrument. Each stick is characterized by its length *l**i*. Ilya decided to m...
1,399