Infinite Path

2020 VietMX 0

You are given a colored permutation $p_1, p_2, \dots, p_n$. The $i$-th element of the permutation has color $c_i$. Let’s define an infinite path as infinite sequence […]

Game with Chips

2020 VietMX 0

Petya has a rectangular Board of size $n \times m$. Initially, $k$ chips are placed on the board, $i$-th chip is located in the cell […]

Count The Blocks

2020 VietMX 1

You wrote down all integers from $0$ to $10^n – 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if […]

Princesses and Princes

2020 VietMX 96

The King of Berland Polycarp LXXXIV has $n$ daughters. To establish his power to the neighbouring kingdoms he wants to marry his daughters to the […]

AND Segments

2020 VietMX 0

You are given three integers $n$, $k$, $m$ and $m$ conditions $(l_1, r_1, x_1), (l_2, r_2, x_2), \dots, (l_m, r_m, x_m)$. Calculate the number of […]

Exercising Walk

2020 VietMX 2

Alice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat! Initially, Alice’s cat is located […]

Composite Coloring

2020 VietMX 0

A positive integer is called composite if it can be represented as a product of two positive integers, both greater than $1$. For example, the following numbers […]

K-Complete Word

2020 VietMX 0

Word $s$ of length $n$ is called $k$-complete if $s$ is a palindrome, i.e. $s_i=s_{n+1-i}$ for all $1 \le i \le n$; $s$ has a […]

Walk on Matrix

2020 VietMX 0

Bob is playing a game named “Walk on Matrix”. In this game, player is given an $n \times m$ matrix $A=(a_{i,j})$, i.e. the element in […]

Independent Set

2020 VietMX 0

Eric is the teacher of graph theory class. Today, Eric teaches independent set and edge-induced subgraph. Given a graph $G=(V,E)$, an independent set is a subset of […]

Height All the Same

2020 VietMX 0

Alice has got addicted to a game called Sirtet recently. In Sirtet, player is given an $n \times m$ grid. Initially $a_{i,j}$ cubes are stacked […]

Little Artem

2020 VietMX 0

Young boy Artem tries to paint a picture, and he asks his mother Medina to help him. Medina is very busy, that’s why she asked […]

Kind Anton

2020 VietMX 1

Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem: There are two arrays […]

Eugene and an array

2020 VietMX 0

Eugene likes working with arrays. And today he needs your help in solving one challenging task. An array $c$ is a subarray of an array […]

Kate and imperfection

2020 VietMX 0

Kate has a set $S$ of $n$ integers $\{1, \dots, n\} $. She thinks that imperfection of a subset $M \subseteq S$ is equal to the maximum of $gcd(a, […]

Road to 1600

2020 VietMX 0

Egor wants to achieve a rating of 1600 points on the well-known chess portal ChessForces and he needs your help! Before you start solving the […]

Level Statistics

2020 VietMX 0

Polycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all over the […]

Middle Class

2020 VietMX 93

Many years ago Berland was a small country where only $n$ people lived. Each person had some savings: the $i$-th one had $a_i$ burles. The […]