#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int sigma_size=26; const int N=200+100; const int MAXN=40000+100; const double eps=1e-8; const int inf=0x3fffffff; const int mod=1000000000+7; #define L(x) (x<<1) #define R(x) (x<<1|1) int n,T; int dp[MAXN],res[MAXN],st[MAXN]; struct node{ int x,y,t,val; }p[N]; vectorG[N]; bool judge(node a,node b){ return a.x*b.y == b.x*a.y; } bool cmp(int a,int b){ return p[a].x*p[a].x+p[a].y*p[a].yT) break; for(int k=T;k>=t;k--) if(res[k]<=res[k-t]+val) res[k]=res[k-t]+val; for(int k=t;k<=T;k++) dp[k]=max(dp[k],res[k]); memcpy(res,st,sizeof(st)); } } printf("Case %d: %d\n",++kase,dp[T]); } return 0; }