{"problem":{"name":"B. Buffoon","description":{"content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10234B"},"statements":[{"statement_type":"Markdown","content":"The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10234B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}