An integer \( n \) (2 ≤ \( n \) ≤ 8000), where \( n \) is even.
An integer \( k \) (0 ≤ \( k \) ≤ min(\( n/2 \), 20)).
A list of integers \( a \) of size \( n \), where each integer \( a[i] \) (1 ≤ \( a[i] \) ≤ \( n \)) and \( a[i] \neq i \).

### Example Input:

```
8 0
7 4 6 2 8 3 1 5
```

### Function Signature:
Write a function f(n, k, a) that takes in the input.
```python
def f(n: int, k: int, a: List[int]):
    '''
    n: an integer
    k: an integer
    a: a list of integers
    '''
```