#include <bits/stdc++.h>
using namespace std;
#define N 10000
int t,n,m,v;
int main(){
	freopen("assign.in","r",stdin);
	freopen("assign.out","w",stdout);
	scanf("%d",&t);
	for(;t;t--){
		scanf("%d %d %d",&n,&m,&v);
		int temp1,temp2=0;
		for(int i=1;i<=m;i++) scanf("%d %d",&temp1,&temp2);
		printf("%d",sqrt(v*n));
	} 
	return 0;
} 
