Arcade mall is a new modern mall. It has a new hammer game called "Arcade Game". In this game you're presented with a number n which is hanged on a wall on top of a long vertical tube, at the bottom of the tube there is a button that you should hit with your hammer.
When you hit the button with all your force (as you always do), a ball is pushed all over the tube and hit the number n. The number n flies in the air and it's digits fall back in any random permutation with uniform probability.
If the new number formed is less than or equal to the previous number, the game ends and you lose what ever the new number is. Otherwise (if the number is greater than the previous number), you are still in the game and you should hit the button again.
You win if the new number formed is greater than the previous number and it is equal to the greatest possible permutation number.
Can you compute the probability of winning?
The first line of the input contains the number of test cases T. Following that there are T lines represents T test cases. In each line, there is a single integer (1 ≤ n ≤ 109) the target number. The digits of n are all unique, which means that any 2 digits of n are different.
For each test case, print one line containing the answer. Print the answer rounded to exactly 9 decimal digits.
In the first test case, the answer is 0 because 952 is greater than all 2,5 and 9 permutations so you can't win, whatever you do.
In the second test case, the answer is 0.166666667 because you may win by getting number 952 with probability 1/6.
In the third test case the answer is 0.194444444 because you may win by getting number 952 in round1 with probability 1/6 or you can win by getting number 925 in round 1 and then 952 in round 2 with probability 1/6 * 1/6.
## Input
The first line of the input contains the number of test cases T. Following that there are T lines represents T test cases. In each line, there is a single integer (1 ≤ n ≤ 109) the target number. The digits of n are all unique, which means that any 2 digits of n are different.
## Output
For each test case, print one line containing the answer. Print the answer rounded to exactly 9 decimal digits.
[samples]
## Note
In the first test case, the answer is 0 because 952 is greater than all 2,5 and 9 permutations so you can't win, whatever you do.In the second test case, the answer is 0.166666667 because you may win by getting number 952 with probability 1/6. In the third test case the answer is 0.194444444 because you may win by getting number 952 in round1 with probability 1/6 or you can win by getting number 925 in round 1 and then 952 in round 2 with probability 1/6 * 1/6.
**Definitions**
Let $ n \in \mathbb{Z} $, $ 1 \leq n \leq 10^9 $, be the initial number with all distinct digits.
Let $ D $ be the multiset of digits of $ n $, and $ d = |D| $ be the number of digits.
Let $ S $ be the set of all $ d! $ distinct permutations of $ D $.
Let $ n_0 = n $ be the initial number.
Let $ n_{\text{max}} = \max(S) $ be the largest permutation (target to win).
**Constraints**
1. All digits in $ n $ are unique.
2. The game proceeds in rounds: at each round, a permutation $ p \in S $ is chosen uniformly at random.
3. The game continues only if $ p > \text{previous number} $.
4. The game ends when $ p \leq \text{previous number} $ (lose) or $ p = n_{\text{max}} $ (win).
**Objective**
Compute the probability $ P $ of eventually reaching $ n_{\text{max}} $, starting from $ n_0 $, under the rule that only strictly increasing sequences of permutations are allowed.
That is, define the set of valid increasing chains from $ n_0 $ to $ n_{\text{max}} $:
$$
\mathcal{C} = \left\{ (p_1, p_2, \dots, p_k) \mid p_i \in S,\ p_1 > n_0,\ p_2 > p_1,\ \dots,\ p_k = n_{\text{max}},\ p_i < p_{i+1} \right\}
$$
Then,
$$
P = \sum_{(p_1,\dots,p_k) \in \mathcal{C}} \prod_{i=1}^k \frac{1}{d!}
$$
where each permutation is chosen independently and uniformly from $ S $, and the chain stops at $ n_{\text{max}} $.