People usually react in two different ways when they receive a SPAM:From: AliceTo: Bob, Mary, Julia, PaulHi, this is a good luck email. I wish you become a millionaire, butthat is up to you. If you* send this email to 10 or more people you will be a millionaire* send this email to 5 or more people you will be rich* send this email to less than 5 people you will be poorAs I said, it is up to you. Write your email and be rich! :-)Alice
- They discard the message immediately without even reading it (they hate SPAM);
- They forward the message to everyone they know (they love SPAM).
For this problem, we will assume everyone loves SPAM, but one never forwards the same message twice. Each SPAM message has a different effect based on the number of friends you forward the message to. For example: a SPAM message could tell that you will be poor if you send the message to 5 friends, but you will be the rich if you send to 10, and you will be the richest man in the world if you send it to 20 friends, and so on.
We will consider only SPAM messages similar to the example above. More specifically, a SPAM message will define two threshold values $T_1$ and $T_2$ and three attributes $A_1$, $A_2$ and $A_3$. $A$ person acquires one of the three attributes depending on the number of messages forwarded for that specific SPAM. If a person forwards $T$ messages and $T \lt T_1$ then her/his attribute is $A_1$, if $T_1 \leq T \lt T_2$ then her/his attribute is $A_2$, otherwise her/his attribute is $A_3$.
You will be given the names of a group of people, and for each person in the group, the set of friends she/he knows the email address. You will also be given a set of distinct SPAM messages, and for each SPAM message its threshold values and attributes, and the information about which person started it. You have to write a program that determines, for each person in the given group, which attributes she/ he acquired, based on all the SPAM they forward.
You may assume that the SPAM originator will have at least one friend (in other words, she/he will send at least one message), and a person will not send messages to herself.