time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns.
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elements. Now Yaroslav is wondering if he
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has two candies,
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputn soldiers stand in a circle. For each soldier his height ai is known. A reconnaissance unit can be made of such two neighbouringsoldiers, whose
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTattah 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,
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima got into number sequences. Now he's got sequence a1, a2, ..., an, consisting of n positive integers. Also, Dima has got a function f(x), which
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputUnary is a minimalistic Brainfuck dialect in which programs are written using only one token.Brainfuck programs use 8 commands: "+", "-", "[", "]",
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day a highly important task was commissioned to Vasya — writing a program in a night. The program consists of n lines of code. Vasya is already
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya, or Mr. Vasily Petrov is a dean of a department in a local university. After the winter exams he got his hands on a group's gradebook.Overall
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble
A. Presentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided to
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus is the director of a large corporation. There are n secretaries working for the corporation, each of them corresponds via the famous
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputValeric and Valerko missed the last Euro football game, so they decided to watch the game's key moments on the Net. They want to start watching as
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has got many devices that work on electricity. He's got n supply-line filters to plug the devices, the i-th supply-line filter has ai sockets.
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got an n × m matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHaiku is a genre of Japanese traditional poetry.A haiku poem consists of 17 syllables split into three phrases, containing 5, 7 and 5 syllables