Been trying the following question and i’ve been getting wrong answers on the codechef compiler, and i have no clue why. Heres my solution and heres the question. https://www.codechef.com/problems/CNOTE . I’m new to competitive coding. It’s hard to figure out a solution when you’re not sure what’s wrong with the code. It works for multiple test cases on other compilers
#include<stdio.h>
int main()
{ long long int tries,ppages,lpages,money,books,a[100000]={0},i,j,temppages,flag=0;
int price,npages;
printf("Insert the trails\n");
scanf("%lld",&tries);
for(i=0;i<tries;i++)
{ scanf("%lld %lld %lld %lld",&ppages,&lpages,&money,&books);
if(ppages>lpages){
temppages=ppages-lpages;
for(j=0;j<books;j++)
{ scanf("%d %d",&npages,&price);
if (ppages<=(npages+lpages)&&money>=price)
a[i]=1;
}
if (a[i]==1)
{
printf("Luckychef\n");
}
else
printf("Unluckychef\n");
} }
/* code */
return 0;
}