An integer N (1 ≤ N ≤ 1000), representing some quantity or size.
An integer M (1 ≤ M ≤ 1000), representing some quantity or size.
An integer K (0 ≤ K ≤ NM).

### Example Input:

```
2 2 2
```

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

```python
def f(N: int, M: int, K: int):
    ''' 
    N: an integer 
    M: an integer
    K: an integer
    '''
```