D. Mysterious Present 题目连接: http://www.codeforces.com/contest/4/problem/D Description Peter decided to wish happy birthday to his friend from Australia and send him a card. To make his present more mysterious, he decided to make a chain. Chain here i…