Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1160
- def renum(a,b,c,d):
- pp,qq,a,b=a*(1+.01*c),b*(1+.01*d),a*(1+.01*c),b*(1+.01*d)
- ren=1
- while pp<qq:
- pp,qq,ren,a,b=a*(1+.01*c),b*(1+.01*d),ren+1,a*(1+.01*c),b*(1+.01*d)
- return ren
- kk=int(input())
- i=0
- a=[]
- while i<kk:
- da=raw_input().split()
- x,y,r1,r2=float(da[0]),float(da[1]),float(da[2]),float(da[3])
- num=renum(x,y,r1,r2)
- a.append(num)
- i+=1
- for da in a:
- if int(da)<=100:
- print "%d anos."%(int(da))
- else:
- print "Mais de 1 seculo."
- """
- 11
- 100 101 10.0 0.0
- 100 101 10.0 9.0
- 654327 894521 8.4 3.2
- 100 1000 10.0 9.0
- 128 256 6.6 2.8
- 512 1024 3.1 2.3
- 2048 4096 5.5 2.7
- 100 200 1.0 0.0
- 1000 1999 1.8 1.0
- 100 200 10.0 0.0
- 666 6660 10.0 0.0
- """
Advertisement
Add Comment
Please, Sign In to add comment