結果

問題 No.236 鴛鴦茶
ユーザー 西尾西尾
提出日時 2018-03-14 13:13:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 1,589 ms
コンパイル使用メモリ 165,328 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 13:15:21
合計ジャッジ時間 2,382 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
int i;
int A;
int B;
int X;
int Y;

	cin >> A;
	cin >> B;
	cin >> X;
	cin >> Y;

	i = A * Y - B * X;
	if( i > 0 )
		printf( "%.7f\n", (double) ( B * X ) / A + X );
	else if( i < 0 )
		printf( "%.7f\n", (double) ( A * Y ) / B + Y );
	else
		cout << X + Y << endl;

	return 0;
}
0