CF1882A.Increasing Sequence
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a sequence a1,a2,…,an . A sequence b1,b2,…,bn is called good, if it satisfies all of the following conditions:
- bi is a positive integer for i=1,2,…,n ;
- bi=ai for i=1,2,…,n ;
- b1<b2<…<bn .
Find the minimum value of bn among all good sequences b1,b2,…,bn .
输入格式
Each test contains multiple test cases. The first line contains the number of test cases t ( 1≤t≤100 ). The description of the test cases follows.
The first line of each test case contains a single integer n ( 1≤n≤100 ).
The second line of each test case contains n integers a1,a2,…,an ( 1≤ai≤109 ).
输出格式
For each test case, print a single integer — the minimum value of bn among all good sequences b .
输入输出样例
输入#1
3 5 1 3 2 6 7 4 2 3 4 5 1 1
输出#1
8 4 2
说明/提示
In the first test case, b=[2,4,5,7,8] is a good sequence. It can be proved that there is no good b with b5<8 .
In the second test case, b=[1,2,3,4] is an optimal good sequence.
In the third test case, b=[2] is an optimal good sequence.