My issue
IN this problem binary sum, the input format is not described correctly.
they have nowhere mentioned that we need to take the input of number of test cases as well.
My code
#include <bits/stdc++.h>
using namespace std;
using ll =long long ;
void bramhastra(){
int n; cin>>n;
int k; cin>>k;
if(n%2!=0){
if(k==n/2+1 || k==n/2) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
else{
if(k==n/2) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
int main() {
int t=1;
cin>>t;
while(t--){
bramhastra();
}
return 0;
}
Problem Link: Binary Sum Practice Coding Problem