Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- twos = int(input())
- threes = int(input())
- fours = int(input())
- if 2 * (2 * twos + 3 * threes + 4 * fours) >= 7 * (twos + threes + fours):
- print(0)
- else:
- l = 0
- r = twos + threes
- while r - l > 1:
- fives = l + (r - l) // 2
- if 2 * (2 * twos + 3 * threes + 4 * fours + 5 * fives) < 7 * (twos + threes + fours + fives):
- l = fives
- else:
- r = fives
- print(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement