Divisor Set Inclusion
Time limit1sMemory limit128 MB
Decide for each pair whether every divisor of a also divides b, which holds exactly when a divides b.
- Level
Easy3 of 10
- Topics
- Number theory
- Solved
- No attempts yet
Problem
You are given two integers and . Determine whether the set of divisors of is contained in the set of divisors of .
Input
The first line contains a single integer (), the number of data sets. Each of the next lines describes one data set and contains two integers , () separated by a space.
Output
Print lines. Each line contains the answer for one data set. If the set of divisors of is contained in the set of divisors of , print TAK; otherwise print NIE.