#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 75007500 yuan. A team that wins one ICPC silver medal can apply for a bonus of 30003000 yuan. A team that wins one ICPC bronze medal can apply for a bonus of 15001500 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 nn contestants and wins gg gold medals, ss silver medals, and bb bronze medals. Please help her calculate how much bonus money she can get.

Input Format

One line contains 4 integers n,g,s,bn, g, s, b (1n3,0g,s,b71 \le n \le 3, 0 \le g, s, b \le 7), representing the number of people on Maddy’s team and the numbers of gold, silver, and bronze medals won.

It is guaranteed that g+s+b7g + s + b \le 7.

Output Format

Output one integer mm 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 1500015000 yuan, wins one silver medal and gets 30003000 yuan, and wins two bronze medals and gets 30003000 yuan, for a total of 2100021000 yuan. After splitting equally, Maddy gets 70007000 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