Mock CCC '22 Contest 2 J1 - Opening Ceremony

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

The Winter Olympics opening ceremony will be happening soon! The organizers have planned to host it in a stadium with 3 seats with different costs: seats in the front rows cost F, seats in the middle rows cost M, and seats in the back rows cost B.

The organizers have sold T_F tickets for the front rows, T_M tickets for the middle rows, and T_B tickets for the back rows. Unfortunately, their calculator broke, so they need you to help them find out how much money they will get from these tickets and how many people are expected to come to the ceremony!

Constraints

0 \le F, M, B \le 10^4

0 \le T_F, T_M, T_B \le 10^4

Input Specification

The first line contains 3 space-separated integers: F, M, and B.

The second and last line contains 3 space-separated integers: T_F, T_M, and T_B.

Output Specification

Output on a single line two space-separated integers: the number of people coming to the ceremony and how much money they get from the tickets.

Sample Input

9 5 4
14 26 37

Sample Output

77 404

Explanation

14+26+37 = 77 people are coming, and 9 \times 14 + 5 \times 26 + 4 \times 37 = 404 worth of tickets have been sold.


Comments

There are no comments at the moment.