An integer N (1 ≤ N ≤ 15), representing some quantity or size.
A list of N pairs of integers. Each pair consists of an integer q (1 ≤ q ≤ 3) and an integer x (1 ≤ x ≤ 10).

### Example Input:

```
3
1 2
2 10
3 8
```

### Function Signature:
Write a function f(N, queries) that takes in the input.
```python
def f(N: int, queries: List[Tuple[int, int]]):
    '''
    N: an integer
    queries: a list of tuples, each containing two integers
    '''
```