Logo
(追記) (追記ここまで)

25858번 - Divide the Cash 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB15571306124584.235%

문제

The UCF Programming Team coaches schedule practices regularly in fall and spring (by the way, all UCF students are welcome to the practices). During summer, the majority of the team members are gone but the coaches know how to make sure the students don’t get “rusty”. The coaches usually give prize money and reward the team members based on how many problems they solve during summer. For example, let’s assume the coaches have \1,000ドル in prize money and there are three students. Let’s also assume the three students solve, respectively, 5, 8 and 7 problems, i.e., a total of 20 problems. So, the reward for one problem will be \50ドル (\1000ドル/20) and the three team members will receive, respectively, \250,ドル 400ドル and \350ドル.

Given the total prize money and the number of problems each team member has solved, compute the reward for each student.

입력

The first input line contains two integers: n (1 ≤ n ≤ 30), indicating the number of team members and d (1 ≤ d ≤ 30,000), indicating the dollar amount to be divided among the students. Each of the next n input lines contains an integer (between 1 and 300, inclusive) indicating the number of problems a team member has solved. Assume that the input values are such that the reward for one problem will be an integer number of dollars.

출력

Print the pay, in dollars, for each team member (in the same order as they appear in the input).

제한

예제 입력 1

3 1000
5
8
7

예제 출력 1

250
400
350

예제 입력 2

1 500
10

예제 출력 2

500

힌트

출처

University > University of Central Florida > 2019 Local Programming Contest 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /