找规律找出递推式,直接递推打表就好
一个比较详细的题解:https://blog.csdn.net/Miranda_ymz/article/details/81671066
递推式和我不太一样
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
const ll MOD=530600414;
ll s[210000];
ll f[210000];
ll c[210000];
ll d[210000];
ll l[210000];
void init()
{
c[3]=0;c[4]=0;c[5]=5;c[6]=11;
d[3]=0;d[4]=0;d[5]=5;d[6]=13;
f[3]=1;f[4]=1;f[5]=2;f[6]=3;
s[3]=0;s[4]=0;s[5]=5;s[6]=16;
l[3]=0;l[4]=0;l[5]=5;l[6]=8;
for(int n=7;n<202000;n++)
{
int k;
if(n&1) k=5;
else k=3;
l[n]=(l[n-1]+l[n-2]+k)%MOD;
f[n]=(f[n-1]+f[n-2])%MOD;
c[n]=((l[n-2]+k)*f[n-1]+c[n-1]+c[n-2])%MOD;
d[n]=((l[n-1]+k)*f[n-2]+d[n-1]+d[n-2])%MOD;
s[n]=(s[n-1]+s[n-2]+k*f[n-1]*f[n-2]%MOD+c[n-1]*f[n-2]%MOD+d[n-2]*f[n-1]%MOD)%MOD;
}
}
int main()
{
ll n;
int T,kase=0;
init();
scanf("%d",&T);
while(T--)
{
scanf("%lld",&n);
printf("Case #%d: %lld\n",++kase,s[n]);
}
return 0;
}