6 points = np.array( [(float(x),float(y),float(z))
for (x,y,z)
in map(
lambda L: L.strip().split(), sys.stdin.readlines())] )
14 dists = np.zeros((N,N))
15 for (i,A)
in enumerate(points):
16 for (j,B)
in enumerate(points):
18 dists[i,j] = np.linalg.norm(A-B)
20 dists[i,j] = expected_dist;
22 print 'Distance mean:',np.mean(dists)
23 print 'Distance variance:',np.var(dists)
24 minpair = np.unravel_index(np.argmin(dists), (N,N))
25 print 'Closest pair:',minpair, np.min(dists)
26 print ' p0',points[minpair[0]]
27 print ' p1',points[minpair[1]]
28 maxpair = np.unravel_index(np.argmax(dists), (N,N))
29 print 'Furthest pair:',maxpair, np.max(dists),
'( max',20.0*np.sqrt(3.),
')' 30 print ' p0',points[maxpair[0]]
31 print ' p1',points[maxpair[1]]
unsigned map[NUM_VERTICES]