import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; import java.awt.geom.*; public class jeroen { static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); static Point2D[] pts; public static void main(String[] args) throws Exception { // Read input int n = Integer.valueOf(in.readLine()); pts = new Point2D[n]; for(int i = 0; i < n; i++) { String[] ps = in.readLine().split(" "); pts[i] = new Point2D.Double(Integer.valueOf(ps[0]), Integer.valueOf(ps[1])); } // Try all relevant angles double best = Double.MAX_VALUE / 3; for(int i = 0; i < n; i++) { for(int j = i + 1; j < n; j++) { double angle = Math.atan2(pts[i].getY() - pts[j].getY(), pts[i].getX() - pts[j].getX()); best = Math.min(best, withAngle(angle)); } } System.out.println(best); } static double withAngle(double angle) { // Precompute distances between pairs of places int n = pts.length; double[][] dist = new double[n][n]; AffineTransform rot = AffineTransform.getRotateInstance(-angle); for(int i = 0; i < n; i++) { for(int j = i + 1; j < n; j++) { // Construct the vector between the two points, rotate it with the angle, // and then the distance is dx + dy. And since everything is rotationally // symmetric we simply take the absolute values. Point2D v = new Point2D.Double(pts[i].getX() - pts[j].getX(), pts[i].getY() - pts[j].getY()); Point2D r = rot.transform(v, null); dist[i][j] = dist[j][i] = Math.abs(r.getX()) + Math.abs(r.getY()); } } // Dp state: places to visit, current place double[][] dp = new double[1<