結果
| 問題 | No.846 メダル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-01 19:56:46 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.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 |
ソースコード
#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;
}