Computer Science, asked by saiasritha2002, 1 year ago

Theatre Square in the capital city of Berland has a rectangular shape with the size nm meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size aa.

What is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.

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

Output
Write the needed number of flagstones.

Answers

Answered by ishwaryam062001
0

Answer:

C and Python program for the given statement

Explanation:

From the above question,

They have given :

Theatre Square in the capital city of Berland has a rectangular shape with the size nm meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size aa.

Input

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

                                             PROGRAM

#include <stdio.h>

int main()

{

   unsigned long n, m, a = 1;

   unsigned long na, ma, res = 0;

   scanf("%lu %lu %lu", &n, &m, &a);

   na = n/a;

   if (n%a != 0)

       na++;

   ma = m/a;

   if (m%a != 0)

       ma++;

   res = na * ma;

   printf("%lu", res);

   return 0;

}

                                 PYTHON

import math

x,y,z=list(map(float, input().split()))  

print(math.ceil(x/z)*math.ceil(y/z))

For more such related questions : https://brainly.in/question/17306370

#SPJ1

Similar questions