[codeforces] A. Theatre Square알고리즘(Python,Java)2019. 8. 15. 21:20
Table of Contents
반응형
problem
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m 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 a × a.
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.
using language : python3
from math import ceil
n,m,a = list(map(int,input().split()))
num1 = ceil(n/a)
num2 = ceil(m/a)
print(int(num1*num2))
반응형
'알고리즘(Python,Java)' 카테고리의 다른 글
[codeforces] A. Next Round (0) | 2019.08.21 |
---|---|
[Codeforces]A. Way Too Long Words (0) | 2019.08.18 |
[Codeforeces] A. Watermelon (0) | 2019.08.15 |
백준알고리즘 2798번: 블랙잭 (0) | 2019.08.15 |
백준알고리즘 3053번: 택시 기하학 (0) | 2019.08.11 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상