public class Main { public static void main(String[] args) throws Exception { long smax = 0; long ma = 0, mb = 0, mc = 0, md = 0; for (int a = 1; a <= 100; a++) { for (int b = 1; b <= 100; b++) { for (int c = 1; c <= 100; c++) { for (int d = 1; d <= 100; d++) { int x2 = a * a + b * b; int y2 = c * c + d * d; int z2 = (a - c) * (a - c) + (b - d) * (b - d); int max = Math.max(Math.max(x2, y2), z2); int min = Math.min(Math.min(x2, y2), z2); if (min + 1 == max) { int s = a * d - b * c; s = Math.abs(s) / 2; if (s > smax) { smax = s; ma = a; mb = b; mc = c; md = d; } } } } } } // System.out.println(smax); ma *= 10000000; mb *= 10000000; mc *= 10000000; md *= 10000000; long ss = ma * md - mb * mc; ss = Math.abs(ss) / 2; System.out.println("0 0"); System.out.println(ma + " " + mb); System.out.println(mc + " " + md); // System.out.println(ss); } }