Teacher Docriz is planning to select some students in his class for a typing contest.
There are n students in the class. The i-th classmate's initial typing speed is s_i and the typing noise is f_i. However, when several students are selected to compete, their total typing speed is not the sum of everyone's initial typing speed, because the noise each person makes affects others.
Specifically, if students 1,2,3,…,k form a team, the actual typing speed of student 1 is s_1⋅(1−f_1f_2−f_1f_3−…−f_1f_k), the actual typing speed of student 2 is s_2⋅(1−f_2f_1−f_2f_3−…−f_2f_k), and so on.
Teacher Docriz wants to form a team so that the total typing speed is as large as possible. Please help him calculate the maximum typing speed he could possibly achieve.
The first line contains an integer T (1≤T≤2000), the number of test cases. Then T test cases follow.
The first line of each test case contains a single integer n (1≤n≤100), the number of students.
Then n lines follow, each line contains two numbers s_i, f_i (1≤s_i≤1012, 0≤f_i≤1), where s_i is an integer and f_i is a real number with exactly two decimal places.
It is guaranteed that ∑n≤2000.
For each test case, output a line with a single real number: the maximum typing speed that teacher Docriz can achieve. Keep your answers to exactly 9 decimal places after the decimal point.
It is guaranteed that the answer is absolutely precise when 9 decimal places are used, so only the answers that coincide with the model solution are accepted, so please ensure the accuracy of your output.