Description
All fractions can be converted into decimals. However, while converting 1/2 to a decimal results in a single decimal place like 0.5, converting 1/3 to a decimal requires an infinite number of decimal places like 0.3333333333333....
The former is called a finite decimal, and the latter is called an infinite decimal. Given a numerator and a denominator, write a program to determine whether converting this fraction to a decimal results in a finite decimal or an infinite decimal.
Input
First, the number of test cases T (1 <= T <= 50) is input. Then, the numerator A and denominator B are input for each test case. (1 <= A, B <= 100,000)
Output
For each test case, when converting the fraction to a decimal, output 'Limited' if it is a finite decimal and 'Unlimited' if it is an infinite decimal.
4
1 3
15 30
123 100
1050 2401
Unlimited
Limited
Limited
Unlimited