View difference between Paste ID: gDU3E4xv and eLeNyqB1
SHOW: | | - or go back to the newest paste.
1
from math import ceil
2
count_days = int(input())
3
count_km_first_day = float(input())
4
check_count_days = count_days
5
total_km = count_km_first_day
6
total = count_km_first_day
7
while check_count_days:
8
    percent_up = int(input())
9
    percent = percent_up / 100
10
    total_km = total_km + total_km * percent
11
    total += total_km
12
    # print(total_km)
13
    # print(total)
14
15
    check_count_days -= 1
16
17-
total = round(ceil(total))
17+
#total = round(ceil(total))
18
diff = abs(total - 1000)
19-
    print(f"You've done a great job running {(total - 1000)} more kilometers!")
19+
diff_ceil = ceil(diff)
20
if total >= 1000:
21-
    print(f"Sorry Mrs. Ivanova, you need to run {(1000 - total)} more kilometers")
21+
    print(f"You've done a great job running {diff_ceil} more kilometers!")
22
elif total < 1000:
23
    print(f"Sorry Mrs. Ivanova, you need to run {diff_ceil} more kilometers")