#K49267. Animals Above Lifespan Threshold
Animals Above Lifespan Threshold
Animals Above Lifespan Threshold
Given a list of animals along with their lifespans, your task is to print the names of the animals whose lifespan is greater than or equal to a given threshold (t).
The input is read from standard input and the output should be written to standard output. The first line of input contains an integer (n) representing the number of animals. This is followed by (n) lines, each containing an animal's name (a string) and its lifespan (an integer), separated by a space. The last line contains the threshold (t).
If one or more animals have a lifespan (\ge t), output their names in the same order they appear in the input, separated by a single space. Otherwise, print No animals
.
inputFormat
Standard input is used to provide the test data. The first line contains an integer (n) (the number of animals). Each of the next (n) lines contains a string and an integer separated by a space—the animal’s name and its lifespan, respectively. The final line contains an integer (t), the threshold value.
outputFormat
Print the names of all animals whose lifespan is greater than or equal to (t), separated by a single space. If no animal meets the criterion, output No animals
.## sample
5
Elephant 70
Parrot 20
Tortoise 150
Rabbit 8
Wolf 14
10
Elephant Parrot Tortoise Wolf