Advertisement
semsem_elazazy

Untitled

Feb 7th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6.  long long  n;
  7.    cin>> n;
  8.    while(n--)
  9.    {
  10.    long long a,b ;
  11.     cin>>a>>b;
  12.     if (a==b)
  13.     {
  14.         if((a*b)%2==0)
  15.         cout<<"YES"<<" "<<(a*b)/2;
  16.         else
  17.         cout<<"NO";
  18.     }
  19.     else
  20.     {
  21.     cout<<"NO";
  22.     }
  23.     cout <<endl;
  24.    
  25.    }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement