← All problemsSign in

Greatest & Least

Find the greatest common divisor (GCD) and least common multiple (LCM) of two given numbers A and B and add them. Multiply this number with the modulus of the difference between the given numbers. Input The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer A and B. Output For each test case, output the calculated integer on a new li

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start