結果

問題 No.236 鴛鴦茶
ユーザー 8130Tsk8130Tsk
提出日時 2015-08-19 00:45:55
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 4,152 ms
コンパイル使用メモリ 75,388 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2024-07-18 10:17:13
合計ジャッジ時間 6,461 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No236 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		
		double w1=x*b/a - y;
		double w2=y*a/b - x;
		
		System.out.println(w1);
		System.out.println(w2);
		
		double d;
		
		if(w1<0){
			d = (double)x*b/a + x;
		}else if(w2<0){
			d = (double)y*a/b + y;
		}else{
			d = x+y;
		}
		
		System.out.printf("%.8f\n", d);
	}

}
0