Problem Description

学皇来到了一个餐馆吃饭。他觉得这家餐馆很好吃,于是就想办个会员。

一共有 n种会员充值卡套餐,假设学皇这餐饭的消费为 a元,选择第 i种套餐,需要充值 b[i] * a 的钱,这次吃饭可以打 c[i]×10 折,由充值的钱支付(即这次吃饭只需要从充值金额中扣除 a×c[i] 元)。以后用剩余的充值的钱吃饭不再打折。

请问学皇应该选择哪个套餐(必须选择恰好一个套餐),使得优惠的比例最大?

优惠比例的定义是把充的钱用完以后,(本来应该付的钱 - 实际付的钱) / 本来应该付的钱。在这个题目里,实际付的钱就是这次充值的花费。

Input

第一行一个整数 test(1≤test≤100) 表示数据组数。

对于每组数据,第一行一个正整数 n(1≤n≤100) 表示套餐的数目。

接下来 n行,每行一个正整数 b[i]和一个小数 c[i]。

Output

对于每组数据,输出一个五位小数表示最大的优惠比例。如果小数点后超过五位,四舍五入到五位。

Sample Input

1
2
3
4
1
2
2 0.5
3 0.1

Sample Output

1
2
3
4
5
0.23077

样例解释
对于第一种套餐,优惠比例为 0.5a / (2a + 0.5a) = 0.2;
对于第二种套餐,优惠比例为 0.9a / (3a + 0.9a) = 9 / 39;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

vector<float> compute()
{
int groupNum;
cin >> groupNum;
vector<float> output;
for (int i = 0; i < groupNum; i++)
{
float res = 0;
int choiseNum;
cin >> choiseNum;
//cout << "choiseNum:" << choiseNum << endl;
int b;
float c;
for (int j = 0; j < choiseNum; j++)
{
cin >> b;
//cout << "b:" << b << endl;
cin >> c;
//cout << "c:" << c << endl;
float temp = (1 - c) / (b + 1 - c);
res = max(res, temp);
}
output.push_back(res);
}
return output;
}

int main()
{
vector<float> res = compute();
for (int i = 0; i < res.size(); i++)
{
//cout << res[i];
printf("%.5f\n", res[i]);
}
return 0;
}