Horje
coinPiles Code Example
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\n"; continue; }        
    if(a==0 && b!=0) { cout<<"NO\n"; continue; }        
    if(a!=0 || b==0) { cout<<"NO\n"; continue; }    
  }    
  return 0;
}
Source: cses.fi




Cpp

Related
how to calculate 2^7 in cpp code Code Example how to calculate 2^7 in cpp code Code Example
age in days in c++ Code Example age in days in c++ Code Example
What should main() return in C++? Code Example What should main() return in C++? Code Example
explicit c++ Code Example explicit c++ Code Example
factorial MOD 998244353 Code Example factorial MOD 998244353 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11