Last active
July 9, 2021 15:02
-
-
Save uchidama/fd19e6322a80e87e24abbd8c0d8ee84a to your computer and use it in GitHub Desktop.
AtCoder Beginner Contest 170 [ B - Crane and Turtle ] https://atcoder.jp/contests/abc170/tasks/abc170_b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc170/tasks/abc170_b | |
[解説] | |
https://blog.hamayanhamayan.com/entry/2020/06/14/231810 | |
制約がひくいから、基本総当たりで問題ないみたいだ。 | |
2次方程式の計算で出しちゃったけど。 | |
''' | |
import sys | |
import math | |
sys.setrecursionlimit(10 ** 6) # 再帰上限の引き上げ | |
input = sys.stdin.readline | |
INF = 2 ** 63 - 1 | |
X, Y = map(int, input().split()) | |
B = Y/2 - X | |
A = X - B | |
if math.ceil(B) != B or math.ceil(A) != A: | |
# 0.5とか端数がでるケースをチェック。端数でるのはダメ | |
print("No") | |
exit() | |
# 整数でA,Bが0以上か | |
if B >= 0 and A >= 0: | |
print("Yes") | |
else: | |
print("No") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment