Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define st first
  5. #define nd second
  6. #define pb push_back
  7.  
  8. typedef pair<int,int> pii;
  9. typedef pair<int,pii> piii;
  10.  
  11. int n , m;
  12.  
  13. main(){
  14.   ios_base::sync_with_stdio(0),cin.tie(0);
  15.   cin >> n >> m;
  16.   if(n >= 2 && m >= 2){
  17.  
  18.     if(n%2 == 1) cout << "1\n";
  19.     cout << "0\n";
  20.  
  21.   }
  22.   if(n%2 == 0 && m == 1) cout << "0\n";
  23.   if(n%2 == 1 && m == 1) cout << "1\n";
  24.   if(n == 1 && m%2 == 0) cout << "2\n";
  25.   if(n == 1 && m%2 == 1) cout << "1\n";
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement