[백준/C++] 5532 - 방학 숙제

orangesnail·2025년 8월 20일

백준

목록 보기
146/169

https://www.acmicpc.net/problem/5532


#include <cmath>를 해준 뒤 올림 함수인 ceil() 을 사용하면 간단하게 구현할 수 있다!

#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int l, a, b, c, d;
    cin >> l >> a >> b >> c >> d;

    int kor = (int)ceil((double)a / c);
    int math = (int)ceil((double)b / d);


    int days = max(kor, math);
    cout << l - days << endl;
    return 0;
}
profile
초보입니다. 피드백 환영합니다 😗

0개의 댓글