【CodeForces】[1A]Theatre Square

Problem Description

Loading...

Problem Analysis

Just grabbing a random problem to mess around with.

A simple floor-tiling problem.
Note that the data range requires __int64.

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include<stdio.h>
int main() {
	int n,m,a;
	while(scanf("%d %d %d",&n,&m,&a)!=EOF) {
		int x=n/a;
		if(n%a)
			x++;
		int y=m/a;
		if(m%a)
			y++;
		printf("%I64d\n",(__int64)x*y);
	}
	return 0;
}

Problem link: 【CodeForces】[1A]Theatre Square

This post is licensed under CC BY-NC-SA 4.0. If it helped, or if you have anything to say, the comment box below is open.
Page views —
Unique visitors —

Loading...