Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- targets = list(map(int, input().split(' ')))
- shot_targets = 0
- command = input()
- while command != "End":
- index = int(command)
- if 0 <= index < len(targets):
- for i in range(len(targets)):
- if targets[i] != -1 and index != i:
- if targets[i] > targets[index]:
- targets[i] -= targets[index]
- else:
- targets[i] += targets[index]
- targets[index] = -1
- shot_targets += 1
- command = input()
- print(f"Shot targets: {shot_targets} -> {' '.join(map(str, targets))}")
Add Comment
Please, Sign In to add comment