#T727. 奥运奖牌计数

奥运奖牌计数

Description

At the 2008 Beijing Olympics, athletes from Country A participated in final events over n days (1 ≤ n ≤ 17). Now, we need to tally the number of gold, silver, and bronze medals won by Country A, as well as the total number of medals. The first line of input is the number of days n that Country A participated in final events, followed by n lines, each representing the number of gold, silver, and bronze medals won by the country on a given day. The output consists of 4 integers: the total number of gold, silver, and bronze medals won by Country A, and the total medal count.

Input Format

The input consists of n + 1 lines. The first line is the number of days n that Country A participated in final events. The subsequent n lines each contain the number of gold, silver, and bronze medals won by the country on a given day, separated by spaces.

Output Format

The output consists of a single line containing 4 integers: the total number of gold, silver, and bronze medals won by Country A, and the total medal count, separated by spaces.

3
1 0 3
3 1 0
0 3 0
4 4 3 11

Source

CodesOnline