Under construction

Still being built. Things may change

I and l

Time limit2sMemory limit1024 MB

Summary
Given a string S of I and l (length up to 20), find the expected LCS length between S and a uniformly random I/l string of length m (up to 50) as an irreducible fraction.
Level

Medium7 of 10

Topics
Dynamic programming, String, Bit manipulation
Solved
No attempts yet

Problem

Among the uppercase and lowercase letters of the alphabet, the uppercase I and the lowercase l look similar in some fonts and are hard to tell apart. This is sometimes used as material for jokes; for example, in the name "진짜 최종 구데기컵: ReguIar Division" of the 5-hour division among the three divisions of the Gudegi Cup held on March 28, 2020, the fifth character of ReguIar was the uppercase I, not the lowercase l. In the default font of problem statements, the way to tell I and l apart is length. Looking at Il, the two characters placed side by side, you can see that l is slightly longer than I. Even if you can tell them apart this way, remembering a string like IlIllIIllI takes a lot of time. So people who do not want their IDs to be easily exposed sometimes make IDs by mixing I and l appropriately.

Silver, who had been observing IDs made of I and l, suddenly wondered what the expected value of the LCS (Longest Common Subsequence) length of such strings would be. A longest common subsequence is the longest sequence that is a subsequence of both sequences. For strings X,YX, Y, let the length of the LCS of XX and YY be LCS(X,Y)LCS(X, Y). Given a string SS of length nn, you must find the expected value of LCS(S,T)LCS(S, T) for a string TT drawn uniformly at random from the set of strings of length mm made of I and l (in regex terms, [Il]{m}).

Input

The first line gives n,mn, m.

The second line gives a string SS of length nn made only of I and l.

Output

On the first line, print the answer to the problem in the form of the irreducible fraction a/b.

Constraints

  • 1≤n≤201 \le n \le 20
  • 1≤m≤501 \le m \le 50

Examples4

  1. Example 1

    Input
    2 2
    II
    
    Expected output
    1/1
    
  2. Example 2

    Input
    2 2
    Il
    
    Expected output
    5/4
    
  3. Example 3

    Input
    1 5
    l
    
    Expected output
    31/32
    
  4. Example 4

    Input
    20 50
    IlIlIlIlIlIlIlIlIlIl
    
    Expected output
    11214134123336965/562949953421312