Hello, codeforces!

On the 18-th of November we held the contest made by our company at the MIPT-2015 ACM ICPC Workshop. The problemsetters of the contest are: zeliboba, gchebanov, Kostroma, AlexDmitriev, yarrr, Valenkof, ArtDitel, Endagorion.

On Sunday, November, 29, at 11 a.m. MSK the unofficial translation of this contest will be held on the Yandex.Contest platform. We invite all of you to participate, being quite sure that everyone will find the problems interesting for them.

P.S. You can read more about the MIPT-2015 ACM ICPC Workshop in the Rubanenko blog.

Why not codeforces?

How to solve B, C and K?

Editorial

How to solve G?

There's one solution in editorial provided by Tima

Few hints to another solution(suppose a>0, simmetrical case is similar):

Let's find minimal x such that sin(ax)=0

Let's do it using binary search.

We need to points such points l, r such that minimal such x is between them, and between them there's exactly one such x. How do we choose l? How to find r?