{"task": {"agent_timeout": 600, "task": "808", "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 preparation for the upcoming hoofball tournament, Farmer John is drilling his\n$N$ cows (conveniently numbered $1\\dots N$, where $1 \\leq N \\leq 100$) in\npassing the ball. The cows are all standing along a very long line on one side\nof the barn, with cow $i$ standing $x_i$ units away from the barn\n($1 \\leq x_i \\leq 1000$).  Each cow is standing at a distinct location.\n\nAt the beginning of the drill, Farmer John will pass several balls to different\ncows. When cow $i$ receives a ball, either from Farmer John or from another cow,\nshe will pass the ball to the cow nearest her (and if multiple cows are the same\ndistance from her, she will pass the ball to the cow farthest to the left among\nthese).  So that all cows get at least a little bit of practice passing, Farmer\nJohn wants to make sure that every cow will hold a ball at least once. Help him\nfigure out the minimum number of balls he needs to distribute initially to\nensure this can happen, assuming he hands the balls to an appropriate initial\nset of cows.\n\nINPUT FORMAT:\nThe first line of input contains $N$. The second line contains $N$\nspace-separated integers, where the $i$th integer is $x_i$.\n\nOUTPUT FORMAT:\nPlease output the minimum number of balls Farmer John must initially pass to the\ncows, so that every cow can hold a ball at least once.\n\nSAMPLE INPUT:\n5\n7 1 3 11 4\nSAMPLE OUTPUT: \n2\n\nIn the above example, Farmer John should pass a ball to the cow at $x=1$ and\npass a ball to the cow at $x=11$. The cow at $x=1$ will pass her ball to the cow\nat $x=3$, after which this ball will oscillate between the cow at $x=3$ and the\ncow at $x=4$. The cow at $x=11$ will pass her ball to the cow at $x=7$, who will\npass the ball to the cow at $x=4$, after which this ball will also cycle between\nthe cow at $x=3$ and the cow at $x=4$. In this way, all cows will be passed a\nball at least once (possibly by Farmer John, possibly by another cow).\n\nIt can be seen that there is no single cow to whom Farmer John could initially pass a ball\nso that every cow would eventually be passed a ball.\n\n\nProblem credits: Dhruv Rohatgi\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": []}