##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given a tree with vertices. The tree is rooted at vertex .
Each vertex is colored either blue or red. The color of vertex is denoted by .
For a vertex , consider the subtree of . For every integer , look at all vertices in this subtree whose distance from is exactly . Vertex is called good if, for every such , all these vertices have the same color. A level with zero or one vertex always satisfies this condition.
You have to process queries. In each query, one vertex is given and its color is toggled: blue becomes red, and red becomes blue.
After each query, output the number of good vertices in the tree.
For each test case, after each query output one integer, the number of good vertices after applying that query.