E. Marmots (medium)
time limit per test
2 seconds
memory limit per test
256 megabytes
standard input
standard output

Good job! Now that Heidi is able to distinguish between Poisson and uniform distributions, she is in a good position to actually estimate the populations.

Can you help Heidi estimate each village's population?


Same as the easy version.


Output one line per village, in the same order as provided in the input, containing your (integer) population estimate.

Your answer is considered correct if it is an integer that falls into the interval , where P is the real population of the village, used to create the distribution (either Poisson or uniform) from which the marmots drew their answers.