Search
 
SCRIPT & CODE EXAMPLE
 

CPP

coinPiles

#include<bits/stdc++.h>
using namespace std; 
#define int int64_t
#define pb push_back
#define f(a,b) 
for(int i=a; i<b; i++) 
signed main(){    
  int t; cin>>t;    
  int a, b;    
  while(t--)    
  {        
    cin>>a>>b;        
    while(true)        
    {            
      a>b ? a-=2, b-- : b -= 2,a--;            
      if(a==0 || b==0) break;        
    }        
    if(a==0 && b==0) { cout<<"YES
"; continue; }        
    if(a==0 && b!=0) { cout<<"NO
"; continue; }        
    if(a!=0 || b==0) { cout<<"NO
"; continue; }    
  }    
  return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: solve problem of getline 
Cpp :: uint16_t in c++ 
Cpp :: c++ solver online free 
Cpp :: how-to-read-until-eof-from-cin-in-c++ 
Cpp :: input numbers to int c++ 
Cpp :: c++ break statement 
Cpp :: remove a element from an array c++ 
Cpp :: strcmp in c++ header file 
Cpp :: qtextedit no line break 
Cpp :: what is xor_eq c++ 
Cpp :: input time from console C++ 
Cpp :: c++ stoi binary negative number string to decimal 
Cpp :: static member fn , instance 
Cpp :: Opengl GLFW basic window 
Cpp :: C++ Join thread 
Cpp :: Missing GL version 
Cpp :: c++ to c code converter 
Cpp :: Hash Sort in C++ 
Cpp :: c++ scanf always expects double and not float 
Cpp :: C++ singleton prevent copy 
Cpp :: c++ freecodecamp course 10 hours youtube 
Cpp :: C++ Vector Initialization method 01 
Cpp :: c++ constructor initializing list 
Cpp :: Accepting multiple inputs on the SAME LINE C++ 
Cpp :: how to print std::string 
Cpp :: how to add 2 objects using operator overloading in c++ 
Cpp :: return value from a thread 
Cpp :: find a member variable in a vector of objects cpp 
Cpp :: std::throw_with_nested 
Cpp :: changing key bindings in visual code not working 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =