hiho week 157 register

Ended

Participants:182

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-02 09:44:14

Lang:Python2

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding:utf8 -*-
from decimal import *
getcontext().prec = 100
def prBob(s):
    ans = []
    while s != 1.0:
        if str(s).rstrip('0')[-1] != '5':
            print 'NO'
            break
        s = (s - int(s)) * Decimal('2.0')
        ans.append(str(int(s)))
    else:
        print '0.' + "".join(ans)
T = int(raw_input())
while T > 0:
    T -= 1
    s = Decimal(raw_input())
    prBob(s)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX