T-shirt buying

2020 VietMX 0

A new pack of n t-shirts came to a shop. Each of the t-shirts is characterized by three integers p i, a i and b i, where p i is the price of the i-th t-shirt, a i is front color […]

Field expansion

2020 VietMX 1

In one of the games Arkady is fond of the game process happens on a rectangular field. In the game process Arkady can buy extensions […]

Cut the pie

2020 VietMX 0

Arkady reached the n-th level in Township game, so Masha decided to bake a pie for him! Of course, the pie has a shape of convex n-gon, […]

Aquarium decoration

2020 VietMX 0

Arkady and Masha want to choose decorations for thier aquarium in Fishdom game. They have n decorations to choose from, each of them has some cost. To […]

Sorting by Subsequences

2020 VietMX 0

You are given a sequence a 1, a 2, …, a n consisting of different integers. It is required to split this sequence into the maximum number of subsequences such that after sorting integers in each of […]

Interactive LowerBound

2020 VietMX 0

This is an interactive problem. You are given a sorted in increasing order singly linked list. You should find the minimum integer in the list which is […]

Upgrading Tree

2020 VietMX 0

You are given a tree with n vertices and you are allowed to perform no more than 2n transformations on it. Transformation is defined by three vertices x, y, y‘ and consists of deleting […]

Maximum Flow

2020 VietMX 0

You are given a directed graph, consisting of n vertices and m edges. The vertices s and t are marked as source and sink correspondingly. Additionally, there are no edges ending at s and there […]

Neural Network country

2020 VietMX 0

Due to the recent popularity of the Deep learning new countries are starting to look like Neural Networks. That is, the countries are being built […]

Product transformation

2020 VietMX 0

Consider an array A with N elements, all being the same integer a. Define the product transformation as a simultaneous update A i = A i·A i + 1, that is multiplying each element to the element right […]

Casinos and travel

2020 VietMX 0

John has just bought a new car and is planning a journey around the country. Country has N cities, some of which are connected by bidirectional roads. […]

Bathroom terminal

2020 VietMX 0

Smith wakes up at the side of a dirty, disused bathroom, his ankle chained to pipes. Next to him is tape-player with a hand-written message […]

Property

2020 VietMX 0

Bill is a famous mathematician in BubbleLand. Thanks to his revolutionary math discoveries he was able to make enough money to build a beautiful house. […]

Exploration plan

2020 VietMX 0

The competitors of Bubble Cup X gathered after the competition and discussed what is the best way to get to know the host country and […]

Dating

2020 VietMX 11

This story is happening in a town named BubbleLand. There are n houses in BubbleLand. In each of these n houses lives a boy or a girl. People there […]

Digits

2020 VietMX 0

John gave Jack a very hard problem. He wrote a very big positive integer A 0 on a piece of paper. The number is less than 10200000 . In each […]

Bob and stages

2020 VietMX 0

The citizens of BubbleLand are celebrating their 10th anniversary so they decided to organize a big music festival. Bob got a task to invite N famous singers […]

To Play or not to Play

2020 VietMX 0

Vasya and Petya are playing an online game. As most online games, it has hero progress system that allows players to gain experience that make […]

Rusty String

2020 VietMX 0

Grigory loves strings. Recently he found a metal strip on a loft. The strip had length n and consisted of letters “V” and “K”. Unfortunately, rust has […]