結果

問題 No.236 鴛鴦茶
コンテスト
ユーザー bigbear90560
提出日時 2015-07-15 03:56:16
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 629 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,702 ms
コンパイル使用メモリ 82,896 KB
実行使用メモリ 46,696 KB
最終ジャッジ日時 2026-03-17 06:28:53
合計ジャッジ時間 4,565 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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 (l >= r) {
        	d = x + y - (l - r) / (double) a;
        } else {
        	d = x + y - (r - l) / (double) b;
        }
    	System.out.printf("%.8f\n",d);
	}

}
0