2014年4月14日 星期一

[中譯題目] Codeforces - 1A Theatre Square

1 A. Theatre Square

時間限制: 每個 test case 2 秒
記憶體限制: 每個 test case 64 M

在 Berland 的 Theatre Square 有個 n × m 平方公尺的矩形廣場。 在城市週年慶時,大家決定在廣場上鋪上花崗岩石板。每個石版的大小是 a × a 平方公尺。

請問最少需要多少塊石板才能鋪滿整個廣場? 覆蓋面積可以比廣場要大,但是廣場必須被鋪滿。不能打破石版,並且石版的邊必須平行廣場的邊。

Input

一行有三個輸入的數字: n,  m 和 a (1 ≤  n, m, a ≤ 109)。

Output

輸出一個整數,代表問題的答案。
.

Sample input
6 6 4

Sample output
4


原文出處
解題程式 (AC program)

If you want to use (copy, paste or quote) my original article, please contact me through email (autek.roy@gmail.com). If there is any mistake or comment, please let me know. :D

如要使用(複製貼上或轉載)作者原創文章,請來信跟我聯絡 (autek.roy@gmail.com)。如果有發現任何的錯誤與建議請留言或跟我連絡。 : )

沒有留言:

張貼留言

請留下您的任何想法或建議!
Please leave any thought or comment!