An integer N (1 ≤ N ≤ 150), representing some quantity.
An integer K (1 ≤ K ≤ N), representing another quantity.
An integer M (10^8 ≤ M ≤ 10^9), representing a modulus value.

### Example Input:
```
13 1 998244353
```

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