#C779. Categorize Items by Price

    ID: 51699 Type: Default 1000ms 256MiB

Categorize Items by Price

Categorize Items by Price

You are given a list of item prices. Your task is to categorize each price based on the following criteria:

  • If the price satisfies \(price \leq 20\), it is categorized as Budget.
  • If \(20 < price \leq 100\), it is categorized as Standard.
  • If \(price > 100\), it is categorized as Premium.

The input will be provided via stdin and the output should be printed to stdout. In the case of any invalid input (for example, non-numerical values, negative values or zero), you should output exactly Invalid input.

Note: An empty list is considered valid and should produce an empty output.

inputFormat

The input is given in two lines:

  1. The first line contains an integer n representing the number of items.
  2. If n > 0, the second line contains n space-separated tokens representing the prices. If n == 0, there will be no second line.

If the entire input is the string invalid (case sensitive) or if there is any inconsistency (for example, if the number of tokens does not match n, or a token cannot be parsed as a positive number), the program should print Invalid input.

outputFormat

Print the resulting categories separated by a single space on a single line. If the input is invalid, print exactly Invalid input.

## sample
4
18 25 105 67
Budget Standard Premium Standard