Guest User

Sprinter

a guest
Apr 3rd, 2020
529
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. timeDistanceList = []
  3. for i in range(0,n):
  4.     timeDistanceList.append(input().split())
  5.  
  6. timeDistanceList.sort()
  7. #print(timeDistanceList)
  8.  
  9. #find fastest rate
  10. greatestRate = 0
  11. tempList = []
  12. for i in timeDistanceList:
  13.     tempList = timeDistanceList
  14.     tempList.remove(i)
  15.     for t in tempList:
  16.         changeInMeters = abs(int(i[1]) - int(t[1]))
  17.         changeInSeconds = abs(int(i[0]) - int(t[0]))
  18.         if (changeInMeters/changeInSeconds) > greatestRate:
  19.             greatestRate = (changeInMeters/changeInSeconds)
  20.  
  21. print(greatestRate)
RAW Paste Data