Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def w():
  2.     c = int(input())
  3.     q = int(input())
  4.     n = int(input())
  5.     v = 0
  6.     p = 0
  7.     while p < c:
  8.         p += 1
  9.         v += 1
  10.     if n - p < n // (q + 1):
  11.         while p != n:
  12.             v += 1
  13.             p += 1
  14.     else:
  15.         p -= c
  16.         while p != n:
  17.             v += 1
  18.             p = p + q + 1
  19.     print(v)
  20. w()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement