Hi to everyone! I decided to create a blog with some problem which was invented by me several years ago and only simple version of it was used in municipal stage of all-russian school olympiad in Kaliningrad. I wanted to use it somewhere but now I understand that it is not possible anymore because very very similar problem with similar ideas was used in codeforcea round 858(it was f1-f2). I should have used it earlier somewhere and it is my second time that I lost my problem(first was div2 C). Now I just post it here so feel free to solve it and post your solutions. Warning: if you haven't participated in round 858 and want to do it virtually or just solve problems from there then I advice you not to read it because you may get spoilers.