[Solution] Possible GCD CodeChef Solution | CodeChef Problem Solution 2022
Chef has two distinct positive integers and .
Chef wonders how many distinct values are possible for the expression , where can take any non-negative integer value.
Help Chef find this value.
Here, stands for Greatest Common Divisor.
Input Format
- The first line contains a single integer — the number of test cases. Then the test
Solution Click Below:- CLICK HERE
- cases follow.
- The first and only line of each test case contains two distinct space separated integers and .
Output Format
For each testcase, output the number of distinct values of the expression ,
where can take any non-negative integer value.
No comments:
Post a Comment