Note that there are some explanatory texts on larger screens.

plurals
  1. POCan anyone explain the test case for the puzzle "Repairing Roads"?
    primarykey
    data
    text
    <p>I am trying to solve the following puzzle. I am confused by one of the test case.</p> <p>Here is the problem:</p> <p>The country of Byteland contains of N cities and N - 1 bidirectional roads between them such that there is a path between any two cities. The roads in Byteland were built long ago and now they are in need of repair. You have been hired to repair all the roads. You intend to do this by dispatching robots on some of the roads. Each robot will repair the road he is currently on and then move to one of the adjacent unrepaired roads. After repairing that, he will move to another adjacent unrepaired road, repair that and so on.</p> <p>Two roads are adjacent if they have the same city at one of their endpoints. For the process to be efficient, no two robots will can ever repair the same road, and no road can be visited twice. What is the least number of robots needed to accomplish the task?</p> <p>Input: The first line contains the number of test cases T. T test cases follow. The first line of each testcase contains N, the number of cities in Byteland. The cities are numbered 0..N - 1. The following N - 1 lines contain the description of the roads. The ith line contains two integers ai and bi, meaning that there is a road connecting cities with numbers ai and bi.</p> <p>Output: Output T lines, one corresponding to each test case containing the required answer for that test case.</p> <p>Constraints: 1 &lt;= T &lt;= 20<br/> 1 &lt;= N &lt;= 10000<br/> 0 &lt;= ai,bi &lt; N<br/></p> <p>Now bolow is the test case that I'm confused:</p> <blockquote> <p>1<br/> 15<br/> 0 11<br/> 1 7<br/> 1 11<br/> 2 11<br/> 2 14<br/> 3 4<br/> 4 10<br/> 4 13<br/> 4 8<br/> 5 13<br/> 6 10<br/> 7 9<br/> 8 11<br/> 11 12<br/></p> <p>The correct answer is 2, but why?</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload