結果
| 問題 | 
                            No.236 鴛鴦茶
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-01-27 22:40:26 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 521 bytes | 
| コンパイル時間 | 834 ms | 
| コンパイル使用メモリ | 103,612 KB | 
| 最終ジャッジ日時 | 2025-01-18 08:27:36 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 23 | 
ソースコード
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int main() {
    int32_t a, b, x, y;
    cin >> a >> b >> x >> y;
    double ans;
    if (a * y == b * x)
        ans = x + y;
    else if (a * y < b * x)
        ans = y + double(a * y) / b;
    else
        ans = x + double(b * x) / a;
    printf("%.9f\n", ans);
    return 0;
}