Sereja ans Anagrams

2020 VietMX 0

Sereja has two sequences a and b and number p. Sequence a consists of n integers a 1, a 2, …, a n. Similarly, sequence b consists of m integers b 1, b 2, …, b m. As usual, Sereja studies the sequences he has. Today he wants to find the number […]

Sereja and the Arrangement of Numbers

2020 VietMX 0

Let’s call an array consisting of n integer numbers a 1, a 2, …, a n, beautiful if it has the following property: consider all pairs of numbers x, y (x ≠ y), such that number x occurs in the array a and number y occurs in […]

Sereja and Algorithm

2020 VietMX 0

Sereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let’s represent the […]

Sereja and Sets

2020 VietMX 0

Sereja has m non-empty sets of integers A 1, A 2, …, A m. What a lucky coincidence! The given sets are a partition of the set of all integers from 1 to n. In […]

Sereja and Intervals

2020 VietMX 0

Sereja is interested in intervals of numbers, so he has prepared a problem about intervals for you. An interval of numbers is a pair of […]