Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

F. Marmots (hard)

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputYour task is the exact same as for the easy version. But this time, the marmots subtract the village's population *P* from their random number before responding to Heidi's request.

Also, there are now villages with as few as a single inhabitant, meaning that .

Can you help Heidi find out whether a village follows a Poisson or a uniform distribution?

Input

Same as for the easy and medium versions. But remember that now 1 ≤ *P* ≤ 1000 and that the marmots may provide positive as well as negative integers.

Output

Output one line per village, in the same order as provided in the input. The village's line shall state poisson if the village's distribution is of the Poisson type, and uniform if the answers came from a uniform distribution.

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/19/2018 15:20:51 (d2).

Desktop version, switch to mobile version.

User lists

Name |
---|