Exciting Travel

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

After finishing the IODS team selection, you want to travel to a new country to relax. The country contains nn cities, which are connected by n1n-1 bidirectional roads. There is a unique simple path between any two cities.

In the next mm days, you wish to explore the country. On each day you have set kk cities x_1,x_2,,x_kx\_1, x\_2, \ldots, x\_{k} that you wish to visit in order. At the beginning of each day, you can choose any city as the starting city of your trip, and then you need to reach city x_1x\_1, then city x_2x\_2, ..., and finally city x_kx\_k to complete your day's travel.

To add to the fun of the trip, you don't want to pass through a city more than once in a day. At any given moment, you can choose to follow a road from this city to another city, or choose to take a yacht to any city.

You want to know, for each day of travel, the minimum number of yacht rides required in order to avoid passing through the same city more than once. Note that each day's travel is independent: a city passed on the previous day can still be passed on the next day.

입력

The first line contains two integers nn and mm (1n21051 \le n \le 2 \cdot 10^5, 0m51040 \le m \le 5 \cdot 10^4).

Each of the next n1n-1 lines contains two integers xx and yy (1x,yn1 \le x,y \le n, xyx \ne y), indicating that there is a bidirectional edge between vertices xx and yy. It is guaranteed that the given graph is connected.

Each of the next mm lines describes queries in the format kx_1x_2x_kk x\_1 x\_2 \ldots x\_k. It is guaranteed that 1x_in1 \le x\_i \le n and x_ix_jx\_i \ne x\_j for all 1i<jk1 \le i < j \le k.

The sum of kk in one test case does not exceed 21052 \cdot 10^5.

출력

For each day, output a single line containing a single integer: the minimum number of yacht rides.

힌트

The figure corresponds to the first sample test case

The figure corresponds to the second sample test case