#include<iostream>
#include<cstring>
#include<vector>
#include<queue>
using namespace std;
int main(){
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	int c,T;
	cin>>c>>T;
	while(T--){
		int n,k;
		cin>>n>>k;
		for(int i=1;i<n;i++){
			int x,y;
			scanf("%d%d",&x,&y);
		}
		int ans=0,s;
		while(k--){
			cin>>s;
		}
		cout<<(n+1)/2<<endl;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
