#Failing 1 test case

6 messages · Page 1 of 1 (latest)

analog flume
#
import java.util.*;
import java.io.*;
public class Billboard2 {
    static String name = "billboard";
    public static void main(String[] args) throws Exception{
        Scanner in = new Scanner(new FileReader(name+".in"));
        PrintWriter out = new PrintWriter(new FileWriter(name+".out"));
        int a = in.nextInt() , b = in.nextInt() , c = in.nextInt() , d = in.nextInt();
        int a1 = in.nextInt() , b1 = in.nextInt() , c1 = in.nextInt() , d1 = in.nextInt();
        int l = c-a;
        int w = d-b;
        int interl = Math.min(c, c1) - Math.max(a,a1);
        int interw = Math.min(d, d1)-Math.max(b, b1);
        if(interl<0||interw<0) {
            interw = interl-=interl;
        }
        boolean ww = false , ll = false;
        if(interl==l) {
            ww = true;
        }
        if(interw == w) {
            ll = true;
        }
        if(ww)w-=interw;
        if(ll)l-=interl;
        out.println(l*w);
        out.close();

    }

}

Here is my code for the problem!

rustic pantherBOT
#

Hey, @analog flume!
Please remember to /close this post once your question has been answered!

iron pulsar
#

What's the failed test case?

#

What does it expect? What is the actual output?

analog flume
#

Doesn't tell you