{"problem":{"name":"Dice in Line","description":{"content":"We have $N$ dice arranged in a line from left to right. The $i$\\-th die from the left shows $p_i$ numbers from $1$ to $p_i$ with equal probability when thrown. We will choose $K$ adjacent dice, throw ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc154_d"},"statements":[{"statement_type":"Markdown","content":"We have $N$ dice arranged in a line from left to right. The $i$\\-th die from the left shows $p_i$ numbers from $1$ to $p_i$ with equal probability when thrown.\nWe will choose $K$ adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\n## Constraints\n\n*   $1 ≤ K ≤ N ≤ 200000$\n*   $1 ≤ p_i ≤ 1000$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n$p_1$ ... $p_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc154_d","tags":[],"sample_group":[["5 3\n1 2 2 4 5","7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is $7$. This is the maximum value we can achieve."],["4 1\n6 6 6 6","3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is $3.5$."],["10 4\n17 13 13 12 15 20 10 13 17 11","32.000000000000"]],"created_at":"2026-03-03 11:01:13"}}