Niloy007

Sum of Odd Integers

Mar 25th, 2020
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     long long t, n, k, sum = 0, count = 0;
  6.     cin >> t;
  7.     while(t--) {
  8.         cin >> n >> k;
  9.         if(k * k <= n && (n % 2 == k % 2))
  10.             cout << "YES" << endl;
  11.         else
  12.             cout << "NO" << endl;
  13.     }
  14. }
RAW Paste Data