Skip to content

Instantly share code, notes, and snippets.

@naxmefy
Created April 22, 2021 21:53
Show Gist options
  • Save naxmefy/e73722c42b010cffbe01d086a03bf4de to your computer and use it in GitHub Desktop.
Save naxmefy/e73722c42b010cffbe01d086a03bf4de to your computer and use it in GitHub Desktop.
shortest distance of points to 0,0
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