#C13863. Longest Strings

    ID: 43448 Type: Default 1000ms 256MiB

Longest Strings

Longest Strings

Given a list of strings, determine the subset of strings with the maximum length. Let \(\ell(s)\) denote the length of string \(s\). If multiple strings share the maximum length, print all of them in the order they appear in the input along with their lengths.

If no strings are provided (i.e. the list is empty), output nothing.

inputFormat

The input is given via standard input (stdin). The first line contains an integer \(n\) representing the number of strings. The following \(n\) lines each contain a single string.

outputFormat

For each longest string, output a line to standard output (stdout) containing the string and its length separated by a space, and in the order they appear in the input. If \(n = 0\), output nothing.

## sample
5
apple
banana
kiwi
pineapple
cherry
pineapple 9

</p>