SP11901 PK11I - Paths in a Tree

Description

[English](/problems/PK11I/en/) [Vietnamese](/problems/PK11I/vn/)You are given a tree (a connected graph with no cycles), and the edges of the tree which are for some reason directed; your task is to add minimum number of special paths in the tree such that it's possible to go from any node to another. The rules for the special paths are noted below: 1. A special path consists of some continuous edges (from the tree) and nodes. 2. In a special path, the edges should be in opposite directions as they are in the tree. 3. A node or an edge can be visited at most once in a special path. 4. Multiple special paths may have common nodes or edges.

Input Format

N/A

Output Format

N/A