{"task": {"agent_timeout": 600, "task": "89", "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 2: Cow Lineup [Brian Dean]\n\nFarmer John has hired a professional photographer to take a picture of some\nof his cows.  Since FJ's cows represent a variety of different breeds, he\nwould like the photo to contain at least one cow from each distinct breed\npresent in his herd.\n\nFJ's N cows are all standing at various positions along a line, each\ndescribed by an integer position (i.e., its x coordinate) as well as an\ninteger breed ID.  FJ plans to take a photograph of a contiguous range of\ncows along the line.  The cost of this photograph is equal its size -- that\nis, the difference between the maximum and minimum x coordinates of the\ncows in the range of the photograph.  \n\nPlease help FJ by computing the minimum cost of a photograph in which there\nis at least one cow of each distinct breed appearing in FJ's herd.\n\nPROBLEM NAME: lineup\n\nINPUT FORMAT:\n\n* Line 1: The number of cows, N (1 <= N <= 50,000).\n\n* Lines 2..1+N: Each line contains two space-separated positive\n        integers specifying the x coordinate and breed ID of a single\n        cow.  Both numbers are at most 1 billion.\n\nSAMPLE INPUT:\n\n6\n25 7\n26 1\n15 1\n22 3\n20 1\n30 1\n\nINPUT DETAILS:\n\nThere are 6 cows, at positions 25,26,15,22,20,30, with respective breed IDs\n7,1,1,3,1,1.\n\nOUTPUT FORMAT:\n\n* Line 1: The smallest cost of a photograph containing each distinct\n        breed ID.\n\nSAMPLE OUTPUT:\n\n4\n\nOUTPUT DETAILS:\n\nThe range from x=22 up through x=26 (of total size 4) contains each of the\ndistinct breed IDs 1, 3, and 7 represented in FJ's herd.\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": []}