#include #include #include #define LL long long #define Re register LL const int N=5e4+5; struct QAQ{LL L,W;inline bool operator<(QAQ p)const{return Wslope(Q[t-1],i))--t; Q[++t]=i; } printf("%lld",dp[n]); }