#include using namespace std; int main() { int p,n[120000],k[120000]; cin >> p; for(int i=0;i>n[i]>>k[i]; for(int i=0;i