#K1526. Employee Worklog Report
Employee Worklog Report
Employee Worklog Report
In this problem, you are given a date range and a list of worklog entries. Each worklog is a string consisting of an employee ID, a project name, the number of hours worked, and a date in the format YYYY-MM-DD
. Your task is to generate a report that aggregates the total hours each employee worked on each project within the specified date range.
The report should list each employee on a new line. For each employee, output the projects they worked on along with the total hours, following the order of their first appearance in the input. The format for each employee line is:
ID project1: hours1 project2: hours2 ...
If an employee does not have any worklog entry within the date range, they should not appear in the output.
Note: The dates follow the ISO format $\texttt{YYYY-MM-DD}$.
inputFormat
The input is read from stdin and has the following format:
- The first line contains the
start_date
in the formatYYYY-MM-DD
. - The second line contains the
end_date
in the formatYYYY-MM-DD
. - The third line contains an integer
n
which is the number of worklog entries. - The following
n
lines each contain a worklog entry in the format:ID PROJECT HOURS DATE
.
All dates are in the format $\texttt{YYYY-MM-DD}$ and the date range is inclusive.
outputFormat
The output is printed to stdout and consists of one line per employee whose worklogs fall within the specified date range. Each line should be formatted as:
ID project1: total_hours1 project2: total_hours2 ...
The projects should appear in the order of their first occurrence for that employee in the worklogs. If no entries fall within the date range, output nothing.
## sample2023-01-01
2023-01-31
5
e1 projectA 5 2023-01-05
e2 projectB 3 2023-01-06
e1 projectA 2 2023-01-10
e2 projectA 4 2023-01-15
e1 projectB 6 2023-01-20
e1 projectA: 7 projectB: 6
e2 projectB: 3 projectA: 4
</p>