There is a matrix that goes like this:

4 7 10 13.....

7 12 17 22....

10 17 24 31....

13 22 31 40....

. . . .

. . . .

. . . .

Your task is to find the number in the Nth row and the Mth column.

The first line will contain N (`1 <= N <= 10^9`

)

The second line will contain M (`1 <= M <= 10^9`

)

The number in the specified position

`3`

4

`31`

- Points: 5
- Time limit: 1.0s
- Memory limit: 64.0M
- Author: ApocalypseCalculator
- Category: Classics
- Type: Simple Math
- All Submissions Best Submissions

Comments

- There are no comments.