The Preliminary Contest for ICPC Asia Xuzhou 2019 徐州网络赛 C Buy Watermelon

2020-10-28 10:15:45 浏览数 (1)

The hot summer came so quickly that Xiaoming and Xiaohong decided to buy a big and sweet watermelon. But they are two very strange people. They are even-numbered enthusiasts. They want to cut the watermelon in two parts, and each part weighs two times as much as a kilogram .They quickly decide which melon to buy. Do you know if you want to buy this melon?

Input

Only one line contains one integer ww (1leq wleq 100)(1≤w≤100),units are kilograms.

Output

If it can meet the requirements, you will output YES, otherwise output NO.

样例输入复制

代码语言:javascript复制
8

样例输出复制

代码语言:javascript复制
YES

这个题判断能不能把这个数分成两个偶数,然后一开始以为是对半分,WA了一发,后来发现不是,那么任意分的话除了2的所有的偶数都可以。

代码语言:javascript复制
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#define N 100010
using namespace std;
int main()
{   int w;
    cin>>w;
    if(w==2||w%2)cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
}

0 人点赞