题目描述
Musicians of a popular band “Flayer” have announced that they are going to “make their exit” with a world tour. Of course, they will visit Berland as well.
There are n cities in Berland. People can travel between cities using two-directional…
题目描述
Let’s denote a m-free matrix as a binary (that is, consisting of only 1’s and 0’s) matrix such that every square submatrix of size m m of this matrix contains at least one zero.
Consider the following problem:
You are given two integers n…
题目描述
You and your friend are participating in a TV show “Run For Your Prize”.
At the start of the show n prizes are located on a straight line. i-th prize is located at position ai. Positions of all prizes are distinct. You start at position 1, you…