An integer N (2 ≤ N ≤ 10^6), representing some quantity or size.
An integer M (0 ≤ M ≤ 50), representing another quantity.
M pairs of integers (Xi, Yi) where 1 ≤ Xi, Yi ≤ N and all pairs are distinct.

### Example Input:

```
3 1
2 2
```

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