By RAD, 11 years ago, translation, Hi everybody

Today the author of the majority of problems is Dmitry Zhukov, many thanks to him for this.
Also I want to thank Mike Mirzayanov for choosing problems for the contest and organizing it and Julia Satushina for the translation of the statements.

Good luck!

UPD: Announcement of Codeforces Beta Round #23  Comments (27)
 registrations closed!! nice! bye... next time!
 Can somebody explain why the answer to B is max(0, n-2)? Or suggest a reference I can read about it...
•  Find out with tests and you'll see the solution of task B.
•  You can do some simple Math proof. Prove that it's impossible to have n or n - 1 people left. With n - 2, we can single out 2 people (these 2 guys dont know each other) and put the rest into a group where each member knows each other and knows the 2 isolated guys. It's each that this arrangement satisfies the conditions of the problem.
•  My typo: " It's easy to prove that this arrangement satisfies the conditions of the problem."
•  Consider the reduction where friendships make a graph. We start by deleting all nodes of degree 0, then 1, etc.This is how you can construct a graph that has n-2 left:First, make a perfect graph of n-2 verticies. (i.e. a connected graph where each node connects to every other node). Now, make 2 more nodes, and connect them to all of the nodes of the perfect graph. Now, our two nodes have degree n-2, and our perfect graph of size n-2 has degree n-2. When we remove all nodes of degree 0 - n-2, nothing happens. When remove the nodes of degree n-2, we get rid of the 2 nodes we added, and every node in the perfect graph drops a degree to n-2, since they are gone!Since they are degree n-2, and we just considered n-2, they will all survive.So we can make n-2.
 @:Shuaib: The is a algorithm as following-First , construct a full graph .-Then  remove a random Edge from the current graph . Two vertices of this edge have a degree of n-2, and the remaining edges have a  (n-1)-degree.  So we have the answer.
•  From what I've seen in the solutions, it's enough to consider all subgroups of n contiguous boxes, wrapping around. However, I have no idea why it's correct, maybe it's related with the fact that there is always an answer.
•  If there is a pair i, j such that a[i] >= a[j] and o[i] >= o[j], we should choose the i-th box and not to choose the j-th box, and then we can solve the problem for (N - 1). Otherwise sort the boxes and get a < a < ... < a[2*N-1] and o > o > ... > o[2*N-1]. Choose boxes 1, 3, 5, ..., 2*N - 1.
•  how to prove this method can satisfy the condition in the problem? it's really hard for me to think such a solution....
•  When we pick numbers with odd indexes in a sorted sequence, their sum is always more than half the sum of all numbers in the sequence.Reasoning =>Lets remove A, We know thatA > A, A > A, ......, A[2*N - 1] > A[2*N - 2]We're adding the greater sides from all these inequalities soA + A + ... + A[2*N - 1] > A + A + ...... + A[2*N - 2]Adding A on the bigger side doesn't hurt :-) SoA + A + ........... + A[2*N - 1] > A + A + ......... + A[2*N - 1].Similarly we can prove the same for the sequence O as well (looking at it in reverse order).
•  nice explanation.
 sigh , I was trapped in Problem B for a long timeIt seems so hard for me!!!
 Why this code always gets "Presentation error test 1" ?Code hereI rewrote my solution from C# program, which passed all tests.
•  Потому что Input.txt и Output.txt?
•  Забыл кстати упомянуть, что задача А и нет, дело не в файлах... там же стоит #ifdef и поэтому читается и пишется в консоль.Да и вообще я этот шаблон уже использовал и сдавал на F# задачи раньше тут, а эта задача чего-то уперлась и не хочет проходить.
 In my opinion tasks weren't chosen reasonably. Only 30 people solved more than two. I think that contestants should be classified by number of problems solved rather than the time. First two tasks were ok, but it would  be better if third task was solved by 60-80 people, fourth by 15-30 and  fifth was extremely difficult. In this contest all three tasks were almost at the same level of difficulty.
•  Well , I think problems must be difficult like this. The another div 2 - contests  have  easier problems .
•  Time is limited!
 Brilliant problems. I love problem C. But couldn't anything have been done so that the solutions that choose randomly n boxes and check if they are good and repeat this until they get a solution aren't accepted?
•  Consider this data:1 01 0... (amount : n - 1)0 10 1... (amount : n)It can be calculated that the probably of get a possible answer is O(1 / sqrt(N))So the random algorithm 's expect time complexity is O(N sqrt(N))But we have the O(N logN) algorithm.We can make large data  , the random solution will get TLE.
 Problem D seems so hard for me. I just can't solve this one.can you give me some tips?