Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define st first
- #define nd second
- #define pb push_back
- typedef pair<int,int> pii;
- typedef pair<int,pii> piii;
- int n , m;
- main(){
- ios_base::sync_with_stdio(0),cin.tie(0);
- cin >> n >> m;
- if(n >= 2 && m >= 2){
- if(n%2 == 1) cout << "1\n";
- cout << "0\n";
- }
- if(n%2 == 0 && m == 1) cout << "0\n";
- if(n%2 == 1 && m == 1) cout << "1\n";
- if(n == 1 && m%2 == 0) cout << "2\n";
- if(n == 1 && m%2 == 1) cout << "1\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement