spoj#MYQ6. Serve The Street

Serve The Street


Shree is a very ambitious person and wants to start a new company "RAM COURIER SERVICE" in the country of Thuvax. He plans to open his first office in the Main Street of Thuvax to serve only the people of this street. The Main Street is an inclined road consisting of N buildings spaced out unevenly(building 1 at lowest level and building N at highest level). The distance between adjacent buildings are known to Shree.
 
The delivery costs incurred by him for various deliveries are calculated as follows:
 
To deliver a package of weight 'w' to a building downhill at a distance 'd' from the office, Shree spends w*d*1 units of money.
To deliver a package of weight 'w' to a building uphill at a distance 'd' from the office, Shree spends w*d*2 units of money.
To deliver a package of non-zero weight to his own building, Shree spends 10 units of money irrespective of the weight of the package.
 
Shree being an astute businessman wants to choose one of these buildings for his new office so that the total delivery cost incurred by him is minimum.
Help Shree choose the building for his new office.

Input

The first line of the input consists of number of test cases t(1<=t<=20)
 
The first line of each test case consists of a single number N(1<=N<=10^6) which is the number of buildings in the main street.
The next line contains N integers representing the weight to be delivered at ith (1<=i<=N) building (0<=w[i]<=100).
The last line contains N-1 integers where the ith (1<=i<=N-1) integer represents the distance between i and i+1 th building(1<=d[i]<=100).

Output

Output a single line for each test case containing two integers separated by a space.
The first integer is the minimum delivery cost and the next integer is the building number where the office should be placed in order to incur that cost.  
If more than one building has the same minimum cost, print the building labelled with the smallest number.

Example

Input:
1 
5
1 2 3 4 5
1 1 1 1

Output: 30 4

</p>