#include #include using namespace std; int main(){ int n; cin>>n; int t[100010], d[100010], ind[100010]; for(int i=0; i>t[i], ind[i]=i; for(int i=0; i>d[i]; sort(ind, ind+n, [&](int i, int j){ return d[i]*t[j]