Ishaan is curious about numbers. He takes any 2 random numbers **A** and **B**. He wants to find out that whether A can be written as a sum of B **distinct** positive integers.Help him find out whether it is possible or not.

**Input : **

First line of input contains a single integer T denoting the number of test cases.The only line of each test case contains 2 space-separated integers A and B.

**Output : **

For each test case, print "1" if it is possible, else print "0" (without quotes "").

**Constraints :**

1 <= T <= 10^{4}

1 <= A,B <= 10^{6}

**Example :
Input : **

3

5 2

6 2

5 3

1

1

0

**Explaination :**

Case 1 :

5 can be written as a sum of 2 numbers : 1+4 or 2+3

Case 2 :

6 can be written as a sum of 2 numbers : 1+5 or 2+4

Case 3 :

5 can't be written as a sum of 3 numbers.

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.

mantan_g | 267 |

tushki | 198 |

aksht7 | 182 |

ayush1101 | 128 |

namansharmacse17 | 110 |

ARUN_PUNDIR | 730 |

manishgupta8497 | 627 |

AMAN__JAIN | 625 |

Abhimanyu_kumar | 562 |

AJ786 | 541 |

blackshadows | 5335 |

Ibrahim Nash | 5223 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4584 |

Login to report an issue on this page.