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. linux入门系列15--文件传输之vsftp服务

    前面的系列文章基本讲完了linux管理相关的基础知识,从本篇开始讲解centos7中服务程序的部署和配置,以便为外部提供各种服务. 日常工作和娱乐中,我们所需的各种资源都离不开网络以及各种服务,我们通 ...

  2. HTML——label标签

    最近在做将input[type="file"] 改变其样式时,发现label的巨大潜力,特此记录一下. 1, label标签的作用 (1)为input元素定义标注(标记) (2)不 ...

  3. 零基础Python应该怎样学习呢?(附视频教程)

    Python应该怎样学习呢? 阶段一:适合自己的学习方式 对于零基础的初学者来说,最迷茫的是不知道怎样开始学习?那这里小编建议可以采用视频+书籍的方式进行学习.看视频学习可以让你迅速掌握编程的基础语法 ...

  4. dubbo初识

    1.什么是dubbo? dubbo 是一个分布式服务框架 是一个高性能的RPC框架 它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现. 谈到了分布式服务框架 那 ...

  5. SAP MM 采购订单与相关合同的价格差异问题分析

    SAP MM 采购订单与相关合同的价格差异问题分析 笔者所在的项目里,一般生产性物料PO的价格是来自于合同价格的,而合同的价格来自于采购信息记录的价格,业务部门不允许PO里随便改价格的. 但是业务部门 ...

  6. Foxmail for windows 客户端设置和 IMAP、POP3/SMTP 的设置

    Foxmail支持微信扫码.手机验证码.账号密码三种方式新建腾讯企业邮箱. 注意:目前仅foxmail 7.2.11版本支持微信扫码和手机验证码新建腾讯企业邮箱,可以foxmail官网https:// ...

  7. Excel_b_1

    1.Excel简介 数据处理软件,lotus兼容(文件,选项,高级,拉到底,lotus,) 2.Excel功能 数据存储,数据处理,数据分析,数据呈现 3.具体功能 重新认识了Excel,选项,高级选 ...

  8. 更改 Solution (.Sln) file

    Microsoft Visual Studio 2010 的项目为件改为Microsoft Visual Studio 2015默认打开 2010 的Solution (.Sln) file Micr ...

  9. 证明task线程是来源于线程池的,线程重用

    1.线程池是单例的,全局唯一的,设置线程池最大活跃线程数是5,设置后,允许同时并发的Task只有5个,我们开启100个task去做任务,从最后的输出结果看到,虽然开启了100个task,但是线程id始 ...

  10. vue(七)--监听属性(watch)

    1.watch:用来监听每一个属性的变化 2.watch这个对象里面都是函数,函数的名称是data中的属性名称,watch中的函数不需要调用 3.当属性发生改变那么就会触发watch函数,每个函数都会 ...