The problem is labelled “Watermelon” and I’ve enjoyed it so much! I encourage you to try to solve it by yourself.
The problem: they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts are equal.
The solution I’ve found:
#include <iostream>
using namespace std;
int main(){
int w = 0;
cin >> w;
int part1 = w / 2;
int part2 = w - part1;
int temp = 0;
while(part1 % 2 != 0){
temp = 1;
part1 = part1 - temp;
}
part2 = part2 + temp;
if(part1 % 2 == 0 && part2 % 2 == 0 && w > 2){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
return 0;
}
You’ll find the full problem description at https://codeforces.com/contest/4/problem/A.