{"task": {"agent_timeout": 600, "task": "249", "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: Route Designing [Yan Gu, 2013]\n\nAfter escaping from the farm, Bessie has decided to start a travel\nagency along the Amoozon river.  There are several tourist sites\nlocated on both sides of the river, each with an integer value\nindicating how interesting the tourist site is.\n\nTourist sites are connected by routes that cross the river (i.e.,\nthere are no routes connecting a site with a site on the same side of\nthe river).  Bessie wants to design a tour for her customers and needs\nyour help.  A tour is a sequence of tourist sites with adjacent sites\nconnected by a route. In order to best serve her customers she wants\nto find the route that maximizes the sum of the values associated with\neach visited site.\n\nHowever, Bessie may be running several of these tours at the same\ntime.  Therefore it's important that no two routes on a tour\nintersect.  Two routes (a <-> x) and (b <-> y) intersect if and only\nif (a < b and y < x) or (b < a and x < y) or (a = b and x = y).\n\nHelp Bessie find the best tour for her agency.  Bessie may start and end at\nany site on either side of the Amoozon.\n\nPROBLEM NAME: route\n\nINPUT FORMAT:\n\n* Line 1: Three space separated integers N (1 <= N <= 40,000), M (1 <=\n        M <= 40,000), and R (0 <= R <= 100,000) indicating\n        respectively the number of sites on the left side of the\n        river, the number of sites on the right side of the river, and\n        the number of routes.\n\n* Lines 2..N+1: The (i+1)th line has a single integer, L_i (0 <= L_i\n        <= 40,000), indicating the value of the ith tourist site on\n        the left side of the river.\n\n* Lines N+2..N+M+1: The (i+N+1)th line has a single integer, R_i (0 <=\n        R_i <= 40,000), indicating the value of the ith tourist site\n        on the right side of the river.\n\n* Lines N+M+2..N+M+R+1: Each line contains two space separated\n        integers I (1 <= I <= N) and J (1 <= J <= M) indicating there\n        is a bidirectional route between site I on the left side of\n        the river and site J on the right side of the river.\n\nSAMPLE INPUT:\n\n3 2 4\n1\n1\n5\n2\n2\n1 1\n2 1\n3 1\n2 2\n\nINPUT DETAILS:\n\nThere are three sites on the left side of the Amoozon with values 1,\n1, and 5.  There are two sites on the right side of the Amoozon with\nvalues 2 and 2.  There are four routes connecting sites on both sides\nof the river.\n\nOUTPUT FORMAT:\n\n* Line 1: A single integer indicating the maximum sum of values\n        attainable on a tour.\n\nSAMPLE OUTPUT:\n\n8\n\nOUTPUT DETAILS:\n\nThe optimal tour goes from site 1 on the left, site 1 on the right, and\nends at site 3 on the left.  These respectively have values 1, 2, and 5\ngiving a total value of the trip of 8.\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": []}