
Number Transformation
Little Petya likes positive integers a lot. Recently his mom has presented him a positive integer a. There’s only one thing Petya likes more than numbers: […]
Little Petya likes positive integers a lot. Recently his mom has presented him a positive integer a. There’s only one thing Petya likes more than numbers: […]
Vasya has got two number: a and b. However, Vasya finds number a too short. So he decided to repeat the operation of lengthening number a n times. One operation of lengthening a […]
A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and characters […]
Little Vasya had n boxes with balls in the room. The boxes stood in a row and were numbered with numbers from 1 to n from left to right. […]
A country called Flatland is an infinite two-dimensional plane. Flatland has n cities, each of them is a point on the plane. Flatland is ruled by king […]
The board has got a painted tree graph, consisting of n nodes. Let us remind you that a non-directed graph is called a tree if it is […]
Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an […]
Emuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essence of the trick is in packing the […]
Emuskald is an avid horticulturist and owns the world’s longest greenhouse — it is effectively infinite in length. Over the years Emuskald has cultivated n plants in […]
Emuskald was hired to design an artificial waterfall according to the latest trends in landscape architecture. A modern artificial waterfall consists of multiple horizontal panels […]
Dima’s got a staircase that consists of n stairs. The first stair is at height a 1, the second one is at a 2, the last one is at a n (1 ≤ a 1 ≤ a 2 ≤ … ≤ a n). Dima decided […]
Little Dima has two sequences of points with integer coordinates: sequence (a 1, 1), (a 2, 2), …, (a n, n) and sequence (b 1, 1), (b 2, 2), …, (b n, n). Now Dima wants to count the number of distinct sequences of points of […]
Dima loves making pictures on a piece of squared paper. And yet more than that Dima loves the pictures that depict one of his favorite […]
Dima and Anya love playing different games. Now Dima has imagined a new game that he wants to play with Anya. Dima writes n pairs of integers […]
Dima came to the horse land. There are n horses living in the land. Each horse in the horse land has several enemies (enmity is a symmetric […]
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the […]
Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers x 1, x 2, …, x k (k > 1) is such maximum element x j, that […]
Momiji has got a rooted tree, consisting of n nodes. The tree nodes are numbered by integers from 1 to n. The root has number 1. Momiji decided to play a […]
Polycarpus is the director of a large corporation. There are n secretaries working for the corporation, each of them corresponds via the famous Spyke VoIP system during […]
The problem describes the properties of a command line. The description somehow resembles the one you usually see in real operating systems. However, there are […]