time limit per test

1 second

memory limit per test

64 megabytes

input

standard input

output

standard output

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 test(s)
input
8
output
YES

【分析】:给你一个数,能不能分成两个全是偶数的数。

【分析】:暴力枚举或者由偶数只能->偶数+偶数->该数是除了2以外的偶数就输出YES

【代码】:

#include<bits/stdc++.h>
using namespace std; #define LL long long
using namespace std;
int n;
int main()
{
cin>>n;
int f=;
for(int i=;i<=n/;i++)
{
if((i%==)&&((n-i)%==))
{
f=;
break;
}
}
if(f) puts("YES");
else puts("NO");
return ;
}

暴力枚举

#include<bits/stdc++.h>
using namespace std; #define LL long long
using namespace std;
int n;
int main()
{
cin>>n;
int f=;
if(n%==&&n!=)
f=;
if(f) puts("YES");
else puts("NO");
return ;
}

数学

Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon【暴力/数学/只有偶数才能分解为两个偶数】的更多相关文章

  1. Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon 水题

    A. Watermelon 题目连接: http://www.codeforces.com/contest/4/problem/A Description One hot summer day Pet ...

  2. codeforces水题100道 第二题 Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon (math)

    题目链接:http://www.codeforces.com/problemset/problem/4/A题意:一个整数能否表示成两个正偶数的和.C++代码: #include <cstdio& ...

  3. Codeforces Beta Round #80 (Div. 2 Only)【ABCD】

    Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一 ...

  4. Codeforces Beta Round #83 (Div. 1 Only)题解【ABCD】

    Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0 ...

  5. Codeforces Beta Round #79 (Div. 2 Only)

    Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++. ...

  6. Codeforces Beta Round #77 (Div. 2 Only)

    Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h ...

  7. Codeforces Beta Round #76 (Div. 2 Only)

    Codeforces Beta Round #76 (Div. 2 Only) http://codeforces.com/contest/94 A #include<bits/stdc++.h ...

  8. Codeforces Beta Round #75 (Div. 2 Only)

    Codeforces Beta Round #75 (Div. 2 Only) http://codeforces.com/contest/92 A #include<iostream> ...

  9. Codeforces Beta Round #74 (Div. 2 Only)

    Codeforces Beta Round #74 (Div. 2 Only) http://codeforces.com/contest/90 A #include<iostream> ...

随机推荐

  1. 点击事件处理, 以及hitTest:withEvent:实现

    发送触摸事件后, 系统会将事件添加到系统UIApplication的事件管理队列中 UIApplication会在事件队列的最前端取出事件,然后分发下去,以便处理, 通常会把事件首先分发给KeyWin ...

  2. 怎么用 copy 关键字?

    NSString.NSArray.NSDictionary等等经常使用copy关键字,是因为他们有对应的可变类型:NSMutableString.NSMutableArray.NSMutableDic ...

  3. 性能测试之siege

    一.siege介绍 Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数 ...

  4. Java SE 5.0 - SE 8 的功能增强

    Table of Contents 前言 Java 5.0 Generics Enhanced for Loop Autoboxing Typesafe Enums Varargs Static Im ...

  5. 测试基础面试题 + SQL 面试题(选择题有部分答案,难度:低)

    测试基础面试题 + SQL 面试题(选择题有部分答案,难度:低) 答案: .A .C .C .A .A .D

  6. 孤荷凌寒自学python第六十一天在Fedora28版的linux系统上找搭建本地Mongodb数据服务

    孤荷凌寒自学python第六十一天在Fedora28版的linux系统上找搭建本地Mongodb数据服务 (完整学习过程屏幕记录视频地址在文末) 今天是学习mongoDB数据库的第七天.成功在本地搭建 ...

  7. 孤荷凌寒自学python第二十五天初识python的time模块

    孤荷凌寒自学python第二十五天python的time模块 (完整学习过程屏幕记录视频地址在文末,手写笔记在文末) 通过对time模块添加引用,就可以使用python的time模块来进行相关的时间操 ...

  8. 解决LaTex中插入Visio画图有多余边框的问题

    这里的Visio画图是指Visio另存为或导出的PDF格式图片.就目前而言,Visio另存为的EPS格式的图片均可使用PDF格式代替. 问题描述 这里以Visio中画一个矩形为例,如上图所示. 我们为 ...

  9. springboot13 Hikari 和Introspector

    SpringBoot Initializr Introspector(内省) class TestReflect { @Test fun testReflect() { //获取字节码对象 val c ...

  10. 冒泡排序js

    //    冒泡排序     var a = [1,3,2,4,5,3,2,1,4,6,7,7,6,6];     var b =[];     for(var i=0;i<a.length;i ...