結果

問題 No.85 TVザッピング(1)
ユーザー lam6er
提出日時 2025-04-16 15:43:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 82,064 KB
実行使用メモリ 53,972 KB
最終ジャッジ日時 2025-04-16 15:46:12
合計ジャッジ時間 2,382 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, c = map(int, input().split())

x = (c - 1) // m + 1
y = (c - 1) % m + 1

is_corner = (x == 1 or x == n) and (y == 1 or y == m)

if n == 1 or m == 1:
    print("YES")
elif n == 2 and m == 2:
    print("NO")
else:
    if is_corner:
        if n % 2 == 1 and m % 2 == 1:
            print("NO")
        else:
            print("YES")
    else:
        print("YES")
0