F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Decimal

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 1962    Accepted Submission(s): 955


Problem Description
Given a positive integer n, determine if $\frac{1}{n}$ is an infinite decimal in decimal base. If the answer is yes, print ¡°Yes¡± in a single line, or print ¡°No¡± if the answer is no.
 

Input
The first line contains one positive integer T (1 ¡Ü T ¡Ü 100), denoting the number of test cases.
For each test case:
Input a single line containing a positive integer n (1 ¡Ü n ¡Ü 100).
 

Output
Output T lines each contains a string ¡°Yes¡± or ¡°No¡±, denoting the answer to corresponding test case.
 

Sample Input
2 5 3
 

Sample Output
No Yes
 

Hint

1/5 = 0.2, which is a finite decimal.
1/3 = 0.333 ¡¤ ¡¤ ¡¤ , which is an infinite decimal.
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 11:55:00, Gzip enabled