LCM
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

    Silly Slp knows nothing about number theory. One day he feels puzzled with the following problem.
    Give two positive integers n and c. Find a pair of positive integer (a, b), which satisfies both of a and b are no more than n and the lowest common multiple of them is c. Moreover, maximize , the product of a and b.
    Please tell Silly Slp the maximize value of . If a and b don't exist, print “-1”(without quotes).

输入描述:

    The first line contains an integer number T, the number of test cases.
     of each next T lines contains two numbers n and c().

输出描述:

For each test case print a number, the maximize value.
示例1

输入

复制
2
10 12
5 36

输出

复制
24
-1