import math
F=19/81
def R(s,t): return 0.0 if s<=0 else round((1+F*t/s)**-1,4)
def nxt(s,t=0.9): return max(1,round(s*(t**-1-1)/F))
def upd(s,q):
    if q<3: return max(0.5,round(s*0.5,2))
    if q==3: return round(s*1.3,2)
    if q==4: return round(s*1.8,2)
    return round(s*2.5,2)
assert R(10,0)==1.0 and 0<=R(10,10)<=1 and R(10,100)<0.5
assert upd(10,5)>upd(10,3)>upd(10,1)
print("SELF-TEST PASS")