当你发现你的答案正确率为80%请看这个原题(加粗斜体为重点)

One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.
Pete and Billy are great fans of even numbers, that’s why 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 boys are extremely tired and want to start their meal as soon as possible, that’s why you should help them and find out, if they can divide the watermelon in the way they want. For sure, each of them should get a part of positive weight.

Input
The first (and the only) input line contains integer number w (1 ≤ w ≤ 100) — the weight of the watermelon bought by the boys.

Output
Print YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.

Examples

Input

8

Output

YES

Note
For example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively (another variant — two parts of 4 and 4 kilos).




全部评论
一个炎热的夏天,皮特和他的朋友比利决定买一个西瓜。在他们看来,他们选择了最大和最成熟的一个。在那之后,西瓜被称重,天平显示w公斤。他们急忙赶回家,口渴而死,决定把浆果分给他们,但是他们面临着一个棘手的问题。 皮特和比利是偶数的忠实粉丝,这就是为什么他们想用这样一种方式来划分西瓜,那就是两个部分的重量都是偶数公斤的原因。, 同时,这两个部分不是必须相等的。。男孩们非常累,想尽快开始吃饭,这就是为什么你应该帮助他们,找出他们是否可以按照他们想要的方式来分配西瓜。当然,他们中的每一个人都应该得到一部分积极的体重。 输入 第一个(也是唯一的)输入行包含整数w(1≤w≤100)-男孩购买的西瓜的重量。 输出量 如果男孩们能把西瓜分成两部分,每个分量都是偶数公斤;相反的情况下,不行。 实例 输入 8 输出量 是 注 例如,男孩可以将西瓜分成2公斤和6公斤(另一种变体-4公斤和4公斤的两部分)。
2
送花
回复
分享
发布于 2019-05-23 01:30
#include <cstdio> int main() {     int weight;     scanf("%d", &weight);     if (weight & 1 || weight <= 2) // 判断奇偶按位与一下就行 // 如果结果是1,就是奇,0就是偶         puts("NO, you can't divide the watermelon into two even parts.");     else         puts("YES, you can divide the watermelon into two even parts.");     return 0; }
1
送花
回复
分享
发布于 2019-12-26 17:46
滴滴
校招火热招聘中
官网直投
同时,这两个部分不是必须相等的 这是关键
点赞
送花
回复
分享
发布于 2019-05-23 01:30
#include <bits/stdc++.h> int main() {     int weight,flag = 0;     scanf("%d",&weight);     for(int i = 2;i < weight;i = i + 2)     {         for(int j = 2;j < weight;j = j + 2)         {             if(i + j == weight)             {                 flag = 1;                 break;             }         }     }     if(flag)         printf("YES, you can divide the watermelon into two even parts.");     else         printf("NO, you can't divide the watermelon into two even parts.");     return 0; }
点赞
送花
回复
分享
发布于 2019-05-23 01:35
这么简单的题,想这么多干嘛😅
点赞
送花
回复
分享
发布于 2019-05-31 18:36
就是在判断奇偶那题的基础上加了个考虑边界条件的判断而已,想那么多干什么。
点赞
送花
回复
分享
发布于 2019-09-07 09:05

相关推荐

4 收藏 评论
分享
牛客网
牛客企业服务