結果

問題 No.384 マス埋めゲーム2
ユーザー atkrym
提出日時 2016-11-04 11:55:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 534 bytes
コンパイル時間 2,523 ms
コンパイル使用メモリ 74,572 KB
実行使用メモリ 54,240 KB
最終ジャッジ日時 2024-11-25 02:31:40
合計ジャッジ時間 5,684 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        long h = sc.nextLong();
        long w = sc.nextLong();
        long n = sc.nextLong();
        long k = sc.nextLong();
        
        long cnt = h+w-1;
        if (cnt%n==k) {
            System.out.println("YES");
        } else if (n==k&&cnt%n==0) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
0