Figuring out Wrong test case

dynamic-programming

#1

iam not being able to figure out the wrong test case in my code for the problem https://www.codechef.com/problems/PPTEST can anyone help? my code goes out like this

#include<stdio.h>
#include <stdlib.h>
int max(int a ,int b)

{

if(a>b)

return a;

else

return b;

}

int main()

{

int t,n,w,testcase,i,j;
int g[101][101];
int a[101][101];
int b[101][101];

scanf("%d",&t);

for(testcase=1;testcase<=t;testcase++)

{

scanf("%d %d",&n,&w);

for(i=1;i<=n;i++)

{

for(j=1;j<=3;j++)

{

scanf("%d",&g*[j]);

}

}

for(i=1;i<=n;i++)

{

for(j=1;j<=w;j++)

{

if(i==1)

{

if(j>=g*[3])

{

a*[j]=g*[1]g[2];

b*[j]=g*[3];

}

else

{

a*[j]=0;

b*[j]=0;

                 }

}

else if(j>=g*[3])

{

if(g*[3]+b[i-1][j]<=w)

{

a*[j]=max(((g*[1]g[2])+a[i-1][j]),g*[1]g[2]);

b*[j]=g*[3]+b[i-1][j];

}

else

{

a*[j]=a[i-1][j];

b*[j]=b[i-1][j];

}

}

else

{

a*[j]=a[i-1][j];

b*[j]=b[i-1][j];

}

}

}

printf("%d
",a[n][w]);

}

return 0;

}