A pair of integers (a,b) is co-prime when the greatest common divisor of a and b is 1.
Let f(x, y) denote the number of co-prime integer pairs (a, b) in the range 1<=a<=x, 1<=b<=y.
Given x and y, please calculate f(x, y).
The input file contains several test cases, each one of them in a separate line. Each test case is two integers x, y (1 <= x, y <= 1,000,000)
There will be at most 100 test cases.
For each test case, print f(x, y).
3 4 4 5 10 10
9 15 63
Migrated from old NTUJ.
No. | Testdata Range | Score |
---|