Advertisement
AlimusSifar

Circle of Boltu - Toph.co - Brute Force

Apr 30th, 2020
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. T =  int(input())
  2.  
  3. for t in range(T):
  4.     N = int(input())
  5.     cp = []
  6.     for n in range(N):
  7.         cp.append(input())
  8.  
  9.     dist = []
  10.     for i in range(N-1):
  11.         j = i+1
  12.         while j < N:
  13.             x1, y1 = map(int, cp[i].split())
  14.             x2, y2 = map(int, cp[j].split())
  15.             dist.append((x1-x2)**2 + (y1-y2)**2)
  16.             j+=1
  17.  
  18.     print('Case %i: %i' %(t+1, max(dist)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement