Problem: Your 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 <image>.

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.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n = 250;
int T, A[250];
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(0);
  cin >> T;
  for (int t = 0; t < T; t++) {
    int maxi = 0, mini = INT_MAX, sum = 0, sum2 = 0, sum4 = 0;
    for (int i = 0; i < n; i++) {
      cin >> A[i];
      mini = min(mini, A[i]);
      maxi = max(maxi, A[i]);
      sum4 += A[i] * A[i] * A[i] * A[i];
      sum2 += A[i] * A[i];
    }
    double k = float(sum4) / sum2 / sum2 * n;
    k -= 3;
    cout << (k < -0.8 ? "uniform" : "poisson") << endl;
  }
}