An integer N (3 ≤ N ≤ 10), representing some quantity or size.
A list of integers A of size N, where each integer is either 0 or 1.
A list of integers W of size N, where each integer is between 1 and 1000.

### Example Input:

```
5
1 0 0 1 0
2 3 5 1 2
```

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