{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Being inspired by the ongoing popularity of animation films, the monkeys are trying to be smarter. They have realized that the only way to get smarter is to learn mathematics. Hence, they have started to do so. With the creative brains they have, they are applying math in all aspects of life.\n\nOne of these mathematician monkeys is standing in front of a multi-storied twin tower. The twin tower is a couple of tall buildings standing parallel to each other. Each of the buildings has **n** floors. The ground floor is floor **0**, the next one is floor 1, and so on. So, there are **2n** floors in total in the twin tower. Each of these floors has fruit inside it. The monkey knows in advance the amount of time required to eat the fruit on any floor.\n\nThe monkey starts from the ground floor, climbs up toward the top of the buildings, and has to eat exactly **n** fruits. From floor **i**, he has only two ways to go up to floor **i + 1**. He can either go to the floor - **i + 1** of the same building that he is on, or to the floor **i + 1** of the other building using a spiral stair connecting the two buildings. Needless to say that he can only climb to the next floor at each step.\n\nAs he is a good climber, climbing from one floor to the next one in the same building takes almost no time, but to the other building requires some specified amount of time.\n\nNow, he wants to figure out the minimum time required to eat **n** fruits. Can you verify how good his math is?"}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 50)**, denoting the number of test cases.\n\nEach test case consists of five lines.\n\nThe first line has a single integer **n (1 \u0026le; n \u0026le; 1000)**, the number of floors in each building.\n\nThe 2\u003csup\u003end\u003c/sup\u003e line contains **n** integers separated by a single space. These integers denote the number of seconds required to eat the fruit on each floor for the first building. The time is given in ascending order of the floor i.e. the first integer is the number of seconds required to eat the fruit on the ground floor of the first building while the last integer is the time required for the fruit on the topmost floor.\n\nThe 3\u003csup\u003erd\u003c/sup\u003e line, containing **n** integers, describes the same values for the right building. Each of the above **2n** integers has a value between **1** and **100**.\n\nLine four has **n - 1** space-separated integers. These values denote the time required to jump from the left building to the right one. So, the first integer is the number of seconds to jump from the ground floor of the left building to the 1\u003csup\u003est\u003c/sup\u003e floor of the right building.\n\nFinally, the fifth line contains **n - 1** more integers giving the time required for jumping from the right building to the left one. The jumping times have values between **1** and **50**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the minimum number of seconds required to eat **n** fruits."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\n4\n5 6 8 9\n7 9 3 10\n5 2 3\n2 4 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 26\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}