본문 바로가기
Beakjoon&프로그래머스/Java

[백준/Java] 5532번 방학 숙제

by 현장 2022. 4. 16.

-Code

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int l = sc.nextInt();
        double b = sc.nextDouble();
        double a = sc.nextDouble();
        double c = sc.nextDouble();
        double d = sc.nextDouble();

        double result = l - Math.max(Math.ceil(b / c), Math.ceil(a / d));
        System.out.println((int) result);
    }
}