[Solution] LCM Sum (hard version) Codeforces Solution
E2. LCM Sum (hard version)
time limit per test
3.5 secondsmemory limit per test
512 megabytesinput
standard inputoutput
standard outputThis version of the problem differs from the previous one only in the constraint on
. You can make hacks only if both versions of the problem are solved.
You are given two positive integers and .
Count the number of distinct triplets of integers such that and .
👇👇👇👇👇
Here denotes the least common multiple (LCM) of integers , , and .
Input
Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The only line for each test case contains two integers and (, ).
Output
For each test case print one integer — the number of suitable triplets.
No comments:
Post a Comment