문제
Farmer John's cows have decided to offer a programming contest for the cows on Farmer Nhoj's farm. In order to make the problems as fun as possible, they have spent considerable time coming up with challenging input cases. For one problem in particular, "Haybales", the cows need your help devising challenging inputs. This involve solving the following somewhat intriguing problem:
There is an array of sorted integers (), and an integer . You don't know the array or , but you do know for each index , the largest index such that . It is guaranteed that and .
Given this information, Farmer John's cows need to construct any array along with some integer that matches that information. The construction needs to satisfy for all and .
It can be proven that this is always possible. Help Farmer John's cows solve this problem!
입력
The first line of input contains . The next line contains .
출력
Print , then on separate lines. Any valid output will be accepted.
예제 입력 1
6
2 2 4 5 6 6
예제 출력 1
6
1
6
17
22
27
32
점수
For 50% of all inputs, For the remaining inputs, there are no additional constraints.
코드를 제출하려면 로그인이 필요합니다.
로그인