参考程序:
#include <cstdio>
using namespace std;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int n, a, b, c;
int f[N << 1];
int ans;
int main()
{scanf("%d%d%d%d", &n, &a, &b, &c);f[N + n] = 1;for (int i = n; i > c; i--){f[N + i - a] = (f[N + i - a] + f[N + i]) % mod;f[N + i - b] = (f[N + i - b] + f[N + i]) % mod;}for (int i = 0; i <= N + c; i++)ans = (ans + f[i]) % mod;printf("%d\n", ans);return 0;
}