#P1768F. Wonderful Jump
Wonderful Jump
Description
You are given an array of positive integers of length .
In one operation you can jump from index to index () by paying eris.
For all from to , find the minimum number of eris needed to get from index to index .
The first line contains a single integer ().
The second line contains integers ().
Output integers — the -th integer is the minimum number of eris needed to reach index if you start from index .
Input
The first line contains a single integer ().
The second line contains integers ().
Output
Output integers — the -th integer is the minimum number of eris needed to reach index if you start from index .
Note
In the first example:
- From to : the cost is ,
- From to : — the cost is ,
- From to : — the cost is .
In the fourth example from to : — the cost is .