34 人解决,77 人已尝试。
37 份提交通过,共有 121 份提交。
5.6 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
You are given a paper of dimension mn, and you have to cut into mn squares each of dimension 11 using a scissors. What is the minimum number of cuts needs to get all mn squares?
Input consists of several test cases. Each case appears on a single line, and there is no blank line between two cases. Each line has two numbers m and n, indicating the dimension of the paper. The input is terminated by the case m=0 and n=0. You do not have to handle this case. Both m and n will fit in a 32-bit integer representation.
For each input, output the minimum number of cuts needed, as specified above.
2 2 1 1 5 1 0 0
3 0 4
34 人解决,77 人已尝试。
37 份提交通过,共有 121 份提交。
5.6 EMB 奖励。