#include using namespace std; inline int read(){ int x=0,f=1;char cc=getchar(); while(cc<'0' || cc>'9') {if(cc=='-') f=-1;cc=getchar();} while(cc>='0' && cc<='9') {x=x*10+cc-'0';cc=getchar();} return x*f; } int main(){ for(int tt=read();tt;tt--){ int n=read();int m=read(); int ans=2000000000; for(int i=1;i<=n;i++){ int x=read();int y=read(); int z=m/x; if(z*x