Hey everybody,

Wellcome to Codeforces Beta Round #24. I'm author to most of the problems today. Something about me: My name is Nedyalko Prisadnikov and I'm a student from Sofia University in Bulgaria. Here are some pictures of me. Many thanks to Mike Myrzayanov and to Artem Rakhov for organizing the contest, writing alternative solutions and some of the problems.

Good luck and have fun!

Wellcome to Codeforces Beta Round #24. I'm author to most of the problems today. Something about me: My name is Nedyalko Prisadnikov and I'm a student from Sofia University in Bulgaria. Here are some pictures of me. Many thanks to Mike Myrzayanov and to Artem Rakhov for organizing the contest, writing alternative solutions and some of the problems.

Good luck and have fun!

**UPD:**
/*

long long id;

int n;

scanf("%d %lld",&n, &id);

*/

and got wrong answer on test 3, but when i changed to Ms C++ with the same code, i got yes. Can anyone tell me the reason ? can not i use %lld in GNU C++ ?

x,y) with respect to (x_{0},y_{0}) is (x+ 2· (x0 -x),y+ 2· (y0 -y)), that is, (2·x_{0}-x, 2·y_{0}-y). This gives us theO(j) method of solving the problem.To speed it up notice that the first ⌊

j/n⌋ "cycles" can be processed faster with a sort of parity trick. In particular, any even number of cycles can be dismissed and the rest can be processed with the naive algorithm.