Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() {
- long long int a[10007],n, j = 0,k, cases;
- scanf("%lld", &cases);
- while( cases-- ) {
- scanf("%lld %lld %lld %lld %lld %lld %lld", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &n);
- for(k=6;k<=n;k++)
- a[k]=(a[k-1]+a[k-2]+a[k-3]+a[k-4]+a[k-5]+a[k-6])%10000007;
- printf("Case %lld: %lld\n", ++j, a[n]%10000007);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement