跳到正文

个人记录

CF1A Theatre Square

Unknown_Error约 1 分钟
原文
文章信息与版本

文章信息

发布
2018年2月4日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 1 分钟

版本

  1. v1当前

题意翻译

用 a×a a \times a a×a 的石板覆盖 n×mn \times m n×m 的长方形广场,允许石板覆盖的区域超出广场,不允许打破石板,石板的两侧应平行于广场两侧,要求覆盖完广场所需的石板数量最少是多少

输入输出格式

输入格式:

The input contains three positive integer numbers in the first line: n,m n,m n,m and a a a ( 1<=n,m,a<=109 1<=n,m,a<=10^{9} 1<=n,m,a<=10 9 ).

输出格式:

Write the needed number of flagstones.

参考程序

C++
#include<iostream>  
using namespace std;  
  
int main(){  
    int n, m, a;  
    cin>>n>>m>>a;  
    long long i, j;  
    i = n/a;  
    j = m/a;  
    if(n%a){  
        i++;  
    }  
    if(m%a){  
        j++;  
    }  
    long long sum=i*j;  
    cout<<sum<<endl;  
    return 0;  
} 
原文
存档评论1 条抓取于