the first thought coming in to my head, is that using if statement then make a decision.Something like:
int resultN = 0;
if(n%a !=0){
resultN ++;
}
resultN += n/a;
Then do the same thing to m.
Finally,multiply them.
result = resultN *resultM;
Here,I make two mistakes. 1)Didn't pay attention to the number range; 2)Use too many intermediate variables;
Hope code better next time. :D








