#include using namespace std; int T,n,m,ans,a,b; main() { cin>>T; while(T--) { cin>>n>>m; ans=1e9; while(n--)cin>>a>>b,ans=min(ans,(m+a-1)/a*b); cout<