Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n=int(input())
- k=[0,0,0,0]
- a=[0,0,0,0]
- r=[0,0,0,0]
- for i in range(n):
- x,y=map(int,input().split())
- if x==0 or y==0:
- continue
- current_k = 0
- if x > 0 and y > 0:
- current_k = 0
- elif x < 0 and y > 0:
- current_k = 1
- elif x > 0 and y < 0:
- current_k = 2
- elif x < 0 and y < 0:
- current_k = 3
- k[current_k]+=1
- if a[current_k] == 0:
- a[current_k] = [x, y]
- elif abs(a[current_k][0]) < abs(x) or abs(a[current_k][1]) < abs(y):
- a[current_k] = [x, y]
- if r[current_k] == 0:
- r[current_k] = min(abs(x), abs(y))
- r[current_k] = min(abs(x), abs(y), abs(r[current_k]))
- #k[k,k,k,k]
- #a[a,a,a,a]
- #r[r,r,r,r]
- kmax=max(k)
- rmax=-1
- K,M,A,R=0
- if k.count(kmax)==1:
- z=k.index(kmax)
- print(z,kmax,a[z],r[z],sep='\n')
- else:
- for i in range(4):
- if k[i]==kmax and r[i]>rmax:
- rmax=r[i]
- K=i
- M=k[i]
- A=a[i]
- R=rmax
- print(K,M,A,R,sep='\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement