{"task": {"agent_timeout": 600, "task": "1276", "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]\n\nWith the hottest recorded summer ever at Farmer John's farm, he needs a way to\ncool down his cows. Thus, he decides to invest in some air conditioners. \n\nFarmer John's $N$ cows ($1 \\leq N \\leq 20$) live in a barn that contains a \nsequence of stalls in a row, numbered $1 \\ldots 100$.  Cow $i$ occupies a range\nof  these stalls, starting from stall $s_i$ and ending with stall $t_i$.  The\nranges of stalls occupied by different cows are all disjoint from each-other. \nCows have different cooling requirements.  Cow $i$ must be cooled by an amount\n$c_i$, meaning every stall occupied by cow $i$ must have its temperature reduced\nby at least $c_i$ units.\n\nThe barn contains $M$ air conditioners, labeled $1 \\ldots M$\n($1 \\leq M \\leq 10$). The $i$th air conditioner costs $m_i$ units of money to\noperate ($1 \\leq m_i \\leq 1000$) and cools the range of stalls starting from\nstall $a_i$ and ending with stall $b_i$.  If running, the $i$th air conditioner\nreduces the temperature of all the stalls in this range by $p_i$\n($1 \\leq p_i \\leq 10^6$).  Ranges of stalls covered by air conditioners may\npotentially overlap.\n\nRunning a farm is no easy business, so FJ has a tight budget. Please determine\nthe minimum amount of money he needs to spend to keep all of his cows\ncomfortable. It is guaranteed that if FJ uses all of his conditioners, then all\ncows will be comfortable.\n\nINPUT FORMAT (input arrives from the terminal / stdin):\nThe first line of input contains $N$ and $M$.\n\nThe next $N$ lines describe cows.  The $i$th of these lines contains $s_i$,\n$t_i$, and $c_i$.\n\nThe next $M$ lines describe air conditioners.  The $i$th of these lines contains\n$a_i$, $b_i$, $p_i$, and $m_i$.\n\nFor every input other than the sample, you can assume that $M = 10$.\n\n\nOUTPUT FORMAT (print output to the terminal / stdout):\nOutput a single integer telling the minimum amount of money FJ needs to spend to\noperate enough air conditioners to satisfy all his cows (with the conditions\nlisted above). \n\n\nSAMPLE INPUT:\n2 4\n1 5 2\n7 9 3\n2 9 2 3\n1 6 2 8\n1 2 4 2\n6 9 1 5\nSAMPLE OUTPUT: \n10\n\nOne possible solution that results in the least amount of money spent is to\nselect those that cool the intervals $[2, 9]$, $[1, 2]$, and $[6, 9]$, for a\ncost of $3 + 2 + 5 = 10$.\n\n\nProblem credits: Aryansh Shrivastava and Eric Hsu\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": []}