My issue
Throws an error in the 2nd test case
My code
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t, n;
cin>>t;
bool ans;
for(int l,s,i=0; i<t; i++)
{
cin>>n>>l>>s;
if (n<=l && ceil(l/2)<=n)
ans = 1;
else
ans = 0;
if (s>=3*(2*n-l) && ans == 1)
cout<<"YES"<<'\n';
else
cout<<"NO"<<'\n';
}
return 0;
}
Problem Link: Decorating Christmas Tree Practice Coding Problem - CodeChef