Consonants (Small)

Count the substrings of each name that contain at least n consecutive consonants.

Easy3StringTwo pointersInterviewNo attempts yetTime limit5sMemory limit512 MB

Problem

The English alphabet has 26 letters, and each one is either a vowel or a consonant. In this problem a, e, i, o, and u are the vowels, and the other 21 letters are the consonants.

A tribe living in a huge, colorful jungle names its members with English letters. A name shows the member's social rank inside the tribe, so choosing a good name for a new member is not easy. The tribe believes that the rarer the name someone receives, the higher that person's rank.

The leader of the tribe is a professional linguist. He found that names which are hard to pronounce are rare, and that the cause is too many consonants in a row. So he declared that a member's social rank is the nn-value of the name. The nn-value is the number of substrings that hold at least nn consecutive consonants. For example, when n=3n = 3, the name quartz has nn-value 4, because the substrings quartz, uartz, artz, and rtz each hold 3 consonants in a row. A larger nn-value means a higher rank in the tribe.

Two substrings count as different when they start or end at different positions, even when they spell the same letters. The name tsetse holds 11 substrings with at least 2 consecutive consonants, and the leading tse and the trailing tse are counted separately even though the letters match.

Every member of the tribe receives a name and an nn from the leader. The leader is a linguist and can produce meaningful names, but he is bad at arithmetic. Compute the nn-value of each name. Different names may come with different values of nn.

Input

The first line holds the number of test cases, TT. TT test cases follow. Each test case is one line holding the name of a member, a string of length LL, and an integer nn, separated by a single space. Every name consists of lower-case English letters only.

Limits

  • 1T1001 \le T \le 100
  • 1L1001 \le L \le 100
  • 0<nL0 < n \le L

Output

For each test case, print one line in the form "Case #x: y", where x is the test case number starting from 1 and y is the nn-value of that name.