Sure, I can help you create a test case generator for this problem. The generator will create random values for \( N \), the arrays \( A \) and \( B \), and ensure that the constraints are respected. Here's how you can do it:

```python
import random

def generate_test_case():
    # Generate random N within the given constraints
    N = random.randint(2, 200000)
    
    # Generate array A with values between 0 and 10^12
    A = [random.randint(0, 10**12) for _ in range(N)]
    
    # Generate array B with values between 0 and 100
    B = [random.randint(0, 100) for _ in range(N)]
    
    return N, A, B

# Example usage:
N, A, B = generate_test_case()

# Print the generated test case
print(N)
print(" ".join(map(str, A)))
print(" ".join(map(str, B)))
```

Let's break down what this generator does:
1. **Randomly Generate N**: It generates a random integer \( N \) between 2 and 200,000.
2. **Generate Array A**: It creates a list of \( N \) integers, each ranging from 0 to \( 10^{12} \).
3. **Generate Array B**: It creates a list of \( N \) integers, each ranging from 0 to 100.

This generator ensures that all constraints are respected and provides a random sample for testing the given problem. This is useful for testing the robustness and performance of your solution. You can run the generator multiple times to create various test cases.