A Good Bye 2014(CF)

New Year is coming in Line World! In this world, there arencells numbered by integers from1ton, as a1×nboard. People live in cells. However, it was hard to move between distinct cells, because of the difficulty of escaping the cell. People wanted to meet people who live in other cells.

So, user tncks0121 has made a transportation system to move between these cells, to celebrate the New Year. First, he thought ofn-1positive integersa1,a2,…,an-1. For every integeriwhere1≤i≤n-1the condition1≤ai≤n-iholds. Next, he maden-1portals, numbered by integers from 1 ton-1. Thei-th (1≤i≤n-1) portal connects celliand cell(i+ai), and one can travel from cellito cell(i+ai)using thei-th portal. Unfortunately, one cannot use the portal backwards, which means one cannot move from cell(i+ai)to celliusing thei-th portal. It is easy to see that because of condition1≤ai≤n-ione can’t leave the Line World using portals.

Currently, I am standing at cell1, and I want to go to cellt. However, I don’t know whether it is possible to go there. Please determine whether I can go to celltby only using the construted transportation system.

,无论何时何地,只要创造就有收获,只有不息的奋进,才能证明生命的存在。

A Good Bye 2014(CF)

相关文章:

你感兴趣的文章:

标签云: