#P17389. [PacNW 2025] Shh

[PacNW 2025] Shh

Problem Description

Theo needs to change his leaked password. Because he likes to say his password aloud while typing it, he wants the new password to contain exactly kk occurrences of the substring shh.

A substring is a contiguous segment of a string. Two occurrences are different if they begin or end at different positions, even if their contents are identical.

Given Theo's original password, find the minimum number of characters he must change to obtain exactly kk occurrences of shh. Also count the distinct passwords obtainable by changing exactly that many characters and containing exactly kk occurrences.

Input Format

The first line contains two integers nn and kk (1n671\le n\le67 and 03kn0\le3k\le n).

The second line contains Theo's original password, a string of nn lowercase English letters.

Output Format

Let cc be the minimum number of changed characters and ww the number of valid passwords at that distance. Output cc and wmod67w\bmod67.

10 2
eurovision
5 4
8 1
sixseven
2 2
3 0
shh
1 8
2 0
no
0 1
10 0
wastedlove
0 1
18 6
countingsatellites
18 1
22 5
notanotherconstructive
13 19
14 3
honkaistarrail
8 13

Hint

In the first sample, at least five characters must be changed. The four valid passwords are shhovishhn, eshhvishhn, eushhishhn, and eurshhshhn.