Raffles

2020 VietMX 0

Johnny is at a carnival which has n raffles. Raffle i has a prize with value p i. Each participant can put tickets in whichever raffles they choose (they may have […]

Ebony and Ivory

2020 VietMX 0

Dante is engaged in a fight with “The Savior”. Before he can fight it with his sword, he needs to break its shields. He has […]

A Trivial Problem

2020 VietMX 0

Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of […]

Spy Syndrome 2

2020 VietMX 0

After observing the results of Spy Syndrome, Yash realised the errors of his ways. He now believes that a super spy such as Siddhant can’t […]

Fibonacci-ish

2020 VietMX 0

Yash has recently learnt about the Fibonacci sequence and is very excited about it. He calls a sequence Fibonacci-ish if the sequence consists of at […]

The Chocolate Spree

2020 VietMX 0

Alice and Bob have a tree (undirected acyclic connected graph). There are a i chocolates waiting to be picked up in the i-th vertex of the tree. First, they […]

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