Hello everybody!

I hope you have finished New Year celebrations, or you are ready to make a small break to take part in the anniversary Codeforces Round #100. Round will have place January 4 at 15:00 (UTC). There will be a common contest for participants of the both divisions with the same set of 6 problems. The top 100 participants of the contest receive prize t-shirts.

Score distribution: **500-1000-1500-2000-2500-3000**

As you may have guessed, the author of the problems is me. Invaluable help in preparation (and a bit in inventing) of problems was provided by Artem Rakhov (RAD) and in translation of the problem statements into English by Maria Belova (Delinur).

Under the influence of my festive mood, the problem statements turned out to be about different characters celebrating New Year. All characters and events are fictional, please take any resemblance as completely coincidental :)

The contest is over. Codeforces team and I personally want to thank all who take part in the greatest round in Codeforces history! Much to our surprise, the 100th place was shared by two contestants: pooya_ and Timur_Sitdikov. Of course, they both will receive prize t-shirts as all others who took higher places. Prizewinners will receive special emails.

Congratulations to the winners:

1. Egor

3. tourist

4. Petr

5. RAVEman

6. e-maxx

7. hos.lyric

8. dzhulgakov

9. Coder

10. SergeyRogulenko

You are so sure. We will know it after contest.

~~two~~three accounts,winning away~~two~~three t-shirts."-piyush006

Of course, Codeforces cannot make a decision that makes everybody happy. So let's just forget the debate and enjoy the contest!

I don't think this is legal !

2500registrants!For A, I set EPSILON as 1e-10 and I keep failining. After I changed to 1e-8 I passed the pretest ...

Argh why D=

I liked the problems, but the points didn't seem right to me. E is harder than F and D is the easiest in the set.

About task E:

What to do with C(N,K)? It seems I only precomputed until N <= 5000, K <= 5000.

But you need N <= 10^6, K <= 5000. Precomputing them all shouldn't pass, while the modulo isn't always prime number.

K! forN≤ 10^{6}and K ≤ 5000. Both can be calculated with no problem.C(N,K) can be also calced becouse we need them for fixed N and small K. So we can calc them as product ofO(K) numbers, with time ofK^{2}.Which you can calculate as:

(N-K+1)*(N-K+2)*...*(N-1)*N

Maximum of K numbers will be there, and K is small.

In one place you need:

((N! / (K! * (N-K)!)) - 1) * K!

You can still transform it to neccesary form:

(N! / (N-K)!) - K!

I understood why the system test was

SO FAST!## I think, admin did the final tests just after the submission and not after the contest.

(ctrl + click to see the system test timing)(Give me plus now!)

Why did Alex. send card 1 to 2 and to 3 and not to 4?

"In other words, so that as a result of applying two Alexander's rules, each friend receives the card that is preferred for

as much as possible."himdoes the

there refer to "Alexander" or to "each friend?""him"I see nowhere in the problem description where the friends' preferences are considered. The only use of preference in the rules is "Alexander always chooses one that Alexander himself likes most."

1) Alexander receives the first card.

Rank 102...

Feel a little sad...

I would appreciate it very much if you can send one more T-shirt!

how did you guys got hint of using float instead of double ?

It is useful to remember this while doing double comparison.

I used it, too. Be careful with eps and n=1.

Please give me '+' , I don't know why my Contribution is -12 !