結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー Lithops
提出日時 2021-03-26 23:34:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 2,037 ms
コンパイル使用メモリ 73,980 KB
実行使用メモリ 54,160 KB
最終ジャッジ日時 2024-11-29 01:51:47
合計ジャッジ時間 7,100 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long A=sc.nextLong();
    long B=sc.nextLong();
    long N=sc.nextLong();
    long M=sc.nextLong();
    if(A>B){
      System.out.println(B+(A-B)/(N+1));
    }
    else{
      System.out.println(A+(B-A)/(M+1));
    }
  }
}
0