Decimal Expansion
Practice
5 (1 votes)
Easy
Problem
37% Success 498 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You are given 2 integers A and B. Find whether the decimal expansion of A/B is terminating or not.

Input format 

The first line of input contains an integer T denoting the number of test cases.

Next T lines contains 2 integers A and B.

Output format

If the decimal expansion is terminating print "YES" else print "NO" in a new line.

Input Constraints

1<=T<=10

0<=A<=109

1<=B<=109

Probelm setter: Harshit Agarwala

 

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
3 votes
Tags:
ObservationBasic MathAlgorithmsBasics of Greedy AlgorithmsMath
Points:20
4 votes
Tags:
MathematicsOpenApprovedEasyMathamatics
Points:20
2 votes
Tags:
MathObservationBasic MathC++