Hero has an infinite periodic string t. You are given the string s that is the period of Hero’s string. For example, if s = “abc”,...
There is a rectangular grid of n rows of m initially-white cells each.
Arkady performed a certain number (possibly zero) of operations on it. In the...
Overlooking the captivating blend of myriads of vernal hues, Arkady the painter lays out a long, long canvas.
Arkady has a sufficiently large amount...
Let’s call a string adorable if its letters can be realigned in such a way that they form two consequent groups of equal symbols (note that different...