結果

問題 No.846 メダル
ユーザー aaaaaaiu
提出日時 2019-08-01 19:56:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 1,886 ms
コンパイル使用メモリ 193,104 KB
最終ジャッジ日時 2025-01-07 10:29:44
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other AC * 1 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 = min((a-1)*p+1, min((b-1)*q+1, (c-1)*r+1));
    int mx = max(a*p, max(b*q, c*r));
    if (mn > mx) puts("-1");
    else cout << mn << ' ' << mx << endl;
    return 0;
}
0