10 1 1 2 1 2 5 5 5 1
1
1
2
2
4
4
4
5
7
10
The following ways of choosing vertices should be counted:
* ${1}$ when $k \ge 1$
* ${1,2,3}$ when $k \ge 3$
* ${1,2,5},{1,3,5}$ when $k \ge 5$
* ${1,2,4,5,6,7,8}$ when $k \ge 8$
* ${1,2,4,5,6,7,9},{1,2,4,5,6,8,9}$ when $k \ge 9$
* ${1,2,10},{1,3,10},{1,5,10}$ when $k = 10$1
1 If $N=1$, the $2$\-nd line of the Input is empty.
10 1 2 3 4 5 6 7 8 9
1 1 1 1 1 1 1 1 1 1
13 1 1 1 2 2 2 3 3 3 4 4 4
1 1 2 4 4 4 4 4 7 13 13 19 31
{
"problem": {
"name": "Ex - Perfect Binary Tree",
"description": {
"content": "We have a rooted tree with $N$ vertices numbered $1,2,\\dots,N$. The tree is rooted at Vertex $1$, and the parent of Vertex $i \\ge 2$ is Vertex $P_i(<i)$. For each integer $k=1,2,\\dots,N$, solve th",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc264_h"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have a rooted tree with $N$ vertices numbered $1,2,\\dots,N$. \nThe tree is rooted at Vertex $1$, and the parent of Vertex $i \\ge 2$ is Vertex $P_i(<i)$. \nFor each integer $k=1,2,\\dots,N$, solve th...",
"is_translate": false,
"language": "English"
}
]
}