Attention, participants from the Division 1! As a test feature, you can participate in Codeforces Beta Round #32 **"out of competition"**.

Everybody knows, that the 2nd of October - birthday of Mohandas Gandhi. We dedicate today's round to him, and many other great people who were born on October 2 :)

Round was prepared by Mike Mirzayanov, Matov Dmitry and Max Ivanov.

Special thanks to Julia Satushina for translation of statements.

Good luck!

Artem Rakhov and Codeforces team

**UPD:**

- Problems
- Final standings
- Winner: Rei
- Solutions of participants from Division 1 will be tested later

Will all the following contests be codeforces format?

## i sacrificed my class only for codeforces contest :(

problem C's test 5 is?and the answer.thanks~

the correct one is?

printf("I64d\n",ans);

not printf("lld\n",ans);

The first time for me to participate.

I missed several previous contests since they were in the midnight.

code.replaceAll("--","2"). replaceAll("-\\.","1").replaceAll("\\.","0");

:)

Please send me a private message with your solution or some hints. Thx:)

Let's reflect man's point A along the line M1 M2; denote this point as C (we can think of it as a "fake image" of point A).

Then the segment BC intersects then M1 M2 segment exactly in the point necessary to you - it's the point where the ray from point A should reflect from the mirror to reach point B.

So, in this problem you have to know how to reflect some point from a line, to check whether the point lies on a segment M1 M2, and then check that the ray haven't intersected the wall W1 W2.

Let's reflect man's point A along the line M1 M2; denote this point as C (we can think of it as a "fake image" of point A).

Then the segment BC intersects then M1 M2 segment exactly in the point necessary to you - it's the point where the ray from point A should reflect from the mirror to reach point B.

So, in this problem you have to know how to reflect some point from a line, to check whether the point lies on a segment M1 M2, and then check that the ray haven't intersected the wall W1 W2.

input: 999463 261665 981183

answer: 9566472400

"Nothing" doesn't conform to this specification, hence PE.