Sum of GCD and LCM

The greatest common divisor (GCD) of two integers, is the largest integer that divides both of the integers. For example : GCD (2, 4) = 2.The least common multiple (LCM) of two integers, is the smallest positive integer that is divisible by both of the integers. For example :LCM (2, 4) = 4.


This is a companion discussion topic for the original entry at https://toph.co/p/sum-of-gcd-and-lcm

Please update constraints format,

T (1 ≤ T ≤ 105) should be => T (1 ≤ T ≤ 10^5)
N (1 ≤ N ≤ 108) should be => N (1 ≤ N ≤ 10^8)