{"task": {"agent_timeout": 600, "task": "360", "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 3: Wormholes [Brian Dean, 2013]\n\nFarmer John's hobby of conducting high-energy physics experiments on\nweekends has backfired, causing N wormholes (2 <= N <= 12, N even) to\nmaterialize on his farm, each located at a distinct point on the 2D map of\nhis farm.  \n\nAccording to his calculations, Farmer John knows that his wormholes will\nform N/2 connected pairs.  For example, if wormholes A and B are connected\nas a pair, then any object entering wormhole A will exit wormhole B moving\nin the same direction, and any object entering wormhole B will similarly\nexit from wormhole A moving in the same direction.  This can have rather\nunpleasant consequences.  For example, suppose there are two paired\nwormholes A at (0,0) and B at (1,0), and that Bessie the cow starts from\nposition (1/2,0) moving in the +x direction.  Bessie will enter wormhole B,\nexit from A, then enter B again, and so on, getting trapped in an infinite\ncycle!\n\nFarmer John knows the exact location of each wormhole on his farm.  He\nknows that Bessie the cow always walks in the +x direction, although he\ndoes not remember where Bessie is currently located.  Please help Farmer\nJohn count the number of distinct pairings of the wormholes such that\nBessie could possibly get trapped in an infinite cycle if she starts from\nan unlucky position.\n\nPROBLEM NAME: wormhole\n\nINPUT FORMAT:\n\n* Line 1: The number of wormholes, N.\n\n* Lines 2..1+N: Each line contains two space-separated integers\n        describing the (x,y) coordinates of a single wormhole.  Each\n        coordinate is in the range 0..1,000,000,000.\n\nSAMPLE INPUT:\n\n4\n0 0\n1 0\n1 1\n0 1\n\nINPUT DETAILS:\n\nThere are 4 wormholes, forming the corners of a square.\n\nOUTPUT FORMAT:\n\n* Line 1: The number of distinct pairings of wormholes such that\n        Bessie could conceivably get stuck in a cycle walking from\n        some starting point in the +x direction.\n\nSAMPLE OUTPUT:\n\n2\n\nOUTPUT DETAILS:\n\nIf we number the wormholes 1..4, then by pairing 1 with 2 and 3 with 4,\nBessie can get stuck if she starts anywhere between (0,0) and (1,0) or\nbetween (0,1) and (1,1).  Similarly, with the same starting points, Bessie\ncan get stuck in a cycle if the pairings are 1-3 and 2-4.  Only the\npairings 1-4 and 2-3 allow Bessie to walk in the +x direction from any\npoint in the 2D plane with no danger of cycling.\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": []}