結果
| 問題 | 
                            No.846 メダル
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-08-01 19:59:33 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 329 bytes | 
| コンパイル時間 | 1,984 ms | 
| コンパイル使用メモリ | 193,080 KB | 
| 最終ジャッジ日時 | 2025-01-07 10:29:54 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 1 | 
| other | AC * 12 WA * 10 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll p,q,r,a,b,c;
    cin>>p>>q>>r>>a>>b>>c;
    b+=a;
    c+=b;
    int mn = max((a-1)*p+1, max((b-1)*q+1, (c-1)*r+1));
    int mx = min(a*p, min(b*q, c*r));
    if (mn > mx) puts("-1");
    else cout << mn << ' ' << mx << endl;
    return 0;
}