#pragma GCC optimize("Ofast") #pragma GCC optimize(2) #pragma GCC target("popcnt") #include using namespace std; typedef long long ll; typedef string str; typedef pair pii; #define F first #define S second #define pb push_back #define all(x) (x).begin(),(x).end() #define de_bug(x) cout << (x) << '\n' #define loli(x) cout << (x) << ' ' #define yn(x) cout << (x==1?"Yes\n":"No\n") #define PI 3.14159265358979323 #define Ststone ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) const ll max_n=2e5+10,mod=1e9+7; ll t,k,n,m,h,q,a,b; vector v; vector v2; str s; char c; bool cmp(pii A,pii B){ return A.F+A.S*B.F>B.F+B.S*A.F; } int main(){ Ststone; cin >> n; ll ans = 0,cnt = 0; for(ll i=0;i> a; v2.pb(a); } for(ll i=0;i> a; v.pb({v2[i],a}); } sort(all(v),cmp); ll lv = 1; for(ll i=0;i