CF1272E Nearest Opposite Parity

Description

You are given an array $ a $ consisting of $ n $ integers. In one move, you can jump from the position $ i $ to the position $ i - a_i $ (if $ 1 \le i - a_i $ ) or to the position $ i + a_i $ (if $ i + a_i \le n $ ). For each position $ i $ from $ 1 $ to $ n $ you want to know the minimum the number of moves required to reach any position $ j $ such that $ a_j $ has the opposite parity from $ a_i $ (i.e. if $ a_i $ is odd then $ a_j $ has to be even and vice versa).

Input Format

N/A

Output Format

N/A