codeforces 4A watermelon
来源:互联网 发布:java前端好还是后端好 编辑:程序博客网 时间:2024/05/22 06:19
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 showedw 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.
The first (and the only) input line contains integer number w (1 ≤ w ≤ 100) — the weight of the watermelon bought by the boys.
Print YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; andNO in the opposite case.
8
YES
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).
AC:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int w;
while(scanf("%d",&w)==1)
{
if(w%2==1||w==2)
printf("NO\n");
else
printf("YES\n");
}
return 0;
}
记得w=2时也分不成
- codeforces 4A Watermelon
- Codeforces 4A. Watermelon
- CodeForces 4A-Watermelon
- codeforces-4A-Watermelon
- Codeforces 4A Watermelon
- codeforces 4A watermelon
- Codeforces Round #4A. Watermelon
- Codeforces 4A-Watermelon(题意)
- Problem--4A--Codeforces--Watermelon
- codeforces 4A Watermelon(数学水题)
- CodeForces 4A Watermelon(水题)
- CodeForces 4 A.Watermelon(水~)
- CodeForces 4 A.Watermelon(水)
- codeforces Round4 A. Watermelon
- 【CodeForces】A. Watermelon
- Codeforces Beta Round #4 (Div. 2) / 4A Watermelon(数学)
- Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon
- Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon
- linux查看磁盘挂载的文件系统
- VLAN Trunk在OpenStack Neutron及SDN中的实现
- 对称矩阵、稀疏矩阵及矩阵的逆置与加法
- 数据库秒级平滑扩容架构方案
- 时间序列笔记(二)
- codeforces 4A watermelon
- 工作学习日(第一周)[1day]-----H5语义化标签
- int ,long , long long类型的范围
- 训练日记
- 记录第一次博客
- 《HTTP图解》
- 11月23日
- 漫步最优化四十五——矩阵S的生成
- day04