An integer N (1 ≤ N ≤ 3000), representing some quantity or size.
An integer M (1 ≤ M ≤ 3000), representing some quantity or size.

### Example Input:

```
2
3
```

### Function Signature:
Write a function f(N, M) that takes in the input.
def f(N: int, M: int):
    '''
    N: an integer
    M: an integer
    '''