Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- climbing_peak = {
- 'Vihren': 80,
- 'Kutelo': 90,
- 'Banski Suhodol': 100,
- 'Polezhan': 60,
- 'Kamenitza': 70,
- }
- conquered_peaks = {
- 'Vihren': 0,
- 'Kutelo': 0,
- 'Banski Suhodol': 0,
- 'Polezhan': 0,
- 'Kamenitza': 0,
- }
- food_supplies = deque(map(int, input().split(", ")))
- daily_stamina = deque(map(int, input().split(", ")))
- days = 1
- while food_supplies and daily_stamina and days <= 7:
- day_food = food_supplies.pop()
- day_stamina = daily_stamina.popleft()
- dayly_peak = day_food + day_stamina
- for climbing, peak in climbing_peak.items():
- if dayly_peak >= peak:
- conquered_peaks[climbing] += 1
- days += 1
- all_peaks_conquered = all(count > 0 for count in conquered_peaks.values())
- if all_peaks_conquered:
- print("Alex did it! He climbed all top five Pirin peaks in one week -> @FIVEinAWEEK")
- print("Conquered peaks:")
- print("\n".join(peak for peak, count in conquered_peaks.items() if count > 0))
- else:
- print("Alex failed! He has to organize his journey better next time -> @PIRINWINS")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement