#K10821. Filter Valid Individuals

    ID: 23332 Type: Default 1000ms 256MiB

Filter Valid Individuals

Filter Valid Individuals

You are given a collection of individuals, each described by three parameters: age, income, and height. Your task is to filter out and print the individuals who satisfy all of the following conditions:

  • \(25 \leq \text{age} \leq 40\)
  • \(\text{income} > 50000\)
  • \(\text{height} \geq 160\) cm

The input is taken from stdin and the output must be printed to stdout in JSON format, representing a list of valid individuals. Each individual is represented as an object with the keys age, income, and height.

inputFormat

The input begins with a single integer \(N\) which is the number of individuals. This is followed by \(N\) lines, each containing three space-separated integers representing the age, income, and height (in centimeters) of an individual.

outputFormat

Output a JSON list (array) of objects. Each object corresponds to an individual who meets the criteria described above, with keys age, income, and height. If no individual meets the criteria, output an empty list [].

## sample
4
30 70000 175
23 48000 170
35 68000 160
40 55000 158
[{"age": 30, "income": 70000, "height": 175}, {"age": 35, "income": 68000, "height": 160}]