【题解】
赛后看不到题目了,很尴尬,就直接贴代码吧。
#pragma comment(linker,"/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<cmath>
#include<vector>using namespace std;typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;#define pi acos(-1.0)
#define eps 1e-10
#define pf printf
#define sf scanf
#define lson rt<<1,l,m
#define rson rt<<1|1,m+1,r
#define e tree[rt]
#define _s second
#define _f first
#define all(x) (x).begin,(x).end
#define mem(i,a) memset(i,a,sizeof i)
#define for0(i,a) for(int (i)=0;(i)<(a);(i)++)
#define for1(i,a) for(int (i)=1;(i)<=(a);(i)++)
#define mi ((l+r)>>1)
#define sqr(x) ((x)*(x))const int inf=0x3f3f3f3f;
const ll Max=1e16;
ll a[100]={1,7};
ll b[100]={2,12};
ll c[]={1,2,7,12,41,70,239,408,1393,2378,8119,13860,47321,80782,275807,470832,1607521,2744210,9369319,15994428,54608393,93222358};
ll d[100];
ll f[]={1,8,49,288,1681,9800,57121,332928,1940449,11309768,65918161,384199200,2239277041,13051463048,76069501249,443365544448,2584123765441,15061377048200,87784138523761,511643454094368,2982076586042449,17380816062160328};
ll m;
int t;int main()
{sf("%d",&t);for1(i,t){int ans=0;sf("%lld",&m);for(int j=0;j<22;j++)if(m>f[j])ans++;pf("Case #%d: %lld\n",i,f[ans]);}return 0;
}