304282: CF817A. Treasure Hunt

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Treasure Hunt

题意翻译

Bill船长收到一个有趣的挑战,有一些陌生人给了他一张地图和一些能够远程传送的药水………… 简单而言,给你移动方式,让你判断能否从(x1,y1)的位置移动到(x2,y2)的位置 而移动方式如下:输入x,y,你一共有四种移动方式可选择 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/5f61670d9b3608116440491f8884c7a41d992eb9.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/fdee4e4bb66766e4b40f483072f3c9b0b1880af7.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/7517913342c0c19a2f0627ccf2eab647a7b547bf.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/324d1b3af2d1a5e602e1cfc99403662780a262b3.png) 输入格式 第一行输入x1,y1,x2,y2第二行输入x,y 输出格式 如果可以,输出YES,如果不行,输出NO

题目描述

Captain Bill the Hummingbird and his crew recieved an interesting challenge offer. Some stranger gave them a map, potion of teleportation and said that only this potion might help them to reach the treasure. Bottle with potion has two values $ x $ and $ y $ written on it. These values define four moves which can be performed using the potion: - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/5f61670d9b3608116440491f8884c7a41d992eb9.png) - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/fdee4e4bb66766e4b40f483072f3c9b0b1880af7.png) - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/7517913342c0c19a2f0627ccf2eab647a7b547bf.png) - ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/324d1b3af2d1a5e602e1cfc99403662780a262b3.png) Map shows that the position of Captain Bill the Hummingbird is $ (x_{1},y_{1}) $ and the position of the treasure is $ (x_{2},y_{2}) $ . You task is to tell Captain Bill the Hummingbird whether he should accept this challenge or decline. If it is possible for Captain to reach the treasure using the potion then output "YES", otherwise "NO" (without quotes). The potion can be used infinite amount of times.

输入输出格式

输入格式


The first line contains four integer numbers $ x_{1},y_{1},x_{2},y_{2} $ ( $ -10^{5}<=x_{1},y_{1},x_{2},y_{2}<=10^{5} $ ) — positions of Captain Bill the Hummingbird and treasure respectively. The second line contains two integer numbers $ x,y $ ( $ 1<=x,y<=10^{5} $ ) — values on the potion bottle.

输出格式


Print "YES" if it is possible for Captain to reach the treasure using the potion, otherwise print "NO" (without quotes).

输入输出样例

输入样例 #1

0 0 0 6
2 3

输出样例 #1

YES

输入样例 #2

1 1 3 6
1 5

输出样例 #2

NO

说明

In the first example there exists such sequence of moves: 1. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/c2f8ba5eda46198f6f7d9cfa4c6117bc7fc558f4.png) — the first type of move 2. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/4cacb8ebe23d1fb4e06418cad36d9e8cacd3f8c8.png) — the third type of move

Input

题意翻译

Bill船长收到一个有趣的挑战,有一些陌生人给了他一张地图和一些能够远程传送的药水………… 简单而言,给你移动方式,让你判断能否从(x1,y1)的位置移动到(x2,y2)的位置 而移动方式如下:输入x,y,你一共有四种移动方式可选择 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/5f61670d9b3608116440491f8884c7a41d992eb9.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/fdee4e4bb66766e4b40f483072f3c9b0b1880af7.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/7517913342c0c19a2f0627ccf2eab647a7b547bf.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF817A/324d1b3af2d1a5e602e1cfc99403662780a262b3.png) 输入格式 第一行输入x1,y1,x2,y2第二行输入x,y 输出格式 如果可以,输出YES,如果不行,输出NO

加入题单

上一题 下一题 算法标签: