結果

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

ソースコード

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