TOPIC

English Translation of this problem

mnuddin0 asked 6 years ago

The new building of the Brazilian Computer Society (SBC) has 3 floors. At certain times of the year, SBC employees drink a lot of coffee. Because of this, the SBC presidency decided to present employees with a new espresso machine. This machine must be installed on one of the 3 floors, but the installation should be done so that people do not waste much time going up and down stairs.

Each SBC employee drinks 1 espresso coffee per day. He needs to go from the floor where he works to the floor where the machine is and back to his workstation. Every employee takes 1 minute to go up or down a floor. Because SBC cares very much about efficiency, it wants to position the machine in a way that minimizes the total time spent going up and down stairs.

Your job is to help the board position the machine so as to minimize the total time spent by employees going up and down stairs. input The input consists of 3 numbers, A1, A2, A3 (0 ≤ A1, A2, A3 ≤ 1000), one per line, where Ai represents the number of people working on the ith floor. output Your program should print a single line, containing the total number of minutes to be spent with the best possible machine positioning. input smples output samples 10

20 80

30

10

30 60

20

30 100

10

20

Remember not post solutions. Your post may be reviewed by our moderators.