백준 1085

jaegeunsong97·2023년 3월 7일
0
post-thumbnail

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        
        int x = Integer.parseInt(st.nextToken());
		int y = Integer.parseInt(st.nextToken());
		int w = Integer.parseInt(st.nextToken());
		int h = Integer.parseInt(st.nextToken());
        
        int x_min = Math.min(x, w - x);
        int y_min = Math.min(y, h - y);
        
        System.out.println(Math.min(x_min, y_min));
    }
}
profile
현재 블로그 : https://jasonsong97.tistory.com/

0개의 댓글