Codeforces 1327A. Sum of Odd Integers Solution
Solution in C++:
///**********ALLAH IS ALMIGHTY************///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include<iostream>
- using namespace std;
- int main()
- {
- long long t,n,k;
- cin>>t;
- while(t--)
- {
- cin>>n>>k;
- if(k*k<=n)
- {
- if((n+k)%2==0)
- cout<<"YES"<<endl;
- else
- cout<<"NO"<<endl;
- }
- else
- cout<<"NO"<<endl;
- }
- }
No comments