#C12981. Filter Students by Age

    ID: 42468 Type: Default 1000ms 256MiB

Filter Students by Age

Filter Students by Age

You are given a list of students and an age threshold. Each student is represented by a name and an age. Your task is to filter out all students whose age is greater than the threshold. Formally, for each student with age $$a$$, include it in the result if $$a > \text{threshold}$$.

inputFormat

The input is read from standard input and has the following format:

Line 1: An integer $$n$$ representing the number of students.
Next $$n$$ lines: Each line contains a student's name (a string without spaces) and an integer age separated by a space.
Last line: An integer representing the age threshold.

outputFormat

The output should be written to standard output.

The first line contains an integer $$k$$ representing the number of students that are older than the threshold.
Then, $$k$$ lines follow, each containing a student's name and age separated by a space, in the same order as the input.## sample

5
John 24
Jack 22
Sam 25
Alice 21
Bob 23
22
3

John 24 Sam 25 Bob 23

</p>