#P16208. [ECUSTPC 2025] 金色走廊
[ECUSTPC 2025] 金色走廊
Problem Description
Maddy has arrived at ECUST University. Maddy walks into the legendary Lanqiao Cup laboratory. After hearing stories about several legendary contestants, she also wants to become one of them. But before that, she wants to study a practical problem.
At this university, a team that wins one ICPC gold medal can apply for a bonus of yuan. A team that wins one ICPC silver medal can apply for a bonus of yuan. A team that wins one ICPC bronze medal can apply for a bonus of yuan.
ICPC is a contest where a team can have up to three members (it can also be a one-person team or a two-person team), and the bonus will be split equally among all team members.
In Maddy’s dream, her team has contestants and wins gold medals, silver medals, and bronze medals. Please help her calculate how much bonus money she can get.
Input Format
One line contains 4 integers (), representing the number of people on Maddy’s team and the numbers of gold, silver, and bronze medals won.
It is guaranteed that .
Output Format
Output one integer in one line, representing the amount of bonus money Maddy gets (unit: yuan).
3 2 1 2
7000
1 0 0 4
6000
Hint
Sample 1 Explanation
In this case, Maddy’s team wins two gold medals and gets yuan, wins one silver medal and gets yuan, and wins two bronze medals and gets yuan, for a total of yuan. After splitting equally, Maddy gets yuan.
Hint
In programming contests, contestants usually do not need to, and should not, print any prompt text at the beginning of the program, including but not limited to text like “Please input two integers:”. Doing so may cause the submitted program to be judged Wrong Answer or lead to other unexpected judging results.
Translated by ChatGPT 5