pevel

Untitled

Sep 22nd, 2022
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import math
  2. x = input().split()
  3. x, y, n = float(x[0]), float(x[1]), int(x[2])
  4. eps = 0.04999999999
  5.  
  6. if x <= y:
  7.     print(0)
  8.     quit()
  9.  
  10. if x != 10.0:
  11.     s = (x-0.00000001+eps) * n
  12. else:
  13.     s = x*n
  14.  
  15. y = y-0.00000001+eps
  16.  
  17. k = (s - y*n) / (y-1)
  18. k = int(k)
  19. if (s + k-1) / (n + k - 1) - y <= -0.0001:
  20.     print(k-1)
  21. elif (s + k) / (n + k) - y <= -0.0001:
  22.     print(k)
  23. elif  (s + k+1) / (n + k+1) - y <= -0.0001:
  24.     print(k+1)
  25. # WA 6
Advertisement
Add Comment
Please, Sign In to add comment