Apple Tree
Time Limit: 2000MS | Memory Limit: 65536K | |
Total Submissions: 32666 | Accepted: 9812 |
Description
There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.
The tree has N forks which are connected by branches. Kaka numbers the forks by 1 to N and the root is