#C13889. Filtered String Lengths

    ID: 43476 Type: Default 1000ms 256MiB

Filtered String Lengths

Filtered String Lengths

You are given a list of strings and an integer ( m ) representing the minimum length. Your task is to filter out those strings whose lengths are less than ( m ) and then output the number of remaining strings followed by each valid string and its length on a new line in the same order as they appear in the input.

Example:
If the input is:
3 apple banana cherry 0
Then the output should be:
3 apple 5 banana 6 cherry 6
If the input is:
3 apple banana cherry 6
Then the output should be:
2 banana 6 cherry 6

inputFormat

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

  • The first line contains a single integer ( n ) representing the number of strings.
  • The next ( n ) lines each contain a single string.
  • The last line contains the integer ( m ) denoting the minimum length required.

outputFormat

Output to standard output. The first line should contain an integer representing the count of strings with length greater than or equal to ( m ). Then, for each such string (in the order of input), output a line containing the string followed by its length, separated by a space.## sample

3
apple
banana
cherry
0
3

apple 5 banana 6 cherry 6

</p>