Consider the following program:
int t;
cin >> t;
for(int i = 0; i < t; i++){
int n;
cin >> n;
for(int i = 0; i < n; i++){
int temp;
cin >> temp;
}
}
cout << "END OF THE PROGRAM";
This program accepts the input as follows:
t
n
a1a2a3...an
n
a1a2a3...an
.
.
.
n
a1a2a3...an
And, then prints "END OF THE PROGRAM".
Suppose you provide following input to the program:
n
a1a2a3...an
The program might expect more numbers.
How many more numbers does the program must be given to get the "END OF THE PROGRAM" output. If there are multiple answers, then print the minimum answer.
Input format
Output format
Print a single integer denoting the answer to the problem.
5
1 2 3 1 2
The program will interpret the above input as follows:
5
1
2
3
1 2 x (The program expects some number here)
y (=0 for the minimum answer. Here the inner loop won't execute)
z (=0 for the minimum answer. Here the inner loop won't execute)
Now the program outputs "END OF THE PROGRAM"
So, the minimum number of numbers that the program expects is 3.