#include #include #include #include #include using namespace std; #define maxn 1000001 #define ll __int64 struct Node { ll a,b; }; Node no[maxn]; bool cmp(Node x,Node y) { return x.a=no[i].a)ans+=no[i].a; else ans+=(ans+1)*no[i].b; printf("%I64d\n",ans); } return 0; }