結果

問題 No.236 鴛鴦茶
ユーザー bigbear90560
提出日時 2015-07-15 03:56:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 3,459 ms
コンパイル使用メモリ 78,696 KB
実行使用メモリ 41,416 KB
最終ジャッジ日時 2024-06-28 12:52:53
合計ジャッジ時間 7,758 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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

}
0