{"task": {"agent_timeout": 600, "task": "735", "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]\nFarmer John has lost his prize cow Bessie, and he needs to find her!\n\nFortunately, there is only one long path running across the farm, and Farmer\nJohn knows that Bessie has to be at some location on this path.  If we think of\nthe path as a number line, then Farmer John is currently at position $x$ and\nBessie is currently at position $y$ (unknown to Farmer John).  If Farmer John\nonly knew where Bessie was located, he could walk directly to her, traveling a\ndistance of $|x - y|$.  Unfortunately, it is dark outside and Farmer John can't\nsee anything.  The only way he can find Bessie is to walk back and forth until\nhe eventually reaches her position.\n\nTrying to figure out the best strategy for walking back and forth in his search,\nFarmer John consults the computer science research literature and is\nsomewhat amused to find that this exact problem has not only been studied by\ncomputer scientists in the past, but that it is actually called the \"Lost Cow\nProblem\" (this is actually true!).\n\nThe recommended solution for Farmer John to find Bessie is to move to position\n$x+1$, then reverse direction and move to position $x-2$, then to position\n$x+4$, and so on, in a  \"zig zag\" pattern, each step moving twice as far from\nhis initial starting position as before.  As he has read during his study of algorithms\nfor solving the lost cow problem, this approach guarantees that he will at worst\ntravel 9 times the direct distance $|x-y|$ between himself and Bessie before he\nfinds her (this is also true, and the factor of 9 is actually the smallest such\nworst case guarantee any strategy can achieve).\n\nFarmer John is curious to verify this result.  Given $x$ and $y$, please compute\nthe  total distance he will travel according to the zig-zag search strategy above\nuntil he finds Bessie.\n\nINPUT FORMAT:\nThe single line of input contains two distinct space-separated integers $x$ and\n$y$.  Both are in the range $0 \\ldots 1,000$.\n\nOUTPUT FORMAT:\nPrint one line of output, containing the distance Farmer John will travel to\nreach Bessie.\n\nSAMPLE INPUT:\n3 6\nSAMPLE OUTPUT: \n9\n\n\nProblem credits: Brian Dean\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": []}