Problem D
Fjallamynstur
Languages
en
is
You have received an image of your friend who’s out hiking. You know which mountain range he’s in, but not where in that mountain range. Thus your plan is to compare the image to data on the shape of the mountain range to figure out where he is, or at least narrow down the space of possibilities.
The mountain range is given as a sequence of heights, and so is the photograph. It is unknown how far from the ground the image is offset so if a sequence of numbers in the mountain range matches the photo up to a constant we consider it a match. For example if the image is given by 10 20 5 then that matches 20 30 15.
Input
The input starts with two integers
Output
Print all indices
Sample Input 1 | Sample Output 1 |
---|---|
3 8 5 9 13 8 12 16 12 8 4 8 12 |
0 5 |
Sample Input 2 | Sample Output 2 |
---|---|
2 8 2 2 1 2 3 4 5 6 7 8 |
tyndur |