1006 – Hex-a-bonacci

Problem Link

<Source Code>

#include<stdio.h>
int main()
{long long int f[10006],n;

int t,cases=0,i;
scanf(“%d”,&t);
while(t–)
{

for(i=0;i<6;i++)
scanf(“%lld”,&f[i]);

scanf(“%lld”,&n);
for(i=6;i<=n;i++)

f[i]=(f[i-1]+f[i-2]+f[i-3]+f[i-4]+f[i-5]+f[i-6])%10000007;

printf(“Case %d: %lld\n”,++cases,f[n]% 10000007);
}

return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in lightoj, Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s