Codeforces - Watermelon
1 second
64 megabytes
standard input
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.
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; and NO in the opposite case.
Input
8
Output
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).
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
题意:分开的两部分都是正偶数输出YES,否则输出NO
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int w;
cin>>w; if(w%==&&w!=)
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
return ;
}
Codeforces - Watermelon的更多相关文章
- Watermelon -- codeforces
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93241#problem/A (654123) http://codeforces.co ...
- 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 ...
- 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 - A. Watermelon
A. Watermelon time limit per test 1 second memory limit per test 64 megabytes input standard input o ...
- CodeForces 4A
A A - Water~melon Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit St ...
- Codeforces初体验
Codeforces印象 这两天抽时间去codeforces体验了一把. 首先,果然有众多大牛存在.非常多名人一直參加每周一次的比赛.积分2000+,并參与出题. 另外.上面题目非常多.预计至少一千题 ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
随机推荐
- 开放融合易用@门户移动开发新体验-逐浪CMS v8.0.1全面发布
北京时间2019年8月30日消息: 领先的web内核研发厂商--上海Zoomla!逐浪CMS团队发布最新CMS版本:Zoomla!逐浪CMS v8.0.1,这是继上个版本v8.0后功能最具完强大与精彩 ...
- hough变换算法
1.算法思想 边缘检测比如canny算子可以识别出图像的边缘,但是实际中由于噪声和光照不均匀等因素,很多情况下获得的边缘点是不连续的,必须通过边缘连接将他们转换为有意义的边缘.Hough变化是一个重要 ...
- Docker基本概念及架构
一.Docker基本概念 Docker是一个开源的容器引擎,基于Go 语言并遵从 Apache2.0 协议开源.Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布 ...
- sql语句的基本用法总结
一.sql语法 select */列名1,列名2... from 表名[连接查询 内连接/左连接 on条件] 必选的 where 条件 子查询/in/exists/between ... and .. ...
- Swift中的感叹号( ! )与问号( ? )之谜
基本了解 在Swift代码会经常看到定义属性或方法参数时类型后面会紧跟一个感叹号( ! )或问号( ? ), 刚开始接触Swift的童鞋就可能不太明白之代表什么意思,一头雾水,开始凌乱了. 本文将带你 ...
- 趣学Spring:一文搞懂Aware、异步编程、计划任务
你好呀,我是沉默王二,一个和黄家驹一样身高,刘德华一样颜值的程序员(不信围观朋友圈呗).从 2 位偶像的年纪上,你就可以断定我的码龄至少在 10 年以上,但实话实说,我一直坚信自己只有 18 岁,因为 ...
- JavaScript----简介及基础语法
##JavaScript *概念:一门客户端脚本语言 *运行在客户端浏览器中的.每一个浏览器都有JavaScript的解析引擎. *脚本语言:不需要编译,直接就可以被浏览器解析执行. *功能: *可以 ...
- Ruby使用记录
1.首先,重要的事情说三遍,不用在Windows里开发Ruby 1.第一次在windows里安装ruby,装的最新版,当时就遇到了很奇怪的编码问题,如运行命令gem install xxx,提示编码错 ...
- mycat主要参数
以下内容源于mycat官方文档,记录下来方便直接查看: mycat版本:1.6 负载均衡类型,目前的取值有 3 种:1. balance="0", 不开启读写分离机制,所有读操作都 ...
- 基于海龟编辑器python少儿编程
Python 少儿教程 为什么要学习编程 扫地机器人.物流机器人.自动泊车系统.无人超市.3D打印.微信.支付宝等等,随着人工智能时代的到来,越来越多的岗位将被机器人所替代. 所以,学习编程的最终目的 ...