#include using namespace std; typedef long long ll; typedef long double dd; #define i_7 (ll)(1E9+7) //#define i_7 998244353 #define i_5 i_7-2 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; return c+i_7; } typedef pair l_l; ll inf=(ll)1E17; #define rep(i,l,r) for(ll i=l;i<=r;i++) #define pb push_back ll max(ll a,ll b){if(ab)return b;else return a;} void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]); void Min(ll &pos,ll val){pos=min(pos,val);} void Add(ll &pos,ll val){pos=mod(pos+val);} dd EPS=1E-9; #define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); /////////////////////////////////////// typedef vector vec; typedef vector mat; mat mul(mat a,mat b){/*行列aと行列bの積*/ mat c(a.size(),vec(b[0].size())); for(int i=0;i0){ if(n&1)b=mul(b,a); a=mul(a,a); n>>=1; } return b; } ////////////////////////////////////////// #define N 3005 int main(){fastio; ll n,m,k;cin>>n>>m>>k; ll imos[N][N];memset(imos,0,sizeof(imos)); while(m--){ ll l,r;cin>>l>>r;r++; imos[l][l]++; imos[l][r]--; imos[r][l]--; imos[r][r]++; } rep(i,0,N-1){ rep(j,0,N-2){ imos[i][j+1]+=imos[i][j]; } } rep(j,0,N-1){ rep(i,0,N-2){ imos[i+1][j]+=imos[i][j]; } } /*rep(i,0,6){ rep(j,0,6){ cout<