"MONTY MONTY MONTY"
Practice
0 (0 votes)
Easy
Problem
92% Success 1370 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Disha Mohanty, popularly known as Monty, is fed up of her nick name. She recently changed her branch to CSE with high hopes that her new friends wouldn't know about her nickname. Unfortunately for her, word got around, and all her new classmates started calling her "Monty". In order to prove her intelligence and stop people from calling her by her nickname, she gave the people an offer they couldn't refuse. If anyone of them is able to solve the question faster than she did, they can keep calling her Monty forever, or else they would stop. Rishabh, popluarly known as Pincha, a guy who loves dark humor and is a top-notch prankster, doesn't want that to happen. Help him solve it as fast as possible.

In a class, N students have to be seated such that each row has the same number of students as the others. If at least X students are to be seated per row and at least X rows have to be there, then how many arrangements are possible?

Input format :

First line of each input contains T (number of testcases ) then T lines follows : each containing N and X separated by a space.

Output format :

Print number of possible arrangements in a new line.

Constraints :

1 <= T <= 10^5
1 <= N <= 10^6
1 <= X < N

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
79 votes
Tags:
Ad-HocBasic ProgrammingOpenApprovedEasy
Points:20
15 votes
Tags:
Ad-HocMathematicsOpenApprovedEasyMathamatics
Points:20
239 votes
Tags:
Ad-HocMathematicsOpenApprovedEasyMathamatics