{"problem":{"name":"D. Marmots (easy)","description":{"content":"Heidi is a statistician to the core, and she likes to study the evolution of marmot populations in each of _V_ (1 ≤ _V_ ≤ 100) villages! So it comes that every spring, when Heidi sees the first snowdr","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF802D"},"statements":[{"statement_type":"Markdown","content":"Heidi is a statistician to the core, and she likes to study the evolution of marmot populations in each of _V_ (1 ≤ _V_ ≤ 100) villages! So it comes that every spring, when Heidi sees the first snowdrops sprout in the meadows around her barn, she impatiently dons her snowshoes and sets out to the Alps, to welcome her friends the marmots to a new season of thrilling adventures.\n\nArriving in a village, Heidi asks each and every marmot she comes across for the number of inhabitants of that village. This year, the marmots decide to play an April Fools' joke on Heidi. Instead of consistently providing the exact number of inhabitants _P_ (10 ≤ _P_ ≤ 1000) of the village, they respond with a random non-negative integer _k_, drawn from one of two types of probability distributions:\n\n*   Poisson (d'avril) distribution: the probability of getting an answer _k_ is for _k_ = 0, 1, 2, 3, ...,\n*   Uniform distribution: the probability of getting an answer _k_ is for _k_ = 0, 1, 2, ..., 2_P_.\n\nHeidi collects exactly 250 answers per village. Every village follows either the Poisson or the uniform distribution. Heidi cannot tell marmots apart, so she may query some marmots several times, and each time the marmot will answer with a new number drawn from the village's distribution.\n\nCan you help Heidi to find out whether a village follows a Poisson or a uniform distribution?\n\n## Input\n\nThe first line of input will contain the number of villages _V_ (1 ≤ _V_ ≤ 100). The following _V_ lines each describe one village. The description of each village consists of 250 space-separated integers _k_, drawn from one of the above distributions.\n\n## Output\n\nOutput 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 answer came from a uniform distribution.\n\n[samples]\n\n## Note\n\nThe full example input is visually represented below, along with the probability distribution function it was drawn from (the _y_\\-axis is labeled by its values multiplied by 250).\n\n![image](https://espresso.codeforces.com/31e6e031c88c5241f3fef39c867dc16f65314c34.png)","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Heidi 是一名彻头彻尾的统计学家，她热衷于研究每个 #cf_span[V]（#cf_span[1 ≤ V ≤ 100]）村庄中土拨鼠种群的演化！因此，每年春天，当 Heidi 在谷仓周围的草地上看到第一朵雪滴花绽放时，她都会迫不及待地穿上雪鞋，前往阿尔卑斯山，迎接她的朋友们——土拨鼠，迎接充满刺激冒险的新季节。\n\n抵达一个村庄后，Heidi 会向她遇到的每一只土拨鼠询问该村庄的居民数量。今年，土拨鼠们决定跟 Heidi 开一个愚人节玩笑。它们不再一致地提供村庄的确切居民数量 #cf_span[P]（#cf_span[10 ≤ P ≤ 1000]），而是随机给出一个非负整数 #cf_span[k]，该数从以下两种概率分布之一中抽取：\n\nHeidi 每个村庄收集恰好 250 个回答。每个村庄要么遵循泊松分布，要么遵循均匀分布。Heidi 无法区分不同的土拨鼠，因此她可能会多次询问同一只土拨鼠，而每次土拨鼠都会从村庄的分布中抽取一个新的数字作答。\n\n你能帮助 Heidi 判断一个村庄遵循的是泊松分布还是均匀分布吗？\n\n输入的第一行包含村庄的数量 #cf_span[V]（#cf_span[1 ≤ V ≤ 100]）。接下来的 #cf_span[V] 行每行描述一个村庄。每个村庄的描述由 250 个空格分隔的整数 #cf_span[k] 组成，这些整数来自上述分布之一。\n\n请为每个村庄输出一行，顺序与输入中给出的顺序一致。如果该村庄的分布是泊松型的，则输出 _poisson_；如果答案来自均匀分布，则输出 _uniform_。\n\n完整的示例输入及其所来自的概率分布函数（y 轴的值乘以 250）在下图中直观表示。\n\n## Input\n\nThe first line of input will contain the number of villages #cf_span[V] (#cf_span[1 ≤ V ≤ 100]). The following #cf_span[V] lines each describe one village. The description of each village consists of 250 space-separated integers #cf_span[k], drawn from one of the above distributions.\n\n## Output\n\nOutput 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 answer came from a uniform distribution.\n\n[samples]\n\n## Note\n\nThe full example input is visually represented below, along with the probability distribution function it was drawn from (the #cf_span[y]-axis is labeled by its values multiplied by 250).","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions:**\n\n- Let $ V \\in \\mathbb{N} $, $ 1 \\leq V \\leq 100 $, be the number of villages.\n- For each village $ i \\in \\{1, \\dots, V\\} $, we observe a sample $ S_i = \\{k_{i,1}, k_{i,2}, \\dots, k_{i,250}\\} $, where each $ k_{i,j} \\in \\mathbb{Z}_{\\geq 0} $.\n- Each sample $ S_i $ is drawn independently from one of two distributions:\n  - **Poisson distribution**: $ \\text{Poisson}(\\lambda) $, with $ \\lambda \\in \\mathbb{R}^+ $, probability mass function $ P(k) = \\frac{\\lambda^k e^{-\\lambda}}{k!} $.\n  - **Discrete uniform distribution**: $ \\text{Uniform}(a, b) $, with $ a, b \\in \\mathbb{Z} $, $ 10 \\leq a \\leq b \\leq 1000 $, probability mass function $ P(k) = \\frac{1}{b - a + 1} $ for $ k \\in \\{a, a+1, \\dots, b\\} $, and 0 otherwise.\n\n**Given:**\n\n- For each village, exactly 250 samples are collected.\n- The underlying distribution for each village is **exclusively** either Poisson or uniform.\n- The parameter $ \\lambda $ of the Poisson distribution is unknown but fixed per village.\n- The support $ [a, b] $ of the uniform distribution is unknown but fixed per village, with $ 10 \\leq a \\leq b \\leq 1000 $.\n\n**Objective:**\n\nClassify each village’s sample $ S_i $ as originating from a **Poisson** or **Uniform** distribution.\n\n**Decision Rule (Formal):**\n\nFor each sample $ S_i $:\n\n1. Compute the **sample mean** $ \\mu_i = \\frac{1}{250} \\sum_{j=1}^{250} k_{i,j} $.\n2. Compute the **sample variance** $ \\sigma_i^2 = \\frac{1}{249} \\sum_{j=1}^{250} (k_{i,j} - \\mu_i)^2 $.\n3. Compute the **ratio** $ r_i = \\frac{\\sigma_i^2}{\\mu_i} $.\n4. **Classify**:\n   - If $ r_i \\approx 1 $, classify as **Poisson** (since for Poisson, $ \\text{Var} = \\text{Mean} $).\n   - If $ r_i \\gg 1 $, classify as **Uniform** (since for uniform distribution over $ [a,b] $, $ \\text{Var} = \\frac{(b-a+1)^2 - 1}{12} \\gg \\text{Mean} \\approx \\frac{a+b}{2} $).\n\n**Output:**\n\nFor each village $ i $, output:\n\n$$\n\\begin{cases}\n\\texttt{poisson} & \\text{if } \\left| \\frac{\\sigma_i^2}{\\mu_i} - 1 \\right| < \\tau \\\\\n\\texttt{uniform} & \\text{otherwise}\n\\end{cases}\n$$\n\nwhere $ \\tau $ is a threshold (empirically chosen, e.g., $ \\tau = 0.5 $) to distinguish Poisson (variance ≈ mean) from uniform (variance >> mean).","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF802D","tags":["math"],"sample_group":[["2\n92 100 99 109 93 105 103 106 101 99 ... (input is truncated)\n28 180 147 53 84 80 180 85 8 16 ... (input is truncated)","poisson\nuniform"]],"created_at":"2026-03-03 11:00:39"}}