Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import math
- # Auto-generated code below aims at helping you parse
- # the standard input according to the problem statement.
- d = 0
- alldefib = []
- lon = input()
- lat = input()
- n = int(input())
- for i in range(n):
- defib = input().split(';')
- alldefib.append(defib)
- for i in range(len(alldefib)):
- a = (math.sqrt(((((round(float((alldefib[i][4].replace(',','.'))), 6) * math.pi / 180) - (round(float((lon.replace(',','.'))),6) * math.pi / 180)) * math.cos(((round(float((lat.replace(',','.'))),6) * math.pi / 180) + (round(float((alldefib[i][5].replace(',','.'))),6) * math.pi / 180) / 2)))**2) + (((round(float((alldefib[i][5].replace(',','.'))),6) * math.pi / 180) - (round(float((lat.replace(',','.'))),6) * math.pi / 180))**2)) * 6371)
- if d == 0:
- d = a
- location = alldefib[i][1]
- elif a < d:
- d = a
- location = alldefib[i][1]
- # Write an answer using print
- # To debug: print("Debug messages...", file=sys.stderr, flush=True)
- print(location)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement