#Lutece1502. Inequality

Inequality

Migrated from Lutece 1502 I

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Little Ruins is a studious boy, recently he learned inequation!

As homework, his teacher gives him a problem of inequation: give you an array a with length N1N-1, please find an array xx with length NN and xi×xi+1aix_i\times x_{i+1}\ge a_i for each ii from 11 to N1N-1 and try to minimize the sum of xx.

Input

First line contains an integer TT (1T501\le T\le 50), which indicates the number of test cases.

Every test case begins with an integers NN (1N20001\le N\le 2000), which is the length of array xx.

The second line contains N1N-1 integers a1,a2,,aN1a_1, a_2, \ldots , a_{N-1} (0<ai1040<a_i\le 10^4), indicating the array aa.

For 80%80\% of the use cases, 1N1001\le N\le 100 holds.

Output

For every test case, you should output Case #x: y, where x indicates the case number and counts from 11 and y is the result.

Round the y to the fifth digit after the decimal point.

Samples

2
4
2 3 2
4
1 2 3
Case #1: 5.77350
Case #2: 5.47723

Resources

第二届中国大学生程序设计竞赛 杭州站(CCPC 2016 Hangzhou Site)