#USACOC2222C. Tests for Haybales
Tests for Haybales
Description
Farmer John's cows have decided to offer a programming contest for the cows onFarmer Nhoj's farm. In order to make the problems as fun as possible, they havespent considerable time coming up with challenging input cases. For one problemin 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 , butyou 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 tosatisfy for all and .
It can be proven that this is always possible. Help Farmer John's cows solvethis problem!
Input Format
The first line of input contains . The next line contains .
Output Format
Print , then on separate lines. Any valid output will be accepted.
6
2 2 4 5 6 6
6
2 2 4 5 6 6
Scoring
- For 50% of all inputs,
- For the remaining inputs, there are no additional constraints.
Problem Credit
Problem credits: Danny Mittal