#include using namespace std; typedef long long ll; typedef double D; typedef pair P; #define M 1000000007 #define F first #define S second #define PB push_back #define INF 100000000000000000 int n; struct f{ int a,b; bool operator<(const f&q)const{ if(a==0)return q.a>0; if(q.a==0)return a<0; return a*q.b>n; for(int i=0;i>x[i].a>>x[i].b; } sort(x,x+n); for(int i=n-1;i>=0;i--)cout<