In the problem fit to play(http://www.codechef.com/problems/PLAYFIT). I am getting wrong answer on the code I used even though I tried all the cases I could think of and I get right answers.Please help.Here’s my code.
#include<iostream>
#define big 100000
int main()
{
int cases;
long matches[big]={0},num,i,j,ans[11]={0},l,max=0;
scanf("%d",&cases);
for(int k=0;k<cases;k++)
{
scanf("%ld",&num);
for(i=0;i<num;i++)
{
scanf("%ld",&matches[i]);
}
for(l=0;l<(num-1);l++)
{
if(matches[l+1]-matches[l]>max)
{
max=matches[l+1]-matches[l];
}
}
if(max>0)
{
printf("%ld\n",max);
}
else
{
printf("UNFIT\n");
}
for(j=0;j<num;j++)
{
matches[j]=0;
}
max=0;
}
}