backlog

Untitled

Apr 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #1160
  2.  
  3. def renum(a,b,c,d):
  4.   pp,qq,a,b=a*(1+.01*c),b*(1+.01*d),a*(1+.01*c),b*(1+.01*d)
  5.   ren=1
  6.   while pp<qq:
  7.     pp,qq,ren,a,b=a*(1+.01*c),b*(1+.01*d),ren+1,a*(1+.01*c),b*(1+.01*d)
  8.   return ren
  9.  
  10.  
  11.  
  12. kk=int(input())
  13. i=0
  14. a=[]
  15. while i<kk:
  16.   da=raw_input().split()
  17.   x,y,r1,r2=float(da[0]),float(da[1]),float(da[2]),float(da[3])
  18.  
  19.   num=renum(x,y,r1,r2)
  20.   a.append(num)
  21.   i+=1
  22.  
  23.  
  24. for da in a:
  25.   if int(da)<=100:
  26.     print "%d anos."%(int(da))
  27.   else:
  28.     print "Mais de 1 seculo."
  29.  
  30. """
  31. 11
  32. 100 101 10.0 0.0
  33. 100 101 10.0 9.0
  34. 654327 894521 8.4 3.2
  35. 100 1000 10.0 9.0
  36. 128 256 6.6 2.8
  37. 512 1024 3.1 2.3
  38. 2048 4096 5.5 2.7
  39. 100 200 1.0 0.0
  40. 1000 1999 1.8 1.0
  41. 100 200 10.0 0.0
  42. 666 6660 10.0 0.0
  43. """
Advertisement
Add Comment
Please, Sign In to add comment