@@ -0,0 +1,920 @@
+// Try POH%0A// author: Leonardone @ NEETSDKASU%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class Main %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        Scanner in = new Scanner(System.in);%0A        %0A        int x = in.nextInt();%0A        int y = in.nextInt();%0A        int z = in.nextInt();%0A        int n = in.nextInt();%0A        %0A        int%5B%5D%5B%5D xy = new int%5B2%5D%5Bn%5D;%0A        int%5B%5D xyc = %7B0, 0%7D;%0A        %0A        int minxy%5B%5D = %7Bx, y%7D;%0A        %0A        for (int i = 0; i %3C n; i++) %7B%0A            int d = in.nextInt();%0A            int a = in.nextInt();%0A            minxy%5Bd%5D = Math.min(minxy%5Bd%5D, Math.min(a, (d == 0 ? x : y) - a));%0A            for (int j = 0; j %3C xyc%5Bd%5D; j++) %7B%0A                minxy%5Bd%5D = Math.min(minxy%5Bd%5D, Math.abs(xy%5Bd%5D%5Bj%5D - a));%0A            %7D%0A            xy%5Bd%5D%5Bxyc%5Bd%5D%5D = a;%0A            xyc%5Bd%5D++;%0A        %7D%0A        %0A        System.out.println(z * minxy%5B0%5D * minxy%5B1%5D);%0A        %0A    %7D%0A%7D%0A

Create Main.java