結果

問題 No.236 鴛鴦茶
ユーザー dazy
提出日時 2017-03-08 00:26:27
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 3,454 ms
コンパイル使用メモリ 74,672 KB
実行使用メモリ 41,676 KB
最終ジャッジ日時 2024-06-28 13:10:40
合計ジャッジ時間 7,611 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        double ans = 0;

        int A = scan.nextInt();
        int B = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        double r = ((double) B)/A;
        double x = ((double) X);
        double y = X * r;

        if (Y < y) {
            y = Y;
            x = Y * (1/r);
        }

        ans = x + y;

       System.out.println(ans);
    }
}
0