Calvin has a math assignment at school where he has to evaluate a lot of expressions. Calvin decides to not to waste much of his time. There are expressions overall. By looking at Susie’s answers, Calvin has figured that the answers to all questions form a non decreasing sequence.
He decides that all his answers are going to be between and (inclusive). He fills his answer sheet with a random non-decreasing sequence of length where each element is between and .
Here is the part where the real problem starts for Calvin. He does not want to choose a large value of , because, he will have a lot of options to choose from. Also, if he chooses a very small value of , a lot of answers would become equal and the teacher will become suspicious.
If , f(i) being the frequency or number of times occurs in the sequence of values he picked. Calvin wants to find out expected value of . Help him solve the problem.
For example, if & , the possible sequences are:
1 1 1 (x = 3)
1 1 2 (x = 2)
1 1 3 (x = 2)
1 2 2 (x = 2)
1 2 3 (x = 1)
1 3 3 (x = 2)
2 2 2 (x = 3)
2 2 3 (x = 2)
2 3 3 (x = 2)
3 3 3 (x = 3)
expected value of
Input Format
The first line contains an integer which refers to the number of test cases. lines follow, each containing numbers, and for the corresponding test cases.
Constraints
Output Format
Output lines, each containing answer to the corresponding test case. Error of upto is allowed.
Sample Input
4
1 5
3 3
2 9
9 6
Sample Output
1.0000000000
2.2000000000
1.2000000000
4.3146853147
Explanation
For second testcase we have