#include <bits/stdc++.h>
using namespace std;

const int N = 400001;

int T; // T <= 100
int n, rt, a[N], nch[N];

int ei;
struct Edge {
	int v, pre;
} e[N*2];

void Addedge(int u, int v) {
	e[++ei] = {v, hd[u]};
	hd[u] = ei;
	e[++ei] = {u, hd[v]};
	hd[v] = ei;
}

int main() {
	ios::sync_with_stdio(0);
	cin>>T;
	while(T--) {
		cin>>n>>rt;
		for(int i = 1; i <= n; ++i) cin>>a[i];
		for(int i = 1; i < n; ++i) {
			int u, v;
			cin>>u>>v;
			Addedge(u, v);
		}
		// ...
	}
	return 0;
}
