백준알고리즘 1085번 직사각형에서 탈출
백준알고리즘 https://www.acmicpc.net/problem/1085 import java.util.Scanner; public class Main { public static void main(String args[]) throws Exception { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); int w = scan.nextInt(); int h = Integer.parseInt(scan.nextLine().trim()); int vertical = -1; int horizontal = -1; if(x > w/2) horizontal = Math.abs(w-x); else hori..