結果

問題 No.1738 What's in the box?
ユーザー MasKoaTS
提出日時 2021-11-12 21:55:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 789 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,720 KB
実行使用メモリ 89,364 KB
最終ジャッジ日時 2024-11-25 18:18:24
合計ジャッジ時間 10,874 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 70
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from copy import deepcopy as dcopy
import math
import sys
sys.setrecursionlimit(10**6)
def input():
    return sys.stdin.readline().rstrip()
def getN():
	return int(sys.stdin.readline())
def getNs():
	return map(int,sys.stdin.readline().split())
def getList():
	return list(map(int,sys.stdin.readline().split()))
def strinps(n):
	return [sys.stdin.readline().rstrip() for _ in range(n)]
pi = 3.141592653589793
mod = 10**9+7
MOD = 998244353
INF = math.inf
dx = [1,0,-1,0];	dy = [0,1,0,-1]


"""
Main Code
"""

n,m = getNs()
w = getList()
s = sum(w)
if(s == 0):
	ans = [0]*n
	print(*ans)
	exit(0)

ans = [0]*n
for i in range(n):
	ans[i] = w[i] * m // s
print(*ans)
0