#include using namespace std; using ll=long long; using Graph=vector>; #define INF 1000000000 int main(){ int N,Q; cin>>N>>Q; int sum=0; vector a(N,0); for(int i=0;i>L>>R; L--; for(int j=L;j