{"task": {"agent_timeout": 600, "task": "340", "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: Combination Lock [Brian Dean, 2013]\n\nFarmer John's cows keep escaping from his farm and causing mischief. To try\nand prevent them from leaving, he purchases a fancy combination lock to\nkeep his cows from opening the pasture gate. \n\nKnowing that his cows are quite clever, Farmer John wants to make sure they\ncannot easily open the lock by simply trying many different combinations. \nThe lock has three dials, each numbered 1..N (1 <= N <= 100), where 1 and N\nare adjacent since the dials are circular.  There are two combinations that\nopen the lock, one set by Farmer John, and also a \"master\" combination set\nby the lock maker.  The lock has a small tolerance for error, however, so\nit will open even if the numbers on the dials are each within at most 2\npositions of a valid combination.  For example, if Farmer John's\ncombination is (1,2,3) and the master combination is (4,5,6), the lock will\nopen if its dials are set to (1,N,5) (since this is close enough to Farmer\nJohn's combination) or to (2,4,8) (since this is close enough to the master\ncombination).  Note that (1,5,6) would not open the lock, since it is not\nclose enough to any one single combination.\n\nGiven Farmer John's combination and the master combination, please\ndetermine the number of distinct settings for the dials that will open the\nlock.  Order matters, so the setting (1,2,3) is distinct from (3,2,1).\n\nPROBLEM NAME: combo\n\nINPUT FORMAT:\n\n* Line 1: The integer N.\n\n* Line 2: Three space-separated integers, specifying Farmer John's\n        combination.\n\n* Line 3: Three space-separated integers, specifying the master\n        combination (possibly the same as Farmer John's combination).\n\nSAMPLE INPUT:\n\n50\n1 2 3\n5 6 7\n\nINPUT DETAILS:\n\nEach dial is numbered 1..50.  Farmer John's combination is (1,2,3), and the\nmaster combination is (5,6,7).\n\nOUTPUT FORMAT:\n\n* Line 1: The number of distinct dial settings that will open the\n        lock.\n\nSAMPLE OUTPUT:\n\n249\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": []}