1.00 1.00 3.00 3.00 2.00 2.00 4.00 4.00 5.00 5.00 13.00 13.00 4.00 4.00 12.50 12.50
1.00 56.25
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input=new Scanner(System.in); while (input.hasNext()){ double x1,y1,x2,y2,x3,y3,x4,y4; x1=input.nextDouble(); y1=input.nextDouble(); x2=input.nextDouble(); y2=input.nextDouble(); x3=input.nextDouble(); y3=input.nextDouble(); x4=input.nextDouble(); y4=input.nextDouble(); double t=0; if (x1>x2){ t=x1;x1=x2;x2=t; } if (y1>y2){ t=y1;y1=y2;y2=t; } if (x3>x4){ t=x3;x3=x4;x4=t; } if (y3>y4){ t=y3;y3=y4;y4=t; } x1=Math.max(x1,x3); y1=Math.max(y1,y3); x2=Math.min(x2,x4); y2=Math.min(y2,y4); if (x1>x2||y1>y2){ System.out.println("0.00"); continue; } double area=(y2-y1)*(x2-x1); System.out.printf("%.2f",area); System.out.println(); } } }