結果

問題 No.236 鴛鴦茶
ユーザー prog470
提出日時 2016-09-25 10:22:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 549 ms
コンパイル使用メモリ 69,068 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 13:08:39
合計ジャッジ時間 1,292 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;

int main() {

	double A, B, X, Y;
	cin >> A >> B >> X >> Y;

	double m = -1.0;
	if (B*X <= A*Y) {
		m = max(m, X + X*(B/A));
	}
	if (B*X >= A*Y) {
		m = max(m, Y + Y*(A / B));
	}

	//printf_s("%.9lf\n", m);
	printf("%.9lf\n", m);

	return 0;
}
0