{"task": {"agent_timeout": 600, "task": "91", "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: Above the Median [Brian Dean]\n\nFarmer John has lined up his N (1 <= N <= 100,000) cows in a row to measure\ntheir heights; cow i has height H_i (1 <= H_i <= 1,000,000,000)\nnanometers--FJ believes in precise measurements! He wants to take a picture\nof some contiguous subsequence of the cows to submit to a bovine\nphotography contest at the county fair.  \n\nThe fair has a very strange rule about all submitted photos: a photograph\nis only valid to submit if it depicts a group of cows whose median height\nis at least a certain threshold X (1 <= X <= 1,000,000,000).\n\nFor purposes of this problem, we define the median of an array A[0...K] to\nbe A[ceiling(K/2)] after A is sorted, where ceiling(K/2) gives K/2 rounded \nup to the nearest integer (or K/2 itself, it K/2 is an integer to begin\nwith). For example the median of {7, 3, 2, 6} is 6, and the median of {5,\n4, 8} is 5.\n\nPlease help FJ count the number of different contiguous subsequences of his\ncows that he could potentially submit to the photography contest.\n\nPROBLEM NAME: median\n\nINPUT FORMAT:\n\n* Line 1: Two space-separated integers: N and X.\n\n* Lines 2..N+1: Line i+1 contains the single integer H_i.\n\nSAMPLE INPUT:\n\n4 6\n10\n5\n6\n2\n\nINPUT DETAILS:\n\nFJ's four cows have heights 10, 5, 6, 2. We want to know how many\ncontiguous subsequences have median at least 6.\n\nOUTPUT FORMAT:\n\n* Line 1: The number of subsequences of FJ's cows that have median at\n        least X. Note this may not fit into a 32-bit integer.\n\nSAMPLE OUTPUT:\n\n7\n\nOUTPUT DETAILS:\n\nThere are 10 possible contiguous subsequences to consider. Of these, only 7\nhave median at least 6. They are {10}, {6}, {10, 5}, {5, 6}, {6, 2}, {10,\n5, 6}, {10, 5, 6, 2}.\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": []}