#K44382. Send Reminders

    ID: 27519 Type: Default 1000ms 256MiB

Send Reminders

Send Reminders

You are given an integer threshold (N) and a list of customers. Each customer is represented by a username and the number of days since their last login. Your task is to output all the usernames for which the number of days since the last login is greater than or equal to (N) (i.e. (days \geq N)). The output should include the names in the same order as they appear in the input, followed by the count of these usernames. This problem tests your ability to filter and process list data based on a given condition.

inputFormat

The input is given via standard input (stdin) and has the following format:

The first line contains a single integer (N) (the threshold number of days). The second line contains a single integer (M) representing the number of customers. Each of the next (M) lines contains a customer record with a username (a string) and an integer representing the number of days since their last login, separated by a space.

outputFormat

The output should be printed to standard output (stdout) in the following format:

  • The first line should contain all the usernames (in order) that satisfy the condition (i.e., days (\geq N)) separated by a space. If no customer meets the condition, output an empty line.
  • The second line should contain the count of such usernames.## sample
7
3
alice 10
bob 5
carol 20
alice carol

2

</p>