// verification-helper: PROBLEM https://yukicoder.me/problems/4271 #define call_from_test #ifndef call_from_test #include using namespace std; #endif //BEGIN CUT HERE #pragma GCC optimize ("O3") #pragma GCC target ("avx2") // or sse4 #pragma GCC optimize("unroll-loops") //END CUT HERE #ifndef call_from_test signed main(){ return 0; } #endif #undef call_from_test #include using namespace std; const int MAX = 1e5; const int MOD = 1e9+7; using uint = unsigned int; inline uint add_mod(uint a, uint b) { return (a += b) >= MOD ? a - MOD : a; } uint mul(uint x,uint y){ return 1ULL*x*y%MOD; } uint xs[MAX]={}; uint as[MAX]={}; uint cs[MAX]={}; signed main(){ cin.tie(0); ios::sync_with_stdio(0); const char newl = '\n'; int k,n,m; cin>>k>>n>>m; for(int i=0;i>as[i]; for(int i=0;i>cs[i]; for(int i=k;i>l>>r; for(int k=l;k