开发者

Interpretation I dont know what to do?

开发者 https://www.devze.com 2023-01-15 10:26 出处:网络
I don\'t understand what I am supposed to do in this exercise, I am beginning programming contest, if you can help me is very appreciated, I have seen formulas, but I开发者_运维百科 don\'t understand

I don't understand what I am supposed to do in this exercise, I am beginning programming contest, if you can help me is very appreciated, I have seen formulas, but I开发者_运维百科 don't understand what to do, I feel very stupid , and for everyone is easy :(

http://www.codeforces.com/contest/1/problem/A


The site seems to be in Russian or English. I'm guessing that neither of these is your first language.

The problem is to pave a rectangular area with square tiles. You are given three values:

  • length of the rectangular area
  • width of the rectangular area
  • size of the tiles (length of a side: remember they are square)

You must write a program that takes the three numbers above as inputs (on the command line) and provide the number of tiles required as output.


One little hint. Suppose that you must cover an axn rectangle with axa stones. Then the solution is "k stones", where ka is the first multiple of a greater than or equal to n. (Draw a picture.)

How to go for k? Do a division and have a look at the documentation of the ceil() function (it is quite standard).

Now what happens if we move to a 2-dimensional problem, i.e. if we have to cover an mxn rectangle? (Draw another picture, do some experiments.)

0

精彩评论

暂无评论...
验证码 换一张
取 消