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