結果

問題 No.846 メダル
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-05-22 14:09:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-09-20 12:34:44
合計ジャッジ時間 2,213 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

p,q,r = map(int,input().split())
a,b,c = map(int,input().split())

R = p*a
L = p*a-(p-1)

R = min(p*a,q*(a+b),r*(a+b+c))
L = max(p*a-(p-1),q*(a+b)-(q-1),r*(a+b+c)-(r-1))
if L > R or R <= 0:
    print(-1)
    exit()

print(L,R)
0