forked from Anishukla/Codechef_Hacktoberfest-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWTBTR.py
52 lines (47 loc) · 1.03 KB
/
WTBTR.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- coding: utf-8 -*-
"""
@author: anishukla
"""
""" Link to the problem:
https://www.codechef.com/MAY19B/problems/WTBTR
Link to my profile:
https://www.codechef.com/users/an1shukla """
def mod(md):
if(md<0):
md = 0 -md
else:
md = md
return md
T = int(input())
for i in range(T):
X = []
Y = []
N = int(input())
temp = 0
k = 2.e0
for i in range(N):
A = input()
A = A.split()
M = int(A[0])
O = int(A[1])
p = M+O
q = M-O
X.append(p)
Y.append(q)
lgh = len(X)
val = int(N/lgh)
if(val == 1):
for j in range(val):
temp = temp*temp
X = sorted(X)
Y = sorted(Y)
l = 2.000000
mini = mod((X[0] - X[1])/l)
mini = min(mod((Y[0] - Y[1])/l), mini)
for i in range(1, N-1):
mini = min(mod((X[i] - X[i+1])/l), mini)
mini = min(mod((Y[i] - Y[i+1])/l), mini)
temp = temp+1
if(mini == 0.000000):
break
print(mini)