#include <iostream>
using namespace std;
class catanddog
{public:
int c,d,l,t;
void count()
{
cin>>t;
while(t--){
cin>>c>>d>>l;
long int u=l-4*d;
if(u<0||(u%4!=0)||u>4*c)
cout<<"no";
else cout<<"yes";
cout<<endl;
}
}
}obj;
int main()
{
obj.count();
return 0;
}
using namespace std;
class catanddog
{public:
int c,d,l,t;
void count()
{
cin>>t;
while(t--){
cin>>c>>d>>l;
long int u=l-4*d;
if(u<0||(u%4!=0)||u>4*c)
cout<<"no";
else cout<<"yes";
cout<<endl;
}
}
}obj;
int main()
{
obj.count();
return 0;
}
Test case 3 and 4 keep failing
ReplyDeletetestcase 3 & 4 failed
ReplyDelete#include
Deleteusing namespace std;
class catanddog
{public:
int c,d,l,t;
void count()
{
cin>>t;
while(t--){
cin>>c>>d>>l;
long int u=l-4*d;
if(u<0||(u%4!=0)||u>4*c)
cout<<"no";
else cout<<"yes";
cout<<endl;
}
}
}obj;
int main()
{
catanddog pets;
pets.count();
return 0;
}
use this
Delete-latest update-
ReplyDeleteThis is correct
Y we r using t--
ReplyDeletefor testcases
Delete#include
ReplyDeleteusing namespace std;
class catanddog
{public:
int c,d,l,t;
void count()
{
cin>>t;
while(t--){
cin>>c>>d>>l;
long int u=l-4*d;
if(u<0||(u%4!=0)||u>4*c)
cout<<"no";
else cout<<"yes";
cout<<endl;
}
}
}obj;
int main()
{
catanddog pets;
pets.count();
return 0;
}