## Problem

As a holiday gift, Tojo received a probability problem. The problem read as follows

Consider anÂ **N**Â byÂ **M**Â grid. Rows are numberedÂ **1**Â toÂ **N**, from top to bottom. Columns are numberedÂ **1**Â toÂ **M**, from left to right. You are initially at cell (1, 1) and want to go to cell (**N, M**). From any cell you can move to the cell below it or to the cell right to it. You should never go out of the grid. At any point you should consider all the possibilities of movement with equal probability

Let P[i][j] be the probability of visiting cell (i, j). You need to calculate the sum of P[i][j] forÂ **1**Â â‰¤Â **i**Â â‰¤Â **N**,Â **1**Â â‰¤Â **i**Â â‰¤Â **M**.

As we all know, Tojo really hates probability-related problems. He wants you to solve this task

### Input

The first line of the input contains an integerÂ **T**Â denoting the number of test cases. The description ofÂ **T**Â test cases follows.Only line of each test case has two integerÂ **N**Â andÂ **M**.

### Output

For each test case, output a single line containing the required answer. Answers within an absolute or relative error of 10^{-6}Â will be accepted.

### Constraints

**1**Â â‰¤Â**T**Â â‰¤Â**1000****1**Â â‰¤Â**N**Â â‰¤Â**1000****1**Â â‰¤Â**M**Â â‰¤Â**1000**

### Example

### Sample Input 1

```
2
2 2
1 6
```

### Sample Output 1

```
3.000000
6.000000
```

## Tojo hates probabilities â€“ CodeChef Solution in JAVA

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int tc = 0; tc < T; tc++) { int N = sc.nextInt(); int M = sc.nextInt(); System.out.println(solve(N, M)); } sc.close(); } static int solve(int N, int M) { return N + M - 1; } }

** Disclaimer:Â The above Problem (Tojo hates probabilitiesÂ ) is generated by**Â CodeChef but the solution is provided byÂ

**Chase2learn**.This tutorial is only forÂ

**Educational**Â andÂ

**Learning**Â purpose.