{"task": {"agent_timeout": 600, "task": "864", "verifier_timeout": 7200, "instruction": "Please implement a Python 3 solution to the below problem.\nReason through the problem and:\n1. Restate the problem in plain English\n2. Conceptualize a solution first in plain English\n3. Write a pseudocode solution\n4. Save your solution as solution.py\nNo outside libraries are allowed.\n\n[BEGIN PROBLEM]\nIn order to save money for a new stall in her barn, Bessie the cow \nhas started performing in the local circus, demonstrating her remarkable\nsense of balance as she carefully walks back and forth on an elevated\nbalance beam!  \n\nThe amount of money Bessie earns in her performance is\nrelated to where she manages to ultimately jump off the beam.  \nThe beam has positions labeled $0, 1, \\ldots, N+1$ from left to right.  \nIf Bessie ever reaches $0$ or $N+1$ she falls off one of the ends\nof the beam and sadly gets no payment.  \n\nIf Bessie is at a given position $k$, she can do either of the following: \n\n1. Flip a coin.  If she sees tails, she goes to position $k-1$, and if she\nsees heads, she goes to position $k + 1$ (i.e. $\\frac{1}{2}$ probability of either occurrence).\n\n2. Jump off the beam and receive payment of $f(k)$ $(0 \\leq f(k) \\leq 10^9)$.\n\nBessie realizes that she may not be able to guarantee any particular \npayment outcome, since her movement is governed by random coin flips. \nHowever, based on the location where she starts, she wants to determine what her \nexpected payment will be if she makes an optimal sequence of decisions (\"optimal\"\nmeaning that the decisions lead to the highest possible expected payment).\nFor example, if her strategy earns her payment of $10$ with probability $1/2$, \n$8$ with probability $1/4$, or $0$ with probability $1/4$, then her expected \npayment will be the weighted average $10(1/2) + 8(1/4) + 0(1/4) = 7$.\n\nINPUT FORMAT:\nThe first line of input contains $N$ ($2 \\leq N \\leq 10^5$).  Each of the\nremaining $N$ lines contain $f(1) \\ldots f(N)$.\n\nOUTPUT FORMAT:\nOutput $N$ lines.  On line $i$, print out $10^5$ times the expected value of\npayment if Bessie starts at position $i$ and plays optimally, rounded down to\nthe nearest integer.\n\nSAMPLE INPUT:\n2\n1\n3\nSAMPLE OUTPUT: \n150000\n300000\n\n\nProblem credits: Franklyn Wang and Spencer Compton\n\n[END PROBLEM]\n", "memory": "2048m", "runnable": false, "difficulty": "medium", "language": "", "cpus": 1, "instruction_truncated": false, "category": "python_programming", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "usaco", "tags": ["python", "programming", "usaco"]}, "runs": []}