This post was flagged by the community and is temporarily hidden.
This post was flagged by the community and is temporarily hidden.
I have consider that test case and i have update my code i have take long long int data type instead of int. but still it shows wrong anwer. my following is updated code.
#include<stdio.h>
int main()
{
long long int num;
scanf("%lld",&num);
for(int i=0;i<num;i++)
{
long long int c,d,l,cl,dl,sum,n,j,ans,cnt;
scanf("%lld %lld %lld",&c,&d,&l);
cl=0;
dl=0;
sum=0;
n=0;
ans=0;
sum=0;
cnt=0;
cl=c*4;
dl=d*4;
sum=cl+dl;
n=c+1;
for(j=1;j<=n;j++)
{
ans=sum/j;
if(ans==l)
{
printf("yes\n");
cnt++;
break;
}
}
if(cnt==0)
{
printf("no\n");
}
}
return 0;
}
If this is a temp acc then delete it.