#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
long long int a,b,c,d,e,f,n,fn[10050],caseno=1,cases;
scanf("%lld",&cases);
while(cases--)
{
scanf("%lld%lld%lld%lld%lld%lld%lld",&fn[0],&fn[1],&fn[2],&fn[3],&fn[4],&fn[5],&n);
for(int i=6; i<=n; i++)
fn[i]=(fn[i-1]+fn[i-2]+fn[i-3]+fn[i-4]+fn[i-5]+fn[i-6])%10000007;
printf("Case %lld: %lld\n",caseno++,fn[n]%10000007);
}
return 0;
}
Tuesday, July 28, 2015
1006 - Hex-a-bonacci
Subscribe to:
Post Comments (Atom)
Triathlon
Triathlon - CodeChef # include < bits/stdc++.h > using namespace std ; # define fi first # define se second # define mp ...
-
# include < bits/stdc++.h > using namespace std ; int main ( ) { int T , c = 1 ; double r1 , r2 , h , p ; // ...
-
# include < bits/stdc++.h > using namespace std ; int main ( ) { long long T , S , l , n , c = 1 ; // freopen(&qu...
-
# include < bits/stdc++.h > using namespace std ; int main ( ) { int T , n , p , q , c = 1 , i , w , t , arry [ 50 ] ; ...
No comments:
Post a Comment