{"task": {"agent_timeout": 600, "task": "376", "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]\nProblem 1: Ski Course Design [Brian Dean, 2014]\n\nFarmer John has N hills on his farm (1 <= N <= 1,000), each with an\ninteger elevation in the range 0 .. 100.  In the winter, since there is\nabundant snow on these hills, FJ routinely operates a ski training camp.\n\nUnfortunately, FJ has just found out about a new tax that will be assessed\nnext year on farms used as ski training camps.  Upon careful reading of the\nlaw, however, he discovers that the official definition of a ski camp\nrequires the difference between the highest and lowest hill on his property\nto be strictly larger than 17.  Therefore, if he shortens his tallest hills\nand adds mass to increase the height of his shorter hills, FJ can avoid\npaying the tax as long as the new difference between the highest and lowest\nhill is at most 17.  \n\nIf it costs x^2 units of money to change the height of a hill by x units,\nwhat is the minimum amount of money FJ will need to pay?  FJ is only\nwilling to change the height of each hill by an integer amount.\n\nPROBLEM NAME: skidesign\n\nINPUT FORMAT:\n\n* Line 1: The integer N.\n\n* Lines 2..1+N: Each line contains the elevation of a single hill.\n\nSAMPLE INPUT:\n\n5\n20\n4\n1\n24\n21\n\nINPUT DETAILS:\n\nFJ's farm has 5 hills, with elevations 1, 4, 20, 21, and 24.\n\nOUTPUT FORMAT:\n\n* Line 1: The minimum amount FJ needs to pay to modify the elevations\n        of his hills so the difference between largest and smallest is\n        at most 17 units.\n\nSAMPLE OUTPUT:\n\n18\n\nOUTPUT DETAILS:\n\nFJ keeps the hills of heights 4, 20, and 21 as they are.  He adds mass to the\nhill of height 1, bringing it to height 4 (cost = 3^2 = 9).  He shortens\nthe hill of height 24 to height 21, also at a cost of 3^2 = 9.\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": []}