알고리즘

[알고리즘] 백준 23971 - ZOAC 4 (C++)

blueberrysoda 2024. 10. 6. 23:03

[문제 링크] : https://www.acmicpc.net/problem/23971

#include <iostream>
using namespace std;

int main(){
    int H, W, N, M;
    cin >> H >> W >> N >> M;

    int A = H / (N + 1);
    int B = W / (M + 1);

    if(H % (N + 1) > 0){
        A++;
    }
    if(W % (M + 1) > 0){
        B++;
    }

    cout << A * B << "\n";

    return 0;
}