B'day Boy

0

0 votes
Very-Easy
Problem

Sameer is best friend of Shyamu and today is Birthday of Sameer so Shyamu decided to distribute Candies on Behalf of Sameer .Initially Shyamu has N Candies with him but his distribution system is little awkward he gives 1 candy to 1st student , 2 candy to 2nd student , 3 candy to 3rd student........and so on .Shyamu wants to save exactly K candies for himself and wants to know at which point he has to stop distributing candies so he can save exactly K candies for himself. You have to help Shyamu in finding after how many students he has to stop distribution.

Input format:

First line of input contains an integer T denoting the number of test cases. Each test case contains two integers N (denoting the number of candies) and K (number of candies Shyamu wants for himself.).

Output Format:

For each test case, print after how many students Shyamu should stop distribution in order to get exactly K candies.If distribution is not possible then print "Impossible".

Constraints:

1 <= T <= 10

1 <= N <= 10^18

0 <= K <= 10^18

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In first case
We can get 19 candies after giving 1 candies to 1st student

In second case
It is not possible to get exactly Zero candy.

Editor Image

?