#include #include #include using namespace std; using vi=vector; using vvi=vector; using ll=long long; using vll=vector; using vvll=vector; struct friend_t { int x, y; char name[10+2]; }; int main(void) { int w, h, k, p; while(scanf("%d%d%d%d", &w, &h, &k, &p)==4) { vector f(k); vi use(k), ans_use(k); vvll dp(h+1); ll ans=0; for(int i=0;i0 && dp[y-1][x ]>0) dp[y][x]+=dp[y-1][x ]; if(x>0 && dp[y ][x-1]>0) dp[y][x]+=dp[y ][x-1]; } } if(ans