Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- males = list(map(int, input().split()))
- females = deque(map(int, input().split()))
- matches = 0
- while males and females:
- current_male = males.pop()
- current_female = females.popleft()
- if current_male <= 0:
- females.insert(0, current_female)
- continue
- if current_female <= 0:
- males.append(current_male)
- continue
- if current_male % 25 == 0:
- males.pop()
- females.append(current_female)
- continue
- elif current_female % 25 == 0:
- females.popleft()
- males.append(current_male)
- continue
- if current_male == current_female:
- matches += 1
- elif current_male != current_female:
- males.append(current_male - 2)
- print(f"Matches: {matches}")
- if males:
- print(f"Males left: {(', '.join(map(str, reversed(males))))}")
- else:
- print(f"Males left: none")
- if females:
- print(f"Females left: {(', '.join(map(str, females)))}")
- else:
- print(f"Females left: none")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement