Good afternoon!

We say thanks to Marya Belova for statements translations, Artem Rakhov and Alexander Kouprin for help in contest preparation, writing alternative solutions and preparing of intricate tests.

Good luck and successful submission!

Authors of the today's contest are Evgeny Lazarev (Nizhny Novgorod STU) and me (Alexey Shmelev, Nizhny Novgorod SU)

Today you will help a boy Vasya find himself in the world of computer games.

Please note, that the round will be held in unusual format - 6 problems with costs 500, 1000, 1000, 1500, 1500 and 2000 points.

### The round duration is increased to 2 hours and 30 minutes.

We say thanks to Marya Belova for statements translations, Artem Rakhov and Alexander Kouprin for help in contest preparation, writing alternative solutions and preparing of intricate tests.

Good luck and successful submission!

**UPD: We apologize for inaccuracy in problem E and incorrect answers to several contestant clarifications.**

Good day!

The authors of today's contest are Yevgeny Lazarev (Nizhny Novgorod State Technical University) and I (Alex Shmelev, Nizhny Novgorod State University)

Today you will help the boy Basil corientirovatsya in the virtual world of computer games.

Please note that the round will take place in non-standard format - 6 objectives of 500, 1000, 1000, 1500, 1500 and 2000 points.

Due to changes in the number of task duration of a round increased to 2 hours and 30 minutes.

We are grateful to Maria Belova for translation conditions, Artem Rakhiv and Alexander Kuprin for assistance in the preparation of tasks, writing and creating alternative solutions to tricky tests.

Good luck and successful delivery of solutions!

Yes, he did.

Но вариант голосования здесь вполне уместен, поскольку действительно повлияло это на очень немногих участников.

И, в любом случае, надо бы убрать штрафы по Е, полученные до разъяснения жюри.

An alternative proposal:

First, ask coders whether they want to be rated this time.

After the voting is over, run the system test.

If a contains all primes, you can choose mode i that satisfies a[i] == 2 first, so the answer is at most 2.

But the problem is that this understanding don't match examples.

(I sent a clarification and decided to solve D first while waiting for the answer of the clarification, so I wasn't affected during the match.)

You have to find all the divisors for the numbers 2..x-1. You can safely ignore all the composite numbers, as their divisors will be already present for smaller numbers.

~~Gassa has "Accepted". It seems the test case is OK, but test #62 is difficult.~~For problem D, for the testcase:

100 0 1

Why is the answer 98 instead of 49?

Ah well, thanks for your clarifications!

i have a question , do you write any editorial for this contest or not ?

if yes it is russian or english ?

we have the formula (1+x1)*(1+x2)*(1+x3)

where xn is the cut in the xn koordinate

I iterate over all x1

and do simple calculus for for the maximum value of (1+x2)(1+x3)

f(x2)= (1+x2)(1+k-x1-x2)

f:(x2) = 1+k-x1-x2-1-x2=k-x1-2x2

maximum : (x1-k)/-2

Code in :http://www.ideone.com/yZIqi

x2=(x1-k)/-2=(k-x1)/2

x3 =k-x1-x2

They cannot become to big

x1+x2+x3=k, this property holds for all values of x1, I think.

sorry, deleted

The first line contains number

n(1 ≤n≤ 10^{5}) — number of racers. Each of the nextnlines containss_{i}anda_{i}— nick of the racer (nonempty string, which consist of no more than 20 lowercase Latin letters) and the racer's points (0 ≤a_{i}≤ 10^{6}). Racers are given in the arbitrary order.The next line contains the number

m(0 ≤m≤n). Thenmnonnegative integer numbersb_{i}follow.i-th number is equal to amount of points for thei-th awarded place (0 ≤b_{i}≤ 10^{6}).The last line contains Vasya's racer nick.

It means there should be

at least n+2 lines with Vasya's racer name after m numbers,nothing more. And the tests werecorrect! If you are changing correct test cases, then maybe you could also change tests for A, with k <= 10^6, so that my solution passes :/So considering russian statement these tests were incorect as they omitted blank line after m=0.

you are changing correct test casesand some competitors became red, for the cost of my rating. It's their lost that they didn't notice the fact, that Vasya's name doesn't have to be in a separate line. Move me to the first 100 and it will be ok...This is a cite from English statement.

I agree that there were several ill-written phrases in today statements, but this time all is correct. In English when you say: the first line contains a and the last line contains b, it generally means that this data is the only data it contains. Following your point of view we can add tons of garbage in every test for every problem because there is no phrase that we shouldn't. Can you imagine test for a+b problem: "sdfa 123414 sd fa 23". Doesn't it look unnatural?

Tunnels are undirected so (1,2) and (2,3) both are counted as tunnels from city 2.

5 13

2 3 5 7 11

I think the answer is -1, because 12 and 13 cannot be distinguished. But the answer is 5.

_{i}=2 then 12 items will be displayed on 6 pages, but 13 items will be displayed on 7 pages.4 0 2

is

1

in problem D?

1,2,3,4 are separate provinces.

if we add tunnels 1-2,2-3,3-4....then 1 and 4 will be added 1 tunnel,2 and 3 will be added 2 tunnels.no province will be added more than 2 tunnels.

Why answer is not 0?