Sure, here's a test case generator for the given competitive programming problem:

### Problem Statement: ID Cards and Gates

**Description**

We have \(N\) ID cards, and there are \(M\) gates. We can pass the \(i\)-th gate if we have one of the following ID cards: the \(L_i\)-th, \((L_i+1)\)-th, ..., and \(R_i\)-th ID cards. How many of the ID cards allow us to pass all the gates alone?

**Input**

1. An integer \(N\) (1 ≤ \(N\) ≤ 10^5), representing the number of ID cards.
2. An integer \(M\) (1 ≤ \(M\) ≤ 10^5), representing the number of gates.
3. \(M\) pairs of integers \(L_i\) and \(R_i\) (1 ≤ \(L_i\) ≤ \(R_i\) ≤ \(N\)), where each pair describes the range of ID cards that can pass the \(i\)-th gate.

**Output**

Print the number of ID cards that allow us to pass all the gates alone.

**Examples**

_Input_
```
4 2
1 3
2 4
```

_Output_
```
2
```

_Input_
```
10 3
3 6
5 7
6 9
```

_Output_
```
1
```

### Test Case Generator

```python
import random

def tcgen():
    N = random.randint(1, 10**5)
    M = random.randint(1, 10**5)
    
    gates = []
    for _ in range(M):
        L = random.randint(1, N)
        R = random.randint(L, N)
        gates.append((L, R))
    
    return N, M, gates

# Example of generating a test case
N, M, gates = tcgen()
print(N, M)
for L, R in gates:
    print(L, R)
```

### Explanation

1. **N**: Randomly selects the number of ID cards between 1 and 100,000.
2. **M**: Randomly selects the number of gates between 1 and 100,000.
3. **gates**: Generates \(M\) pairs of \(L\) and \(R\), where \(L\) is randomly selected between 1 and \(N\), and \(R\) is randomly selected between \(L\) and \(N\).

This should adequately generate diverse test cases for the given problem.