PROGRAMMING:Zjc cutting cake
As we all know, $$zjc $$is the only big guy in our ACM training team who has a girlfriend. Even if he has a girlfriend, he often gives it to other teammates, which makes everyone envy him very much. One day, we learned that $$zjc $$'s girlfriend was about to celebrate her birthday, so we were ready to trick him.
We raised money to help $$zjc $$buy a cake for his girlfriend, but this cake is a little special: it is square, and there are $$n $$horizontal lines and $$M $$vertical lines on it. Now we ask $$zjc $$to divide the cake in person, to ensure that all the wired places are cut, and only one piece of cake can be cut at a time$$ Zjc $$$in order to force his girlfriend, he said that he only needed to cut the cake at the minimum number of times, but after that, he regretted it because he didn't know the minimum number of times. Can you help him?
###Input format:
In the first line, give a positive integer $$t $$($$1 < = T < = 1000 $$) to represent the total $$t $$group input data.
Next, $$t $$lines, each line gives two positive integers, $$n $$and $$M $$, representing the number of horizontal and vertical lines on the cake, respectively.
###Output format:
For each set of input data, output a positive integer in a row, representing the minimum number of cake cuts.
###Input example:
```in
one
1 1
```
###Output example:
```out
three
```
###Tips:
20% data, $$1 < = n, m < = 10 $$.
40% data, $$1 < = n, m < = 10 ^ 2 $$.
80% of the data, $$1 < = n, m < = 10 ^ 4 $$.
100% data, $$1 < = n, m < = 10 ^ 5 $$< br>
answer:If there is no answer, please comment
We raised money to help $$zjc $$buy a cake for his girlfriend, but this cake is a little special: it is square, and there are $$n $$horizontal lines and $$M $$vertical lines on it. Now we ask $$zjc $$to divide the cake in person, to ensure that all the wired places are cut, and only one piece of cake can be cut at a time$$ Zjc $$$in order to force his girlfriend, he said that he only needed to cut the cake at the minimum number of times, but after that, he regretted it because he didn't know the minimum number of times. Can you help him?
###Input format:
In the first line, give a positive integer $$t $$($$1 < = T < = 1000 $$) to represent the total $$t $$group input data.
Next, $$t $$lines, each line gives two positive integers, $$n $$and $$M $$, representing the number of horizontal and vertical lines on the cake, respectively.
###Output format:
For each set of input data, output a positive integer in a row, representing the minimum number of cake cuts.
###Input example:
```in
one
1 1
```
###Output example:
```out
three
```
###Tips:
20% data, $$1 < = n, m < = 10 $$.
40% data, $$1 < = n, m < = 10 ^ 2 $$.
80% of the data, $$1 < = n, m < = 10 ^ 4 $$.
100% data, $$1 < = n, m < = 10 ^ 5 $$< br>
answer:If there is no answer, please comment