也开始做杭电的题目了
#include<stdio.h>
#include<string.h>
int main()
{
int value[1001],w[1001],f[1001];
int i,j,n,v,count1;
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
while(scanf("%d",&count1)!=EOF)
{
while(count1--)
{
memset(f,0,sizeof(f));
scanf("%d%d",&n,&v);
for(i=1;i<=n;i++)
scanf("%d",&value[i]);
for(i=1;i<=n;i++)
scanf("%d",&w[i]);
for(i=1;i<=n;i++)
for(j=v;j>=w[i];j--)
if(f[j]<f[j-w[i]]+value[i])
f[j]=f[j-w[i]]+value[i];
int max=0;
for(i=1;i<=v;i++)
if(max<f[i]) max=f[i];
printf("%d/n",max);
}
}
return 0;
}