Tests for Haybales
문제
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.
힌트
The sample output is the array with . is satisfied because but , so is the largest element that is at most . Similarly,
- is satisfied because but
- is satisfied because but
- is satisfied because but
- is satisfied because and is the last element of the array
- is satisfied because and is the last element of the array
This is not the only possible correct output for the sample input. For example, you could instead output the array with .
예제
예제 1
6 2 2 4 5 6 6
6 1 6 17 22 27 32