AT_abc407_b [ABC407B] P(X or Y)
Description
Two dice, each with six faces $ 1,2,3,4,5,6 $ , are rolled. Find the probability that at least one of the following two conditions holds:
- The sum of the two outcomes is at least $ X $ .
- The absolute difference of the two outcomes is at least $ Y $ .
Each face of each die is equally likely, and the two dice are independent.
Input Format
The input is given from Standard Input in the following format:
> $ X $ $ Y $
Output Format
Output the probability that the two outcomes satisfy at least one of the two conditions. Your answer is accepted if its absolute error from the true value is at most $ 10^{-9} $ .
Explanation/Hint
### Sample Explanation 1
Let $ (x,y) $ denote the event that the dice show $ x $ and $ y $ .
- The sum is at least $ 9 $ for $ (3,6),(4,5),(4,6),(5,4),(5,5),(5,6),(6,3),(6,4),(6,5),(6,6) $ .
- The difference is at least $ 3 $ for $ (1,4),(1,5),(1,6),(2,5),(2,6),(3,6),(4,1),(5,1),(5,2),(6,1),(6,2),(6,3) $ .
At least one of these conditions holds for the following $ 20 $ pairs: $ (1,4),(1,5),(1,6),(2,5),(2,6),(3,6),(4,1),(4,5),(4,6),(5,1),(5,2),(5,4),(5,5),(5,6),(6,1),(6,2),(6,3),(6,4),(6,5),(6,6) $ .
Thus, the answer is $ \dfrac{20}{36}=\dfrac59=0.5555555555\ldots $ .
Because an absolute error of at most $ 10^{-9} $ is allowed, outputs such as `0.5555555565` or `0.55555555456789` are accepted.
### Sample Explanation 2
Neither the sum of two dice can be $ 13 $ or greater, nor can their difference be $ 6 $ or greater.
Thus, the answer is $ 0 $ .
### Constraints
- $ 2 \le X \le 13 $
- $ 0 \le Y \le 6 $
- All input values are integers.