Welcome to

**Codeforces Beta Round #87**!The mysterious author of today's match (which turns out to be me) have prepared seven problems for you (five in each division). Since I can't spoil you any of the problems yet, for now I can safely say that I like all of today's problems. The problem statements are wonderfully crafted (and translated) with the help of both RAD and Delinur and they are now very easy to read. My hope is that you will like them as well :).

There will be .png images in some problems, so make sure your browser can support them. You may want to check if you can see the image in the Time to Raid Cowavans problem (authored by Alex_KPR).

And also a warm thanks to it4.kp for testing the problems (for the ~~fourth~~ fifth time I might add - he tested 4 of my SRMs already :) ) together with RAD, and to MikeMirzayanov and the entire Codeforces team for the great system and this opportunity! Indeed it is through this website that I receive my current internship offer :).

So from

*Kraków*I wish everyone and the Codeforces' server good luck and stay strong :).===

The match has ended! Thank you for participating - I enjoyed it :). Here's the Editorial for this match.

The top three of the Division1 solves all five problems! They are followed by al13n and kcm1700 who solved 4 problems in approximately one hour. Congratulations!

Division 1:

1. tourist

2. Petr

3. Egor

4. al13n

5. kcm1700

In division 2, we have exactly 5 persons who solved all 5 problems, the fastest solved all five problems within 1 hour 4 minutes! Congratulations!

Division 2:

1. kyrka

2. stephydx

3. Skird

4. ts10

5. heyihong

I hope I can author other set next time here. Till we meet again.

__Final rants__

If I could turn back time, I would change the following:

1) Swap problem D1-D and D1-E

2) modulo 1,000,003 becomes modulo 1,000,000,007

3) N^2 solutions means N >= 4,000

4) Time limit should be made for Java, not Python...

Lesson learned. And the N^3 solutions which pass turn out to be beautiful after I see them (all of them implements different algorithm after I read them more carefully). Not to mention there's 3 passing N^2 solutions. Okay, I'm content now :) - apologies for my rants yesterday.

=== stale rants below ===

Oh, after the coding phase, you may want to visit this post again.

Guess what? It's starting!

**Rawr**! I'm honored that it broke the maximum number of participants so far - thank you guys :).Link to standings:

Now that the match is over...

I owe division 2 apologies for making D2-D too easy. Sorry - I didn't see that coming.

Anyway, while you're busy waiting for scores to pop up in your respective division summary, here you go! Editorial for this match.

Okay, so a big apology from me for letting a N^3 solutions to pass D1-D. It didn't cross my mind that N^3 = 2000^3 would run under 2 seconds. I'll make sure not to make things like this happen again in my matches :( - 5000 here I come.

Ok, it was almost joke, never mind!:-)The only thing I did was comparing the difficulty of two problems. I didn't even read the other ones. So, this is definitely not testing :)

http://www.

~~code~~ifo~~r~~ce~~s~~.comНо вообще согласен, контест действительно хороший и интересный.

прочитал условия и решения, сильно отличаются от тех, которые были бы, если бы прочитал условия и после этого2 часа решал:)P.S. после публикации сообщения язык поменять никак?.. Жаль.Nice problems, too.

Kudos to dolphinigle and to the others problem setters!

But anyways, after I read the problem pictures didn't make much sense to me, because problem text was composed that good.

C: I misread the top-most side and the bottom-most side are connected. I thought so after seeing the figure in the examples.

...orz

didn't you mean five? Topcoder has a very big influence on dolphinigle, I guess. :)

O(N^{3}), is ok to pass as it is more complex than original (and it can pass inO(N^{2}logN) if I would use FFT to multiply polynoms) :)