#C13425. Categorize Salaries

    ID: 42962 Type: Default 1000ms 256MiB

Categorize Salaries

Categorize Salaries

You are given a list of salaries. Your task is to categorize these salaries into three distinct groups based on the following criteria:

  • Low: Salaries strictly less than \(50000\).
  • Medium: Salaries that are at least \(50000\) but less than \(100000\).
  • High: Salaries greater than or equal to \(100000\).

The input is provided via standard input. The first integer indicates the number of salary entries, followed by these salaries separated by spaces. You need to output a JSON-formatted dictionary with the keys "Low", "Medium", and "High" mapping to lists of the respective salaries. Ensure that your program reads from stdin and writes to stdout.

inputFormat

The input begins with an integer n which indicates the number of salary values. The next line contains n space-separated integers representing the salaries.

Example:

6
25000 45000 55000 75000 120000 99000

outputFormat

Output a JSON object (dictionary) with three keys: "Low", "Medium", and "High". Each key maps to a list of integers belonging to that category according to the criteria described.

Example Output:

{"Low": [25000, 45000], "Medium": [55000, 75000, 99000], "High": [120000]}
## sample
6
25000 45000 55000 75000 120000 99000
{"Low": [25000,45000],"Medium": [55000,75000,99000],"High": [120000]}