본문 바로가기
python-algorithm

백준 25858 Divide the Cash

by 무적김두칠 2022. 11. 29.

https://www.acmicpc.net/problem/25858

 

25858번: Divide the Cash

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’

www.acmicpc.net

 

1
2
3
4
5
6
7
8
if __name__ == '__main__':
    n_students, total_prize = map(int, input().split())
    n_problems = [int(input()) for i in range (n_students)]
    total_problem = sum(n_problems)
    problem_per_prize = total_prize/total_problem
    for i in n_problems:
        print(int(i*problem_per_prize))
 
cs
반응형

댓글