Contests | Virtual Contests | Problems | Submit | Runs Status | Rank List | Forum |

Time Limit: 1.0 Seconds Memory Limit: 65536K

Total Runs: 2152 Accepted Runs: 936

ZC's birthday is coming, lxh gives a cake of *n* * *m* as present for his girlfriend. Now lxh wants to know how many second do you need to divide it to many 1*1 cakes? Every second you can choose a connected part of cake, and cut it into two along a straight line.

For each case, you can get two integers *n* and *m* in the line. (*n, m* ≤ 10^{9})

2 1 1 2 2

0 3

Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz