#K59537. Campaign Summary Report

    ID: 30886 Type: Default 1000ms 256MiB

Campaign Summary Report

Campaign Summary Report

Given a list of email interactions, your task is to generate a summary report for each unique email address. Each interaction is one of three types: (\textit{open}), (\textit{click}), or (\textit{unsubscribe}). For every email address, count the number of occurrences of each type. The emails must be reported in the order of their first appearance. The summary for each email should be printed in the format: (\text{email: open_count click_count unsubscribe_count}).

inputFormat

The input begins with an integer (T) which represents the total number of interactions. Each of the following (T) lines contains two space-separated strings: the email address and the interaction type (which can be one of: "open", "click", or "unsubscribe").

outputFormat

Output the summary for each email on a new line, following the order in which they first appear in the input. Each line must be formatted as: (\text{email: open_count click_count unsubscribe_count}).## sample

7
user1@example.com click
user2@example.com open
user1@example.com open
user2@example.com unsubscribe
user3@example.com open
user3@example.com click
user1@example.com unsubscribe
user1@example.com: 1 1 1

user2@example.com: 1 0 1 user3@example.com: 1 1 0

</p>