-->
当前位置:首页 > 题库

PROGRAMMING:Little pony

Luz5年前 (2021-05-10)题库396
Here's a ` n × There is a horse on M's chessboard. Keven now wants to know if the horse can reach all the points on the chessboard, so he asks you for advice. Can you help him solve this problem?
A horse can only walk. Suppose that the horse is on the * * point (x, y) * *, it can only jump to eight * * points (x − 2, y − 1), (X-2, y + 1), (x-1, Y-2), (x-1, y + 2), (x + 1, Y-2), (x + 1, y + 2), (x + 2, Y-1), (x + 2, y + 1).
No matter when, the horse can't jump off the chessboard.
###Input format:
Multiple cases, each case gives 2 positive integers n and m not more than 10000 in a row.
###Output format:
If the horse can go to all the points, output 'yes'. Otherwise, output' no '.
###Input example:
```in
4 4
```
###Output example:
```out
Yes
```
###Tips
Multi group input
###Explain the case
![ Tim image 2019030314014. PNG] (~ / cdab4b2b-00f3-47a4-8926-ac9bdfdbeb2a. PNG)
The horse can go to all 16 points in the graph, so it outputs yes< br>





answer:If there is no answer, please comment