#include using namespace std; int main() { int group; cin >> group; for(int i=0; i> n >> m; int ans = -1; int water; int cal; int need; int bottle; for(int j=0; j> water >> cal; if(m % water == 0){ bottle = m / water; } else{ bottle = m / water + 1; } if(ans == -1){ ans = bottle * cal; } else{ ans = min(ans, bottle * cal); } } cout << ans << endl; } }