New Year and Days

2020 VietMX 0

Today is Wednesday, the third day of the week. What’s more interesting is that tomorrow is the last day of the year 2015. Limak is […]

New Year and Domino

2020 VietMX 0

They say “years are like dominoes, tumbling one after the other“. But would a year fit into a grid? I don’t think so. Limak is […]

New Year and Forgotten Tree

2020 VietMX 0

A tree is a connected undirected graph with n - 1 edges, where n denotes the number of vertices. Vertices are numbered 1 through n. Limak is a little polar bear. His bear family prepares a […]

New Year and Cake

2020 VietMX 0

Limak is a little polar bear. According to some old traditions, his bear family prepared a New Year cake. And Limak likes cakes. As you […]

Professor GukiZ’s Robot

2020 VietMX 0

Professor GukiZ makes a new robot. The robot are in the point with coordinates (x 1, y 1) and should go to the point (x 2, y 2). In a single step the robot […]

Grandfather Dovlet’s calculator

2020 VietMX 0

Once Max found an electronic calculator from his grandfather Dovlet’s chest. He noticed that the numbers were written with seven-segment indicators (https://en.wikipedia.org/wiki/Seven-segment_display). Max starts to […]

Pearls in a Row

2020 VietMX 0

There are n pearls in a row. Let’s enumerate them with integers from 1 to n from the left to the right. The pearl number i has the type a i. Let’s call a sequence […]

New Year Tree

2020 VietMX 0

The New Year holidays are over, but Resha doesn’t want to throw away the New Year tree. He invited his best friends Kerim and Gural […]

Xors on Segments

2020 VietMX 0

You are given an array with n integers a i and m queries. Each query is described by two integers (l j, r j). Let’s define the function . The function is defined for only u ≤ v. For each […]

Robot Sequence

2020 VietMX 0

Calvin the robot lies in an infinite rectangular grid. Calvin’s source code contains a list of n commands, each either ‘U’, ‘R’, ‘D’, or ‘L’ — instructions to […]

Cards

2020 VietMX 0

Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she […]

Block Towers

2020 VietMX 0

Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other. n of the […]

Jerry’s Protest

2020 VietMX 0

Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds. In each round, Andrew and Jerry draw […]

Group Projects

2020 VietMX 0

There are n students in a class working on group projects. The students will divide into groups (some students may be in groups alone), work on their […]

Simple Skewness

2020 VietMX 0

Define the simple skewness of a collection of numbers to be the collection’s mean minus its median. You are given a list of n (not necessarily distinct) integers. Find […]