알고리즘

[알고리즘] 백준 13136 - Do Not Touch Anything (C++)

blueberrysoda 2024. 12. 5. 21:36

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

#include <iostream>
using namespace std;

int main(){
    long long R, C, N, X, Y;

    cin >> R >> C >> N;
    
    if(R % N){
        X = R / N + 1;
    }
    else{
        X = R / N;
    }

    if(C % N){
        Y = C / N + 1;
    }
    else{
        Y = C / N;
    }

    cout << X * Y << "\n";
    return 0;
}