Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = int(input())
- n = int(input())
- l = int(input())
- special = int(input())
- control = int(input())
- for i in range(m, 0, -1):
- for j in range(n, 0, -1):
- for k in range(l, 0, -1):
- num = i * 100 + j * 10 + k
- if num % 3 == 0:
- special += 5
- elif num % 5 == 0:
- special -= 2
- elif num % 2 == 0:
- special *= 2
- if special >= control:
- print(f"Yes! Control number was reached! Current special number is {special}.")
- exit(0)
- print(f"No! {special} is the last reached special number.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement