結果

問題 No.846 メダル
ユーザー kpinkcat
提出日時 2023-08-22 14:34:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 1,029 ms
コンパイル使用メモリ 103,680 KB
最終ジャッジ日時 2025-02-16 12:15:47
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


int main()
{
    long long p, q, r, a, b, c, nmax, nmin;
    cin >> p >> q >> r >> a >> b >> c;
    nmax = min({p*a, q*(a+b), r*(a+b+c)});
    nmin = max({p*(a-1), q*(a+b-1), r*(a+b+c-1)}) + 1;
    cout << ((nmax > nmin) ? to_string(nmin) + " " + to_string(nmax) : to_string(-1)) << endl;
}
0