Check Question

Before we solve this question, we should take it that what this question wanna tell us.

<n, m> it means that the box <width, height> = <n + 1, m + 1>

#include <stdio.h>

int dp(int m, int n) {
    if (m == 0 || n == 0)
        return 1;
    else
        return dp(m-1, n) + dp(m, n-1);
}

int main()
{
    int n,m;
    while (scanf("%d %d", &n, &m) != EOF) {
        printf("%d\n", dp(n, m));
    }
    
    return 0;
}