Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.
Given an integer , you have to find the product of two different integers such that their LCM (Least Common Multiple) is and the product is maximum possible.
The first line contains an integer (), the number of test cases.
The next lines contain an integer (), LCM of two different integers.
For each test case, print the maximum possible product of those two integers. As the result can
be very big, print the result modulo .
Input | Output |
---|---|
3 5 13 27 | 5 13 243 |
For the first test case, let two integers and . and . For the second test case, let two integers and . and . For the third test case, let two intergers and . and . Another possible pair is and . but . So, the result should be . |
45% Solution Ratio
woolgathererEarliest,
Deshi_TouristFastest, 0.0s
steinumLightest, 131 kB
mah20tShortest, 330B
Login to submit
Lets, LCM of the numbers AAA & BBB is equal to LLL and their prime factorizations are −-− A=p1a1...