Official

A - 16:9 Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.
Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in “AtCoder Beginners Selection” (https://atcoder.jp/contests/abs).


\(X:Y=16:9\) is equivalent to \(\dfrac{X}{16}=\dfrac{Y}{9}\).

Cancelling the denominators yields \(9X=16Y\), which allows us to use integer comparison only.

X, Y = map(int, input().split())
if X * 9 == Y * 16:
    print("Yes")
else:
    print("No")

posted:
last update: