There is a stack of water glasses in a form of pascal triangle and a person wants to pour the water at the topmost glass, but the capacity of each glass is 1 unit. Overflow takes place in such a way that after 1 unit, 1/2 of remaining unit gets into bottom left glass and other half in bottom right glass.Now the pours K units of water in the topmost glass and wants to know how much water is there in the jth glass of the ith row.

Note: Assume that there are enough glasses in the triangle till no glass overflows.

**Input: **

First line of the input contains an integer **T** denoting the number of test cases and each test case consists of three lines. First line contain an integer K, second line contains an integer i and third line contains an integer j.

**Output: **

Corresponding to each test case output the remaining amount of water in jth cup of the ith row correct to 6 decimal places.

**Constraints:**

1 <= T<=20

1 <= K <= 1000

1 <= i <= K

1 <= j<= K

**Example:
Input:**

1

3

2

1

**Output:**

1

Author: Yash Kodesia 1

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

preparecodinginterview_dot_com | 190 |

__murugan__ | 173 |

manvimahajan20 | 140 |

xiaoyan_yunche | 139 |

ShameekAgarwal | 116 |

preparecodinginterview_dot_com | 190 |

__murugan__ | 173 |

manvimahajan20 | 166 |

SoumyaKaushik | 146 |

arpit_anshuman | 140 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.