結果

問題 No.1738 What's in the box?
ユーザー ntuda
提出日時 2025-01-10 23:31:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 3,045 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 59,648 KB
最終ジャッジ日時 2025-01-10 23:31:12
合計ジャッジ時間 5,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 WA * 68
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
W = list(map(int,input().split()))
if M == 0:
    print(*W)    
elif M >= sum(W):
    x = M//sum(W)
    for i in range(N):
        W[i] *= x
    print(*W)
else:
    x = sum(W)//M
    for i in range(N):
        W[i] //= x
    print(*W)
0