#K90747. Categorize Users Based on Purchases

    ID: 37821 Type: Default 1000ms 256MiB

Categorize Users Based on Purchases

Categorize Users Based on Purchases

In this problem, you are given a list of user email addresses along with their corresponding purchase amounts. Your task is to categorize each user into one of three spending levels as follows:

  • If the purchase amount is less than (100), the user is considered a Low Spender.
  • If the purchase amount is between (100) and (500) (inclusive), the user is considered a Medium Spender.
  • If the purchase amount is greater than (500), the user is considered a High Spender.

You need to read input from standard input and output the result to standard output. The result should print each email and its associated spending category on a separate line, preserving the order of input.

inputFormat

The input starts with an integer (n) denoting the number of users. The following (n) lines each contain a user’s email address and an integer representing the total purchase amount, separated by a space.

For example: 4 john.doe@example.com 75 jane.doe@example.com 150 alice@example.com 600 bob@example.com 500

outputFormat

For each user, output a line containing the email address and its corresponding spending category separated by a space. The order of the output should match the input order.

For example: john.doe@example.com Low Spender jane.doe@example.com Medium Spender alice@example.com High Spender bob@example.com Medium Spender## sample

4
john.doe@example.com 75
jane.doe@example.com 150
alice@example.com 600
bob@example.com 500
john.doe@example.com Low Spender

jane.doe@example.com Medium Spender alice@example.com High Spender bob@example.com Medium Spender

</p>