Hello
I dont understand what I supposed to do in this exercise, I am begining programming constest, if you can help me is very appreciated, I have seen formulas, but I dont understand what to do, I feel very stupid , and for everyone is easy :(
Hello
I dont understand what I supposed to do in this exercise, I am begining programming constest, if you can help me is very appreciated, I have seen formulas, but I dont understand what to do, I feel very stupid , and for everyone is easy :(
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:
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.)