結果

問題 No.236 鴛鴦茶
ユーザー bigbear90560
提出日時 2015-07-15 03:45:02
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 3,262 ms
コンパイル使用メモリ 75,004 KB
実行使用メモリ 41,676 KB
最終ジャッジ日時 2024-07-08 07:35:48
合計ジャッジ時間 7,150 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 5 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * No.236 鴛鴦茶
 */
public class OshidoriTea {

	public static void main(String[] args) {

		// 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();

        int l = a * y;
        int r = b * x;
        
        double d = 0d;
        if (r < l) {
        	d = x + y - (r - l) / (double) a;
        } else {
        	d = x + y - (l - r) / (double) b;
        }
        
    	System.out.println(d);
	}

}
0