Problem Statement Fox Ciel has a new Magical Rocket Car. Ciel wants to use the car to drive as far as possible. The Magical Rocket Car has multiple fuel tanks, each containing special magical fuel of some type. While driving, Fox Ciel will have to choose an order in which to use the fuel tanks. (Once she starts using a fuel tank, she has to continue using it until it becomes empty.) Additionally, each fuel tank can be used in one of two modes. You are given two int[]s x and y that describe the fuel tanks. For each valid i, there is one fuel tank with parameters x[i] and y[i]. The two modes for this fuel tank are: * Mode 1: The Magical Rocket Car will maintain a constant acceleration of x[i]/y[i] for y[i] seconds. * Mode 2: The Magical Rocket Car will maintain a constant acceleration of y[i]/x[i] for x[i] seconds. In both cases, the acceleration is given in meters per second squared (m/s^2). For each fuel tank, Ciel must choose one of these two modes. The car will only move while Ciel uses some fuel tank. As soon as the last fuel tank runs out, the car will use its magic to stop immediately. Compute and return the maximal distance in meters Ciel can travel in the Magical Rocket Car. Method signature: double getmax(int[] x, int[] y) Time limit (s): 2.000 Memory limit (MB): 256 Notes - Your return value must have absolute or relative error smaller than 1e-9. Constraints - x will contain between 1 and 100 integers, inclusive. - x and y will contain the same number of integers. - Each integer in x and y will be between 1 and 100, inclusive. Examples 0) {3} {3} Returns: 4.5 There is only one fuel tank. For this fuel tank both modes have the same effect: the car will accelerate at 1 m/s^2 for 3 seconds. The total distance covered during those 3 seconds will be 4.5 meters. 1) {1,2,4} {4,3,3} Returns: 48.0 One optimal solution looks as follows: Use fuel tank 1 in mode 2 to accelerate at 3/2 m/s^2 for 2 seconds. Use fuel tank 2 in mode 2 to accelerate at 3/4 m/s^2 for 4 seconds. Use fuel tank 0 in mode 1 to accelerate at 1/4 m/s^2 for 4 seconds. 2) {54,93,91,34} {48,16,4,15} Returns: 26681.0 3) {62,57,64,80,25,42,16,20,73,46,48,81,61,65,70,24,83,82,100,81,87,99,81,47,6,37} {98,35,77,88,56,69,50,88,50,89,94,1,54,41,49,27,69,81,74,8,12,53,70,47,68,94} Returns: 1667343.0 This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.