1A.Theatre square Codeforces Solution in C, CPP, Python || A theatre square solution

Theatre square Codeforces Solution in C, CPP, Python

Question

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)

Next Problem: Codeforces 1A. Theatre Square Solution in C/CPP

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck