Problem G
Primary Register

The only operation available is an “increment” operation.
When it is performed, the size
In order not to destroy the computer in testing, we need to build a program to check the safety of doing increment operations before we perform them. Given the current state of the registers, you need to compute how many more operations can safely be performed before the computer blows up.
Input
The input consists of a single line containing eight
integers
Output
Ouput a single line containing an integer
Sample Input 1 | Sample Output 1 |
---|---|
0 0 4 6 10 12 16 18 |
5 |
Sample Input 2 | Sample Output 2 |
---|---|
1 2 4 6 10 12 16 18 |
0 |
Sample Input 3 | Sample Output 3 |
---|---|
0 0 0 0 0 0 0 0 |
9699689 |