Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon 水题
A. Watermelon
题目连接:
http://www.codeforces.com/contest/4/problem/A
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
8
Sample Output
YES
Hint
题意
给你一个数,问你能不能把这个数分成两个偶数之和。
题解:
先分出一个2,然后看剩下的是不是偶数就好了。
水题。
代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
if(n<=2)return puts("NO"),0;
if(n%2==0&&(n-2)%2==0)
return puts("YES"),0;
return puts("NO"),0;
}
Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon 水题的更多相关文章
- Codeforces Beta Round #14 (Div. 2) C. Four Segments 水题
C. Four Segments 题目连接: http://codeforces.com/contest/14/problem/C Description Several months later A ...
- Codeforces Beta Round #14 (Div. 2) B. Young Photographer 水题
B. Young Photographer 题目连接: http://codeforces.com/contest/14/problem/B Description Among other thing ...
- Codeforces Beta Round #6 (Div. 2 Only) A. Triangle 水题
A. Triangle 题目连接: http://codeforces.com/contest/6/problem/A Description Johnny has a younger sister ...
- codeforces水题100道 第二题 Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon (math)
题目链接:http://www.codeforces.com/problemset/problem/4/A题意:一个整数能否表示成两个正偶数的和.C++代码: #include <cstdio& ...
- Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon【暴力/数学/只有偶数才能分解为两个偶数】
time limit per test 1 second memory limit per test 64 megabytes input standard input output standard ...
- Codeforces Beta Round #80 (Div. 2 Only)【ABCD】
Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一 ...
- Codeforces Beta Round #83 (Div. 1 Only)题解【ABCD】
Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0 ...
- Codeforces Beta Round #79 (Div. 2 Only)
Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++. ...
- Codeforces Beta Round #77 (Div. 2 Only)
Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h ...
随机推荐
- java反序列化漏洞
http://www.freebuf.com/vuls/86566.html 有时间了 仔细阅读
- Linux kernel kfifo分析【转】
转自:https://zohead.com/archives/linux-kernel-kfifo/ 本文同步自(如浏览不正常请点击跳转):https://zohead.com/archives/li ...
- MySQL指定使用某个索引查询语句
查询语句查询emp_no,所以先查询emp_no的索引使用primary select emp_no,salary from salaries use index(s_f_t) where emp_n ...
- 安装sudo apt-get install ros-kinetic-desktop-full,报错mv: 无法获取'/var/lib/ni/licenses.xml.dpkg-old' 的文件状态(stat): 没有。。。。
安装sudo apt-get install ros-kinetic-desktop-full,报了一堆错误 mv: 无法获取'/var/lib/ni/licenses.xml.dpkg-old' 的 ...
- Java web项目中新建maven项目出现的问题
1.首先新建maven项目,新建Maven时出现了版本问题,报错 第一个错误:jdk版本与project facets不匹配(大概是这样,忘记截图了),那么解决办法是: 在项目右击--->Pro ...
- CSU 1102 多连块拼图
多连块拼图 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 多连块是指由多个等大正方形边与边连接而成的平面连通图形. ———— 维基百科 ...
- iOS开发:用DES对字符串加解密
参考http://www.cnblogs.com/janken/archive/2012/04/05/2432930.html,做了个小修改,实现PHP,JAVA,Objective-c加解密结果相同 ...
- python开发学习-day04(迭代器、生成器、装饰器、二分查找、正则)
s12-20160123-day04 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: ...
- URL and Ajax Helper Methods
1.Unobtrusive Ajax
- [实战]MVC5+EF6+MySql企业网盘实战(8)——文件下载、删除
写在前面 上篇文章通过iframe实现了文件的无刷新上传.这篇我们将实现文件的下载与删除. 系列文章 [EF]vs15+ef6+mysql code first方式 [实战]MVC5+EF6+MySq ...