{"raw_statement":[{"iden":"statement","content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T = (V, E) $ be a tree with $ |V| = n $, $ V = \\{1, 2, \\dots, n\\} $.  \nLet $ C \\subseteq V $, $ |C| = k $, be the set of colored vertices, with $ C = \\{a_1, a_2, \\dots, a_k\\} $.  \nLet $ U = V \\setminus C $ be the set of uncolored vertices.  \n\nFor a vertex $ x \\in U $, let $ T_x $ denote the tree rooted at $ x $. Let $ \\text{children}(x) $ be the set of children of $ x $ in $ T_x $. For each child $ c \\in \\text{children}(x) $, let $ T_c $ be the subtree rooted at $ c $.  \n\n**Constraints**  \n1. $ 2 \\le n \\le 2 \\cdot 10^5 $  \n2. $ 1 \\le k < n $  \n3. $ C \\subset V $, all $ a_i \\in V $ are distinct  \n4. $ T $ is connected and acyclic  \n\n**Objective**  \nA vertex $ x \\in U $ is *interesting* if, for every child $ c \\in \\text{children}(x) $, the subtree $ T_c $ contains at least one vertex from $ C $.  \n\nFind the set $ I = \\{ x \\in U \\mid x \\text{ is interesting} \\} $, and output $ |I| $ and the elements of $ I $ in ascending order.","simple_statement":"You are given a tree with n vertices. Some k vertices are colored.  \n\nAn uncolored vertex x is \"interesting\" if, when you root the tree at x, every subtree of x’s children contains at least one colored vertex.  \n\nFind all interesting vertices and print them in ascending order.","has_page_source":false}