W={1:1.0,2:0.85,3:0.70,4:0.55,5:0.40}
def weight(t): return W.get(t,0.5)
def weighted(r,t): return round(r*weight(t),2)
def tier_for(r,th=(90,75,60,40)):
    for i,x in enumerate(th,1):
        if r>=x: return i
    return 5
assert weight(1)==1.0 and weight(5)==0.40
assert weighted(80,3)==56.0
assert tier_for(95)==1 and tier_for(70)==3 and tier_for(35)==5
print("SELF-TEST PASS")