#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int c,t;
int n,u,v;
int main()
{
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	scanf("%d%d",&c,&t);
	while(t--)
	{
		int k;
		scanf("%d%d",&n,&k);
		for(int i=1;i<n;i++)
		{
			scanf("%d%d",&u,&v);
		}
		int e=0;
		for(int i=1;i<=k;i++)
		{
			scanf("%d",&e);
		}
		printf("%d\n",(n+1)/2);
	}
}
