Packmen

2020 VietMX 0

A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty. Packman can move […]

University Classes

2020 VietMX 0

There are n student groups at the university. During the study day, each group can take no more than 7 classes. Seven time slots numbered from 1 to 7 are allocated for the […]

Weather Tomorrow

2020 VietMX 0

Vasya came up with his own weather forecasting method. He knows the information about the average air temperature for each of the last n days. Assume that […]

Preparing for Merge Sort

2020 VietMX 0

Ivan has an array consisting of n different integers. He decided to reorder all elements in increasing order. Ivan loves merge sort so he decided to represent […]

Load Testing

2020 VietMX 0

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 […]

Sum of Nestings

2020 VietMX 0

Recall that the bracket sequence is considered regular if it is possible to insert symbols ‘+’ and ‘1’ into it so that the result is […]

Noise Level

2020 VietMX 0

The Berland’s capital has the form of a rectangle with sizes n × m quarters. All quarters are divided into three types: regular (labeled with the character ‘.’) — […]

Berland Elections

2020 VietMX 0

The elections to Berland parliament are happening today. Voting is in full swing! Totally there are n candidates, they are numbered from 1 to n. Based on election results k (1 ≤ k ≤ n) top […]

Berland SU Computer Network

2020 VietMX 0

In the computer network of the Berland State University there are n routers numbered from 1 to n. Some pairs of routers are connected by patch cords. Information can be […]

Travel Cards

2020 VietMX 0

In the evening Polycarp decided to analyze his today’s travel expenses on public transport. The bus system in the capital of Berland is arranged in […]

Students Initiation

2020 VietMX 0

Soon the first year students will be initiated into students at the University of Berland. The organizers of the initiation come up with a program […]

Tom Riddle’s Diary

2020 VietMX 0

Harry Potter is on a mission to destroy You-Know-Who’s Horcruxes. The first Horcrux that he encountered in the Chamber of Secrets is Tom Riddle’s diary. […]

Marvolo Gaunt’s Ring

2020 VietMX 0

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 […]

Helga Hufflepuff’s Cup

2020 VietMX 18

Harry, Ron and Hermione have figured out that Helga Hufflepuff’s cup is a horcrux. Through her encounter with Bellatrix Lestrange, Hermione came to know that […]

Nagini

2020 VietMX 0

Nagini, being a horcrux You-know-who created with the murder of Bertha Jorkins, has accumulated its army of snakes and is launching an attack on Hogwarts […]

Desk Disorder

2020 VietMX 1

A new set of desks just arrived, and it’s about time! Things were getting quite cramped in the office. You’ve been put in charge of […]

Save the problem

2020 VietMX 0

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 […]