美文网首页
codeforces-1A Theatre Square

codeforces-1A Theatre Square

作者: Infinite_eyes | 来源:发表于2016-12-08 23:27 被阅读23次

    codeforces.com/problemset/problem/1/A

    题意:有n*m的剧院,需要用多少a*a的石板才能铺满。(石板不能裁剪)
    (1 ≤n, m, a ≤ 10^9).
     最大情况为10^18
    

    C

    #include <stdio.h>
    typedef long long int64; 
    int main()
    {
        
        int n,m,a;
        int64 stonesX,stonesY;
        
        while(scanf("%d %d %d",&n,&m,&a)!=EOF){     
            stonesX = n > a ? (n+a-1)/a : 1;
            stonesY = m > a ? (m+a-1)/a : 1; 
            printf("%I64d\n",stonesX*stonesY); 
            
        }
        return 0; 
    }
    
    

    相关文章

      网友评论

          本文标题:codeforces-1A Theatre Square

          本文链接:https://www.haomeiwen.com/subject/hrfemttx.html