{"problem":{"name":"Highest Ratio","description":{"content":"You are given a sequence $A=(A_1,A_2,\\ldots,A_N)$ of length $N$.   For each $k=1,2,\\ldots,N$, solve the following problem: *   Find the maximum possible average value of the $k$\\-th to $r$\\-th terms ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc341_g"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence $A=(A_1,A_2,\\ldots,A_N)$ of length $N$.  \nFor each $k=1,2,\\ldots,N$, solve the following problem:\n\n*   Find the maximum possible average value of the $k$\\-th to $r$\\-th terms of the sequence $A$ when choosing an integer $r$ such that $k\\leq r\\leq N$.  \n    Here, the average value of the $k$\\-th to $r$\\-th term of the sequence $A$ is defined as $\\frac{1}{r-k+1}\\displaystyle\\sum_{i=k}^r A_i$.\n\n## Constraints\n\n*   $1\\leq N\\leq 2\\times 10^5$\n*   $1\\leq A_i\\leq 10^6$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc341_g","tags":[],"sample_group":[["5\n1 1 4 5 3","2.80000000\n3.33333333\n4.50000000\n5.00000000\n3.00000000\n\nFor $k=1$, the possible choices for $r$ are $r=1,2,3,4,5$, and the average value for each of them is:\n\n*   $\\frac{1}{1}=1$\n*   $\\frac{1}{2}(1+1)=1$\n*   $\\frac{1}{3}(1+1+4)=2$\n*   $\\frac{1}{4}(1+1+4+5)=2.75$\n*   $\\frac{1}{5}(1+1+4+5+3)=2.8$\n\nThus, the maximum is achieved when $r=5$, and the answer for $k=1$ is $2.8$.  \nSimilarly, for $k=2,3,4,5$, the maximum is achieved when $r=4,4,4,5$, respectively, with the values of $\\frac{10}{3}=3.333\\ldots$, $\\frac{9}{2}=4.5$, $\\frac{5}{1}=5$, $\\frac{3}{1}=3$."],["3\n999999 1 1000000","999999.00000000\n500000.50000000\n1000000.00000000"]],"created_at":"2026-03-03 11:01:14"}}