DMOPC '14 Contest 2 P1 - Logging Log

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Problem type

The Logging Company cuts a lot of trees. For management reasons, they want to produce a table of the total amount of wood cut every day. They have hired you, to help them produce the table. They've kept a log of trees logged, and they want you to produce a table from this data.

Input Specification

The first line will be the integer D (1 \le D \le 50), representing the number of days in the log. The days will be numbered like this: 1, 2, 3, \ldots, D.

There will be D groups of lines. Each group will contain the data for day i. The first line of each group contains the integer T (0 \le T \le 50). The following T lines will contain the mass of wood in each tree cut for that day. The mass will be a nonnegative integer no more than 1\,000.

Output Specification

You are to output Day i: m for every day i in the input, where m is the sum of the mass of all trees cut that day. If there are no trees cut that day, you should output Weekend.

Sample Input 1


Sample Output 1

Day 1: 3
Day 2: 4
Day 3: 5

Explanation for Sample Input 1

There are three days in the log. The first day contains three trees, one mass unit each. The second day contains two trees, two mass units each. The third day contains one tree, measuring five mass units.

Sample Input 2


Sample Output 2



  • -3
    Mad_Milk  commented on Oct. 15, 2020, 6:09 p.m. edit 2

    I tried the test cases, and I am getting it right but when I submit I get WA for all of them. What am I doing wrong????? ('-')

    Edit: Found it, lmao