Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- junior = int(input())
- senior = int(input())
- trace = input()
- junior_sum = 0
- senior_sum = 0
- if trace == 'trail':
- junior_sum = 5.5
- senior_sum = 7
- elif trace == 'cross-country':
- junior_sum = 8
- senior_sum = 9.5
- elif trace == 'downhill':
- junior_sum = 12.25
- senior_sum = 13.75
- elif trace == 'road':
- junior_sum = 20
- senior_sum = 21.5
- total = junior * junior_sum + senior * senior_sum
- if trace == 'cross-country' and (junior + senior) >= 50:
- total *= 0.75
- print(f'{total * 0.95:.2f}')
- Фундаменталс решение:
- junior = int(input())
- senior = int(input())
- trace = input()
- total = sum({'trail': {junior * 5.5, senior * 7},
- 'cross-country': {junior * 8, senior * 9.5},
- 'downhill': {junior * 12.25, senior * 13.75},
- 'road': {junior * 20, senior * 21.5}}[trace])
- if trace == 'cross-country' and (junior + senior) >= 50:
- total *= 0.75
- print(f'{total * 0.95:.2f}')
Add Comment
Please, Sign In to add comment