Startup Funding

2020 VietMX 0

An e-commerce startup pitches to the investors to get funding. They have been functional for n weeks now and also have a website! For each week they […]

Yash And Trees

2020 VietMX 0

Yash loves playing with trees and gets especially excited when they have something to do with prime numbers. On his 20th birthday he was granted […]

Fibonacci-ish II

2020 VietMX 0

Yash is finally tired of computing the length of the longest Fibonacci-ish sequence. He now plays around with more complex things such as Fibonacci-ish potentials. […]

XOR Equation

2020 VietMX 0

Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)? Input The first line of the input […]

Factory Repairs

2020 VietMX 0

A factory produces thimbles in bulk. Typically, it can produce up to a thimbles a day. However, some of the machinery is defective, so it can currently […]

Orchestra

2020 VietMX 0

Paul is at the orchestra. The string section is arranged in an r × c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes […]

Package Delivery

2020 VietMX 0

Johnny drives a truck and must deliver a package from his hometown to the district center. His hometown is located at point 0 on a number line, […]

Preorder Test

2020 VietMX 0

For his computer science class, Jacob builds a model tree with sticks and balls containing n nodes in the shape of a tree. Jacob has spent a i minutes building […]

Watchmen

2020 VietMX 0

Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a […]

Table Compression

2020 VietMX 0

Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many others. Inspired by the new knowledge, Petya is now developing […]

Image Preview

2020 VietMX 0

Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by […]

Zip-line

2020 VietMX 20

Vasya has decided to build a zip-line on trees of a nearby forest. He wants the line to be as long as possible but he […]

Clockwork Bomb

2020 VietMX 0

My name is James diGriz, I’m the most clever robber and treasure hunter in the whole galaxy. There are books written about my adventures and […]

Voting for Photos

2020 VietMX 0

After celebrating the midcourse the students of one of the faculties of the Berland State University decided to conduct a vote for the best photo. […]

Chat Order

2020 VietMX 0

Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when […]

Promocodes with Mistakes

2020 VietMX 0

During a New Year special offer the “Sudislavl Bars” offered n promo codes. Each promo code consists of exactly six digits and gives right to one free […]

Running with Obstacles

2020 VietMX 0

A sportsman starts from point x start = 0 and runs to point with coordinate x finish = m (on a straight line). Also, the sportsman can jump — to jump, he should first take […]

Parliament of Berland

2020 VietMX 0

There are n parliamentarians in Berland. They are numbered with integers from 1 to n. It happened that all parliamentarians with odd indices are Democrats and all parliamentarians with even […]

Processing Queries

2020 VietMX 0

In this problem you have to simulate the workflow of one-thread server. There are n queries to process, the i-th will be received at moment t i and needs to be […]

Hostname Aliases

2020 VietMX 0

There are some websites that are accessible through several different addresses. For example, for a long time MaiXuanViet was accessible with two hostnames maixuanviet.com and maixuanviet.vn. You are […]