Someday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil's home is located in point (0, 0) and Varda's home is located in point (a, b). In each step, he can move in a unit distance in horizontal or vertical direction. In other words, from position (x, y) he can go to positions (x + 1, y), (x - 1, y), (x, y + 1) or (x, y - 1).

Unfortunately, Drazil doesn't have sense of direction. So he randomly chooses the direction he will go to in each step. He may accidentally return back to his house during his travel. Drazil may even not notice that he has arrived to (a, b) and continue travelling.

Luckily, Drazil arrived to the position (a, b) successfully. Drazil said to Varda: "It took me exactly s steps to travel from my house to yours". But Varda is confused about his words, she is not sure that it is possible to get from (0, 0) to (a, b) in exactly s steps. Can you find out if it is possible for Varda?

Input

You are given three integers ab, and s ( - 109 ≤ a, b ≤ 109, 1 ≤ s ≤ 2·109) in a single line.

Output

If you think Drazil made a mistake and it is impossible to take exactly s steps and get from his home to Varda's home, print "No" (without quotes).

Otherwise, print "Yes".

Examples
input
5 5 11
output
No
input
10 15 25
output
Yes
input
0 5 1
output
No
input
0 0 2
output
Yes
Note

In fourth sample case one possible route is: .

题解:记得加绝对值

 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
const int N=;
const int mod=1e9+;
int main()
{
ll a,b,s;
while(cin>>a>>b>>s){
a=llabs(a),b=llabs(b);
int flag=;
if(a+b>s) flag=;
else {
if(a+b==&&s%==) flag=;
else if(a+b==&&s%==) flag=;
else {
ll t=s-(a+b);
if(t%==) flag=;
else flag=;
}
}
if(flag) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return ;
}

Codeforce 515A - Drazil and Date的更多相关文章

  1. codeforces 515A.Drazil and Date 解题报告

    题目链接:http://codeforces.com/problemset/problem/515/A 题目意思:问能否从 (0, 0) 出发,恰好走 s 步,到达该位置(a, b). 首先容易知道, ...

  2. CF Drazil and Date (奇偶剪枝)

    Drazil and Date time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  3. 【codeforces 515A】Drazil and Date

    [题目链接]:http://codeforces.com/contest/515/problem/A [题意] 每次只能走到相邻的四个格子中的一个; 告诉你最后走到了(a,b)走了多少步->s ...

  4. A. Drazil and Date

    这是codeforces#292 div2 的一道题,因为本人比较水,目前只能做div2了.问题简化版就是: 从 (0,0) 走到 (a, b) ,s 步能不能走完.每次能向上下左右走,且只能走一步. ...

  5. CodeForces 515A

    A. Drazil and Date time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  6. Codeforces Round #292 (Div. 2)

    A. Drazil and Date 无算法,判断(s - (a + b)) % 2是否为零,若零,表示在s步内还能走向其他的地方并且回来 否则,都是No #include <cstdio> ...

  7. Codeforce 810C Do you want a date?

    题意: 给定n个不重复的数, 求出这些数的所有子集, 然后设一个数Ni 为 第i个子集中,最大的数 - 最小的数. 然后将i个 Ni求和, 结果mod 1e9 + 7. 分析: 首先将n个数排列,生成 ...

  8. Two progressions CodeForce 125D 思维题

    An arithmetic progression is such a non-empty sequence of numbers where the difference between any t ...

  9. CodeForce 577B Modulo Sum

    You are given a sequence of numbers a1, a2, ..., an, and a number m. Check if it is possible to choo ...

随机推荐

  1. 工作五年的.neter的一些经历感想和对未来的一些疑惑

    本次疫情在家办公快一个月了,节省了上下班的时间,外出活动时间,感觉有好多时间可以利用.人一闲下来就容易想事情,很多事情想不通心里堵的厉害,做事都提不起兴趣.至于想些什么呢,我给大家摆一下. 我的经历 ...

  2. linux中的链接命令

    ln 解释 命令名称:ln 命令英文原意:link 命令所在路径:/bin/ln 执行权限:所有用户 功能描述:生成链接文件 语法 ln -s [源文件] [目标文件] -s 创建软链接 示例 # 创 ...

  3. Vue.js 从源码理解v-for和v-if的优先级的高低

    在vue.js里面,v-for和v-if是可以一起使用作用在某个元素上,网上看到一篇文章说永远不要把v-for和v-if同时用在同一个元素上,感觉有点瞎扯,官网也注明了可以一起使用的,还把两个指令的优 ...

  4. 聊聊GIS中的坐标系|再版 识别各种数据的坐标系及代码中的坐标系

    本篇讲讲在GIS桌面软件和实际数据中,以及各路GIS有关API的编程中,如何寻找坐标系信息.惯例: 本文约2000字,建议阅读时间10分钟. 作者:博客园/B站/知乎/csdn/小专栏 @秋意正寒 版 ...

  5. mybatis postgresql 批量删除

    一.需求介绍 前端是一个列表页面,列表可以进行复选框的选择,后台进行关联表数据的删除. 二.框架介绍 springboot+mybatis 数据库用的postgresql 三.具体代码(前端js) 1 ...

  6. MySQL必知必会--分 组 数 据

    数据分组 目前为止的所有计算都是在表的所有数据或匹配特定的 WHERE 子句的 数据上进行的.提示一下,下面的例子返回供应商 1003 提供的产品数目 但如果要返回每个供应商提供的产品数目怎么办?或者 ...

  7. 批量unzip一大堆压缩文件进行文件查询的办法.

    1. 公司里面开发提交的补丁存在问题. 需要找出来 哪些文件有问题 最简单的办法, 想将一对文件 转移到一个目录里面去 然后创建一个 shell 脚本执行解压缩的操作 for i in `ls *.g ...

  8. 浅析设计模式之mvc、mvp、mvvm

    mvc.mvvm.mvp是常见的设计模式,也是常见的设计思想,现对它们进行简要的归纳总结 三种模式的介绍 1.MVC:经典设计模式 View 传送指令到 Controller(控制器) Control ...

  9. 通过Java代码获取系统信息

    在开发中,我们需要获取JVM中的信息,以及操作系统信息,内存信息,CPU信息,磁盘信息,网络信息等,通过Java的API不能获取内存等信息,需要sigar的第三方依赖包. ①:加入依赖 <dep ...

  10. 硬盘500M,为什么没有500M。10M宽带,为什么网速没有10M?

    在天朝, 硬件厂商用1000代替1024, 通信公司,用 byte来代替bit. 比如 500G的硬盘,应该有 500 * 1024 *1024 *8 = 4.194304*10^9 位 但是按照厂商 ...