Orig Description
D: Scanner
Problem Statement
You have $N$ pieces of paper to scan. You want to scan them all by using $3$ scanners in parallel.
Each piece of paper takes a certain amount of time to scan, and the time it takes to scan the $i$-th piece of paper is $T_i$.
The order in which you scan the papers is arbitrary, but you cannot scan multiple papers at the same time with one scanner.
Determine the minimum amount of time it takes for all the papers to be scanned and for all the scanners to stop scanning.
Input
$N$
$T_1$
$T_2$
$T_3$
$\vdots$
$T_N$
Constraints
$1 \leq N \leq 50$
$1 \leq T_i \leq 50$
All input values are integers.
Output
Print the minimum amount of time it takes for all the papers to be scanned and for all the scanners to stop scanning.
Sample Input #1
4
1
1
1
1
Sample Output #1
2
Sample Input #2
9
15
20
27
4
10
7
34
30
36
Sample Output #2
61
Sample Input #3
6
20
18
46
16
9
48
Sample Output #3
55
Extracted Specification
An integer N (1 ≤ N ≤ 50), representing some quantity or size.
A list of integers T of size N, where each integer is between 1 and 50.
### Example Input:
```
4
1
1
1
1
```
### Function Signature:
Write a function f(N, T) that takes in the input.
def f(N: int, T: List[int]):
'''
N: an integer
T: a list of integers
'''
Test Case Generator
To generate test cases for the given problem, we need to achieve the following:
1. Randomly generate \(N\) (number of papers) within the given constraints.
2. Randomly generate a list of integers \(T_i\) representing the time it takes to scan each piece of paper, also within the given constraints.
Here's the test case generator for the given problem:
```python
import random
def tcgen():
# Constraint for N
N = random.randint(1, 50)
# Constraint for T_i
T = [random.randint(1, 50) for _ in range(N)]
return N, T
# Example usage
if __name__ == "__main__":
N, T = tcgen()
print(N)
for t in T:
print(t)
```
### Explanation:
1. **Generating \(N\)**:
- `N = random.randint(1, 50)` generates a random integer between 1 and 50 inclusive.
2. **Generating the list \(T\)**:
- `[random.randint(1, 50) for _ in range(N)]` generates a list of \(N\) integers, where each integer is between 1 and 50 inclusive.
### Example Output:
Running the `tcgen` function might produce an output like:
```
10
3
45
21
30
3
8
25
10
47
29
```
This output corresponds to:
- \(N = 10\)
- \(T = [3, 45, 21, 30, 3, 8, 25, 10, 47, 29]\)
You can run this script multiple times to generate different test cases, which can be useful for testing the robustness and correctness of your solution to the problem.