#C6420. Purchase Records Validation

    ID: 50179 Type: Default 1000ms 256MiB

Purchase Records Validation

Purchase Records Validation

You are given a list of purchase record entries as strings representing quantities purchased. Your task is to validate these records according to the following conditions:

  • If a record cannot be completely converted to an integer (for example, it contains non-numeric characters or extra spaces), it is considered invalid.
  • If the converted integer is less than 1, the record is invalid.
  • If the integer is greater than 1000, the record is considered an overflow.
  • If the integer is between 1 and 1000 (inclusive), the record is valid.

Your program should compute and output the number of valid records, overflow records, and invalid records as an array [valid_count, overflow_count, invalid_count].

In mathematical terms, for a given record represented by a string s, let \( Q = \text{int}(s) \) if \( s \) is a valid integer string. Then:

\[ \text{if } Q 1000 \quad \Rightarrow \quad \text{overflow}.\]

inputFormat

The input is read from standard input (stdin). The first line contains an integer N denoting the number of purchase records. Each of the following N lines contains a record as a string.

outputFormat

Print three space-separated integers on a single line representing the counts of valid records, overflow records, and invalid records, respectively.

## sample
6
250
1500
-5
800
xyz
734
3 1 2

</p>