#include<iostream> #include<cstdio> #include<cstring> #include<vector> usingnamespacestd; #define N 50010 #define M 200010 #define MAX 1000010 #define LL long long #define cl(xx,yy) memset((xx),(yy),sizeof((xx))) #define pb push_back
LL c[N]; int n,num[N],pre[MAX]; structASK{ int l,r; LL res; }ask[M]; vector<int>List[N];