112A Petya and Strings
Little Petya loves presents. His mum bought him two strings of the same size for his birthday
Read more →Little Petya loves presents. His mum bought him two strings of the same size for his birthday
Read more →Let's define a split of n as a nonincreasing sequence of positive integers, the sum of which is n
Read more →There are n points on the plane, (x1,y1),(x2,y2),…,(xn,yn).
Read more →Mishka got a six-faced dice. It has integer numbers from 2 to 7 written on its faces
Read more →Anton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right now Danik tells Anton a fairy tale.
Read more →There is the faculty of Computer Science in Berland. In the social net "TheContact.
Read more →Maxim wants to buy an apartment in a new house at Line Avenue of Metropolis.
Read more →You are given an array a consisting of n integers.
Read more →Mikhail walks on a 2D plane. He can go either up or right. You are given a sequence of Mikhail's moves. He thinks that this sequence is too long and he wants.
Read more →A sentence is a list of words that are separated by a single space with no leading or trailing spaces
Read more →Vasily the Programmer loves romance, so this year he decided to illuminate his room with candles
Read more →After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors
Read more →Chouti was doing a competitive programming competition.
Read more →Let's define a split of n as a nonincreasing sequence of positive integers, the sum of which is n
Read more →You can not just take the file and send it. When Polycarp trying to send a file in the social network.
Read more →You are given two integers a and b.
Read more →Polycarp loves ciphers. He has invented his own cipher called repeating.
Read more →There are n stones on the table in a row, each of them can be red
Read more →Ivan has number b He is sorting through the numbers a from 1
Read more →The last stage of Football World Cup is played using the play-off system.
Read more →You are given integer n have to arrange numbers from 1 to 2n using each of them exactly once
Read more →Monocarp has decided to buy a new TV set and hang it on the wall in his flat.
Read more →Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters.
Read more →Alice and Bob are playing a game on an array a of n positive integers
Read more →In the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no two soldiers should
Read more →There is a house with n flats situated on the main street of Berlatov.
Read more →Ivan is collecting coins. There are only N different collectible coins, Ivan has K of them
Read more →To make a paper airplane, one has to use a rectangular piece of paper. From a sheet of standard size you can make s airplanes.
Read more →Old timers of Summer Informatics School can remember previous camps in which each student was given a drink of his choice on the vechorka
Read more →Maxim wants to buy an apartment in a new house at Line Avenue of Metropolis.
Read more →Petya is having a party soon, and he has decided to invite his n friends.
Read more →You are given n numbers a1,a2,…,an. With a cost of one coin you can perform the following operation:
Read more →A few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to find Amir, one of his schoolmates and good friends.
Read more →You are given a set of n segments on the axis Ox, each segment has integer endpoints between
Read more →You are given a string s consisting only of lowercase Latin letters.
Read more →For simplicity, we'll assume that there are only three types of grapes: green grapes, purple grapes and black grapes.
Read more →On an 8×8 grid, some horizontal rows have been painted red, and some vertical columns have been painted blue
Read more →You are given k sequences of integers. The length of the i-th sequence equals to ni .
Read more →In Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of n students
Read more →Okabe needs to renovate the Future Gadget Laboratory after he tried doing some crazy experiments! The lab is represented as an n by n
Read more →Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Read more →Try guessing the statement from this picture
Read more →Alex, Bob and Carl will soon participate in a team chess tournament.
Read more →Berland Football Cup starts really soon! Commentators from all over the world come to the event.
Read more →Mister B once received a gift: it was a book about aliens, which he started read immediately. This book had c pages.
Read more →Allen has a LOT of money. He has n dollars in the bank
Read more →Recently, he found a machine that can clone plush toys
Read more →A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana.
Read more →Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters
Read more →Sasha is a very happy guy, that's why he is always on the move. There are n cities in the country where Sasha lives
Read more →Old timers of Summer Informatics School can remember previous camps in which each student was given a drink
Read more →There are literally dozens of snooker competitions held each year, and team Jinotega
Read more →For simplicity, we'll assume that there are only three types of grapes: green grapes, purple grapes and black grapes.
Read more →You have n coins, each of the same value of 1.
Read more →QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth.
Read more →You are given a chessboard of size n×n It is filled with numbers from 1 to n2
Read more →Little Petya loves presents. His mum bought him two strings of the same size for his birthday
Read more →Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them.
Read more →There was an electronic store heist last night.
Read more →The prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of the prisoners to a prison.
Read more →Petya is a big fan of mathematics, especially its part related to fractions.
Read more →Alice and Bob are decorating a Christmas Tree.
Read more →You are given q queries in the following form:
Read more →In the beginning of the new year Keivan decided to reverse his name. He doesn't like palindromes, so he changed Naviek to Navick.
Read more →Vasya goes to visit his classmate Petya. Vasya knows that Petya's apartment number is n .
Read more →A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream
Read more →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
Read more →Tokitsukaze is one of the characters in the game "Kantai Collection". In this game, every character has a common attribute
Read more →Elections are taking place in Berland. There are n candidates participating in the elections, numbered from 1 to n
Read more →Imp is watching a documentary about cave painting.
Read more →Bomboslav likes to look out of the window in his room and watch lads outside playing famous shell game.
Read more →It seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis
Read more →During the break the schoolchildren, boys and girls, formed a queue of n people in the canteen.
Read more →As you may know, MemSQL has American offices in both San Francisco and Seattle
Read more →Sherlock is currently trying to catch a serial killer who kills a person each day.
Read more →Polycarp wants to cook a soup. To do it, he needs to buy exactly n liters of water.
Read more →After winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made of n horizontal and m vertical.
Read more →You are given a string s consisting of n lowercase Latin letters. You have to type this string using your keyboard.
Read more →Kirill plays a new computer game. He came to the potion store where he can buy any potion. Each potion is characterized by two integers
Read more →Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to form a non-degenerate triangle.
Read more →Valera had two bags of potatoes, the first of these bags contains x (x ≥ 1) potatoes.
Read more →While sailing on a boat, Inessa noticed a beautiful water lily flower above the lake's surface
Read more →One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests.
Read more →The given points are vertices of a plot of a piecewise function. The j-th piece of the function is the segment PjPj+1
Read more →Little C loves number «3» very much. He loves all things about it.
Read more →In distant future on Earth day lasts for n hours and that's why there are n timezones
Read more →k people want to split n candies between them. Each candy should be given to exactly one of them or be thrown away.
Read more →A frog is currently at the point 0 on a coordinate axis Ox It jumps by the following algorithm
Read more →Little girl Tanya is learning how to decrease a number by one
Read more →Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength.
Read more →Another Codeforces Round has just finished! It has gathered n participants, and according to the results
Read more →Young Timofey has a birthday today! He got kit of n cubes as a birthday present from his parents
Read more →Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible
Read more →You are policeman and you are playing a game with Slavik. The game is turn-based and each turn consists of two phases
Read more →Recently Luba learned about a special kind of numbers that she calls beautiful numbers.
Read more →Okabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees.
Read more →Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinist.
Read more →«Polygon» is a system which allows to create programming tasks in a simple and professional way.
Read more →Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.
Read more →Bran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies
Read more →Young Timofey has a birthday today! He got kit of n cubes as a birthday present from his parents.
Read more →Katie, Kuro and Shiro are best friends. They have known each other since kindergarten
Read more →Polycarp has n coins, the value of coin is Polycarp wants to distribute all the coins between his pockets
Read more →There is a beautiful garden of stones in Innopolis.
Read more →After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists
Read more →You are given a range of positive integers from l to r
Read more →CodeChef recently revamped its practice page to make it easier for users to identify the next problems they should solve by introducing some new features.
Read more →Mahmoud wants to send a message to his friend Ehab.
Read more →Each student eagerly awaits the day he would pass the exams successfully
Read more →There are five people playing a game called "Generosity
Read more →Berland shop sells n kinds of juices. Each juice has its price ci
Read more →Each evening after the dinner the SIS's students gather together to play the game of Sport Mafia.
Read more →You are given n chips on a number line. The i-th chip is placed at the integer coordinate
Read more →Imp is in a magic forest, where xorangles grow (wut?)
Read more →Mikhail walks on a 2D plane. He can go either up or right. You are given a sequence of Mikhail's moves. He thinks that this sequence is too long and he wants.
Read more →There are n houses in a row. They are numbered from 1 to n in order from left to right. Initially you are in the house 1
Read more →Aki is fond of numbers, especially those with trailing zeros
Read more →Where do odds begin, and where do they end? Where does hope emerge, and will they ever break?
Read more →There is a game called "Unique Bid Auction". You can read more about it here
Read more →In the city of Saint Petersburg, a day lasts for 21 minutes. From the main station of Saint Petersburg
Read more →As you could know there are no male planes nor female planes. However
Read more →There are n boxes with different quantities of candies in each of them. The i-th box has ai candies inside.
Read more →Lunar New Year is approaching, and Bob is struggling with his homework – a number division problem.
Read more →There are n stones on the table in a row, each of them can be red, green or blue
Read more →JATC and his friend Giraffe are currently in their room, solving some problems.
Read more →A new e-mail service "Berlandesk" is going to be opened in Berland in the near future
Read more →In Berland, there are two types of coins, having denominations of 2and k burles
Read more →Mahmoud and Ehab play a game called the even-odd game. Ehab chooses his favorite integer n and then they take turns
Read more →There are n benches in the Berland Central park. It is known that a people are currently sitting on the bench
Read more →You are given an array a consisting of n integer numbers.
Read more →Three friends gathered to play a few games of chess together
Read more →Mishka got an integer array a of length n as a birthday present (what a surprise!).
Read more →You are given n sticks with positive integral length a1,a2
Read more →Katie, Kuro and Shiro are best friends. They have known each other since kindergarten
Read more →Maxim wants to buy some games at the local game shop. There are ngames in the shop, the i-th game costs ci
Read more →Polycarp has created his own training plan to prepare for the programming contests. He will train for n days, all days are numbered from 1 to n beginning
Read more →Jon fought bravely to rescue the wildlings who were attacked by the white-walkers at Hardhome. On his arrival
Read more →You are given an array a of n integers and an integer s It is guaranteed that n is odd.
Read more →Petya and Vasya decided to play a game. They have n cards (n is an even number). A single integer is written on each card.
Read more →Today's morning was exceptionally snowy. Meshanya decided to go outside and noticed a huge snowball rolling down the mountain.
Read more →Dima has a hamsters farm. Soon N hamsters will grow up on it and Dima will sell them in a city nearby.
Read more →