A

A - Water~melon

Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u

Submit

Status

Practice

CodeForces 4A

Description

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.

Sample Input

Input

8

Output

YES

Hint

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 <stdio.h>
int main (){
int n;
scanf("%d",&n);
if(n==2) printf("NO");
else if (n%2==0) printf("YES");
else printf("NO");
return 0;
}

题意:如果一个数可以被拆成两个偶数相加,即输出YES,等价于输入一个数,如果这个数是偶数,输出YES,否则输出NO

注意:2 要单独考虑输出NO

zsy:

题意:给出一个1-100的数,判断能否拆成两个偶数之和。

思路:所有除二以外的偶数都可拆成两个偶数之和。

//#define LOCAL
#include <stdio.h> int main(){
int w;
#ifdef LOCAL
freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
#endif
while(~scanf("%d",&w)){
if(w==2) { //注意对w==2的情况
printf("NO\n");
continue;
}
if(w%2==0) printf("YES\n");
else printf("NO\n");
}
return 0;
}

CodeForces 4A的更多相关文章

  1. Watermelon -- codeforces

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93241#problem/A  (654123) http://codeforces.co ...

  2. codeforces4A

    Watermelon CodeForces - 4A Qingyu有一个简单的问题想让你解决. 输入一个数,如果它是2,或者它是奇数,输出NO,否则输出YES. 很简单吧,因此你应该很快解决. 输入 ...

  3. Codeforces 725B Food on the Plane

    B. Food on the Plane time limit per test:2 seconds memory limit per test:256 megabytes input:standar ...

  4. Codeforces 438E The Child and Binary Tree - 生成函数 - 多项式

    题目传送门 传送点I 传送点II 传送点III 题目大意 每个点的权值$c\in {c_{1}, c_{2}, \cdots, c_{n}}$,问对于每个$1\leqslant s\leqslant ...

  5. Codeforces 488B - Candy Boxes

    B. Candy Boxes 题目链接:http://codeforces.com/problemset/problem/488/B time limit per test 1 second memo ...

  6. Codeforces初体验

    Codeforces印象 这两天抽时间去codeforces体验了一把. 首先,果然有众多大牛存在.非常多名人一直參加每周一次的比赛.积分2000+,并參与出题. 另外.上面题目非常多.预计至少一千题 ...

  7. Codeforces Round #586 (Div. 1 + Div. 2) D. Alex and Julian

    链接: https://codeforces.com/contest/1220/problem/D 题意: Boy Dima gave Julian a birthday present - set ...

  8. [Codeforces 163D]Large Refrigerator (DFS+剪枝)

    [Codeforces 163D]Large Refrigerator (DFS+剪枝) 题面 已知一个长方体的体积为V,三边长a,b,c均为正整数,求长方体的最小表面积S V以质因数分解的形式给出 ...

  9. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

随机推荐

  1. VMware workstation 14 Pro下载、安装及激活码

    虚拟机安装 1.百度搜索VMware应用程序 2.功能介绍 3.下载完成 4.开始安装 双击应用程序开始安装 5.点击“下一步” 6.勾选“我接受” 选择“下一步” 7.安装文件的选择:1.默认安装路 ...

  2. nexus下载远程maven中央仓库的解决方案

    参考:http://www.linuxidc.com/Linux/2014-03/98708.htm https://repo.maven.apache.org/maven2/.index/ 下载这两 ...

  3. 洛谷 P4515 [COCI2009-2010#6] XOR

    题意 平面直角坐标系中有一些等腰直角三角形,且直角边平行于坐标轴,直角顶点在右下方,求奇数次被覆盖的面积.N<=10.输入为x,y,r,分别表示三角形顶点的坐标与三角形的边长. 如: 总面积为0 ...

  4. python logging模块,升级print调试到logging。

    简介: 我们在写python程序的时候,很多时候都有bug,都是自己写的,自己造的孽,又的时候报错又是一堆,不知道是那部分出错了. 我这初学者水平,就是打print,看哪部分执行了,哪部分没执行,由此 ...

  5. vue-router-4-编程式导航

    想要导航到不同的 URL,用 router.push 方法,会向 history 栈添加一个新的记录 <router-link> <==>router.push // 字符串 ...

  6. Android开发 ---从互联网上下载文件,回调函数,图片压缩、倒转

     Android开发 ---从互联网上下载文件,回调函数,图片压缩.倒转 效果图: 描述: 当点击“下载网络图像”按钮时,系统会将图二中的照片在互联网上找到,并显示在图像框中 注意:这个例子并没有将图 ...

  7. 循环神经网络-RNN入门

    首先学习RNN需要一定的基础,即熟悉普通的前馈神经网络,特别是BP神经网络,最好能够手推. 所谓前馈,并不是说信号不能反向传递,而是网络在拓扑结构上不存在回路和环路. 而RNN最大的不同就是存在环路. ...

  8. vue 手写组件 集合

    Num.1 :  链接 向右滑动, 显示删除按钮,  根据touchStart touchEnd 的 clientX 差距 > 30; 说明是向左滑动, 显示; 改变 e.currentTarg ...

  9. php usort

    <?phpfunction re($a,$b){ return ($a>$b)?1:-1; }$x=array(1,3,2,5,9);usort($x, 're');print_r($x) ...

  10. ArrayList方法综合练习

    package com.zs.windows; import java.util.ArrayList; import java.util.Scanner; import com.zs.entity.G ...