This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include <fstream>
//#define endl '\n'
#define mod 1000000007
#define INF 9000000000000000
using namespace std;
//ofstream fout("intel.out");
//ifstream fin("intel.in");
const int Max = 3e5 + 5;
int cnt[Max];
int main()
{
ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
long long w, h, k; cin >> w >> h >> k;
if(k == 0) {
if((w%3 == 0 && h%2 == 0) ||(w%2 == 0 && h%3 == 0) ) cout << "YES";
else if((w%2 == 0 && w%3 == 0 && h%3 == 1 && h - 4 > 0) || (w%2 == 0 && w%3 == 0 && h%3 == 2 && h -2 > 0) || (w%2 == 0 && w%3 == 0 && h%2 == 1 && h - 3 > 0)) cout <<"YES";
else if((w%3 == 1 && h%2 == 0 && h%3 == 0 && w - 4 > 0) || (w%3 == 2 && h%2 == 0 && h%3 == 0 && w -2 > 0) || (w%2 == 1 && h%3 == 0 && h%2 == 0 && w - 3 > 0)) cout << "YES";
else cout << "NO";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |