import java.util.*; //import java.util.Scanner;
import java.math.*;//util是工具包,math为util下的一个类
public class Main {
static long f[] = new long[10010];// 类似全局变量
final static long mod = 1000000007;// 相当于c中的define
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
while (input.hasNextInt()) {
int n, a, b, c, d;
n = input.nextInt();
f[0] = input.nextInt();
a = input.nextInt();
b = input.nextInt();
c = input.nextInt();
d = input.nextInt();
int i;
for (i = 1; i <= n; i++)
f[i] = (a * f[Math.max(0, i - b)] + c * f[Math.max(0, i - d)]) % mod;
System.out.println(f[n]);
} // 多组输入
}
}
蝴蝶效应
最新推荐文章于 2021-03-17 14:29:06 发布