Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- n = int(input())
- metro_stations = []
- for i in range(n):
- station = tuple(map(int, input().split()))
- metro_stations.append(station)
- m = int(input())
- bus_stations = {}
- for j in range(m):
- station = tuple(map(int, input().split()))
- bus_stations[station] = bus_stations.get(station, 0) + 1
- maximum_stations_around = 0
- best_metro_station = 1
- station = 1
- R = 20
- for metro in metro_stations:
- Mx, My = metro[0], metro[1]
- counter = 0
- for X in range(-R, R + 1):
- y_range = int((R * R - X * X) ** 0.5)
- for Y in range(-y_range, y_range + 1):
- counter += bus_stations.get((X + Mx, Y + My), 0)
- if counter > maximum_stations_around:
- maximum_stations_around = counter
- best_metro_station = station
- station += 1
- print(best_metro_station)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement