# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

**Sanvi** is playing with a coin in which number **1** is written on the top side and number **0** is written at the bottom side. She is planning to toss the coin exactly **N** times. What is the probability that summation of coin tosses will either be **A** or **B** ? Your task is to help her find the answer.

Input starts with an integer **T (1≤T≤100000)** denoting the total number of test-cases. Every test-case starts with **N (1 ≤ N ≤ 30)**, denoting the total number of times coin is tossed. This is followed by a single line containing two different non-negative integer numbers having value at most **N**, separated by a single space, denoting **A** and **B** respectively.
( A!=B, 0<=A,B<=N )

For every case of input, output the answer in a single line denoting the answer as described in the problem statement. Error less than **10 ^{-6}** will be ignored.

Input | Output |
---|---|

2 1 0 1 2 2 1 | 1.000000 0.750000 |

81% Solution Ratio

NirjhorEarliest,

fsshakkhorFastest, 0.1s

flash_7Lightest, 1.0 MB

tuxboyShortest, 416B

Login to submit

ProgKriya July'18 Ended |