Created
April 22, 2021 21:53
-
-
Save naxmefy/e73722c42b010cffbe01d086a03bf4de to your computer and use it in GitHub Desktop.
shortest distance of points to 0,0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import math | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
n = int(input()) | |
clos='' | |
mini=999999999 | |
for i in range(n): | |
x, y = [int(j) for j in input().split()] | |
dis= ((x)**2 + y*y )**0.5 | |
if dis<mini: | |
mini=dis | |
clos=x,y | |
# Write an answer using print | |
# To debug: print("Debug messages...", file=sys.stderr, flush=True) | |
print(*clos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment