Catching the Troublemakers
Time limit1sMemory limit1024 MB
For each member's solve record over M days, find the longest run of days without a solve, then count how many distinct longest-run values there are.
- Level
Easy2 of 10
- Topics
- Simulation, String
- Solved
- No attempts yet
Problem
In 2034, the KPSC club at Kookmin University became so famous that KPSC was better known than Kookmin University itself.
Because of this reputation, many people wanted to join KPSC, but to keep the club's reputation, it accepted only a limited number of members and rejected everyone else.
However, after joining, some members began to neglect their programming studies and disappeared.

The vice club leader, outraged by this situation, decided to introduce a new rule: expulsion using the reverse streak. A reverse streak is the number of consecutive days a person has not solved a problem. In other words, if someone has not solved any problem for consecutive days, that is a reverse streak of days.
Help the vice club leader identify the 'troublemaker' members who disappear after joining and neglect club activities.
Input
The first line contains the number of KPSC members and the length of the daily activity record .
Each of the next lines gives one member's activity record and name, separated by a space.
The activity record is characters separated by spaces. If the -th character is *, the member solved a problem on day . If it is ., the member did not solve a problem on day .
Each name is a string of 1 to 10 lowercase English letters, and no two names are the same.
Output
The first line prints the number of distinct values among the members' longest reverse streaks.
From the next line, print each member's longest reverse streak and name, one per line, in input order. Here, the longest reverse streak is the largest reverse streak achieved within the days.