GCD not equal LCM
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Time Limit: 1.0 s
Memory Limit: 256.0 MB
Description
We all know that,
GCD means Greatest Common Divisor. For example,
\(GCD ( 4, 10 , 12) = 2\), that means 2 is the largest possible number which divides all number appears in the set.
And, LCM means Least Common Multiple. For example,
\(LCM ( 4, 10, 12 ) = 60 \), that means 60 is the least common multiple of this set.
You are given two integers A and B. You need to find out all possible pair \((i , j)\) such that,
\(1 < = i <= A\) and \(1 < = j <= B,\)
- \(GCD ( i , j)\) ! = \(LCM ( i , j)\).
Note : ( "! = " means not equal.)
Input
First Line T, the number of test case.
In each test case, two postives integers A and B.
\(1 < = T < = 10^5\)
\(1 < = A , B < = 10^9\)
Output
In each test cases, print the total number of pair satisfy the conditions.
Sample
Input | Output |
---|---|
|
|
First test case explaination:
Only one pair satisfied this condition.
when i = 1 and j = 2,
GCD ( i, j ) = ( 1, 2 ) = 1.
LCM ( i, j ) = ( 1, 2 ) = 2.
GCD (i,j) ! = LCM ( i,j). So answer is 1.
Brain Booster #5
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 8
- Start at
- 2024-09-05 15:30
- End at
- 2024-09-05 17:45
- Duration
- 2.2 hour(s)
- Host
- Partic.
- 88