
Startup Funding
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 […]
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 loves playing with trees and gets especially excited when they have something to do with prime numbers. On his 20th birthday he was granted […]
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. […]
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 […]
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 […]
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, […]
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 […]
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 […]
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 […]
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 […]
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. […]
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]