結果
問題 |
No.846 メダル
|
ユーザー |
![]() |
提出日時 | 2020-07-05 09:46:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 1,685 ms |
コンパイル使用メモリ | 166,676 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 04:28:06 |
合計ジャッジ時間 | 2,456 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #define PI 3.14159265359 using namespace std; int main() { int64_t P, Q, R, A, B, C; cin >> P >> Q >> R >> A >> B >> C; int64_t x, y; x = max(max((A - 1) * P + 1, (A + B - 1) * Q + 1), (A + B + C - 1) * R + 1); y = min(min(A * P, (A + B) * Q), (A + B + C) * R); if (x > y) { cout << -1 << endl; } else { cout << x << ' ' << y << endl; } }