계속 wrong answer가 발생해서 여러번 시도해 보았는데도 계속 발생해서 질문드립니다
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double x1 = input.nextDouble();
double y1 = input.nextDouble();
double w1 = input.nextDouble();
double h1 = input.nextDouble();
double x2 = input.nextDouble();
double y2 = input.nextDouble();
double w2 = input.nextDouble();
double h2 = input.nextDouble();
if (Math.abs(x1 - x2) + w2 / 2 <= w1 / 2 && Math.abs(y1 - y2) + h2 / 2 <= h1 / 2) {
System.out.println("inside");
} else if ((Math.abs(w1 / 2 - w2 / 2)<=Math.abs(x1 - x2)
&& Math.abs(x1 - x2) < w1 / 2 + w2 / 2) && (Math.abs(h1 / 2 + h2 / 2)<=Math.abs(y1 - y2) && Math.abs(y1 - y2) < h1 / 2 + h2 / 2))
{System.out.println("attach");}
else
System.out.println("outside");
}
}