Theatre square Codeforces Solution in C, CPP, Python
Question
Contents
hide
Codeforces 1A.Theatre square Codeforces Solution in C
#include<stdio.h> int main(){ long long int a,n,m,total; scanf("%lld%lld%lld",&n,&m,&a); double hight ,width; hight=ceil((double)n/(double)a); width=ceil((double)m/(double)a);//a. theatre square solution total=hight*width; printf("%lld\n",total); return 0; }
Codeforces 1A.Theatre square Solution in C++
#include <iostream> #include <cmath> int main() { long long int a, n, m, total; std::cin >> n >> m >> a; double hight, width; hight = ceil(static_cast<double>(n) / static_cast<double>(a)); width = ceil(static_cast<double>(m) / static_cast<double>(a)); total = hight * width; std::cout << total << std::endl; return 0; }
Codeforces1A.Theatre squareSolution in Python
import math n, m, a = map(int, input().split()) hight = math.ceil(n / a) width = math.ceil(m / a) total = hight * width print(total)