#include #include #define ft first #define sc second #define pt(sth) cout << sth << "\n" #define chmax(a, b) (a)=max(a, b); #define chmin(a, b) (a)=min(a, b); #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair pll; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; /* for(i=0; i> a[i]; */ ll dp[3333][3333]; int main(void) { ll i, j, k; ll N, M, K; cin >> N >> M >> K; ll l[3333], r[3333]; for(i=0; i> l[i] >> r[i]; dp[0][1]=1; for(i=0; i