{"problem":{"name":"I. Tree Game","description":{"content":"Consider the following game about coloring edges in a tree. You are given a tree. Initially, the color of all edges is white. Let a _valid path_ be a simple path such that all its edges are white, an","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10123I"},"statements":[{"statement_type":"Markdown","content":"Consider the following game about coloring edges in a tree.\n\nYou are given a tree. Initially, the color of all edges is white. Let a _valid path_ be a simple path such that all its edges are white, and the two endpoints are leaves in the tree. On each step of this game, you can choose a valid path and paint all its edges black. You cannot stop your game until you cannot find any valid path.\n\nThe purpose of this game is to use the minimum number of steps to complete the game. Please find the minimum number of steps for the given tree.\n\nThe first line of input contains one integer N indicating the number of nodes in the given tree.\n\nEach of the following N - 1 lines contains two integers x and y indicating that x-th node and y-th node are connected by an edge in the given tree. Nodes are numbered from 1 to N.\n\nOutput one integer: the minimum number of steps required to complete the game on the given tree.\n\n## Input\n\nThe first line of input contains one integer N indicating the number of nodes in the given tree.Each of the following N - 1 lines contains two integers x and y indicating that x-th node and y-th node are connected by an edge in the given tree. Nodes are numbered from 1 to N.  2 ≤ N ≤ 105  1 ≤ x, y ≤ N  the given graph is a tree \n\n## Output\n\nOutput one integer: the minimum number of steps required to complete the game on the given tree.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T = (V, E) $ be a tree with $ n = |V| $ nodes and $ n-1 $ edges.  \nLet $ L \\subseteq V $ be the set of leaf nodes (degree 1).  \nAn edge is initially white; coloring an edge black is irreversible.  \nA *valid path* is a simple path between two distinct leaves such that all its edges are white.  \n\n**Constraints**  \n1. $ n \\geq 2 $  \n2. The graph is a tree: connected, acyclic, undirected.  \n3. At each step, exactly one valid path is chosen and all its edges are colored black.  \n4. The game ends when no valid path exists (i.e., no path between two leaves with all-white edges remains).  \n\n**Objective**  \nFind the minimum number of valid paths needed to cover all edges of $ T $, such that every edge is included in at least one chosen path, and each chosen path connects two leaves.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10123I","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}