Speed Limit

This commit is contained in:
2023-07-02 21:04:53 +02:00
parent 8cb343b26f
commit 19cb7f377d

10
speedlimit.py Normal file
View File

@@ -0,0 +1,10 @@
n = int(input())
while n > 0:
time = 0
dist = 0
for _ in range(n):
s, t = list(map(int, input().split()))
dist += s * (t - time)
time = t
print(f"{dist} miles")
n = int(input())