#1278
Unrated
Osmosmjerka
시간 제한
4s
메모리 제한
256MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

We have created an infinite eight-directional crossword by taking a letter-filled block of dimensions M x N and infinitely repeating it. For instance, if we are given the following block: honi hsin then we create the following crossword:...honihonihonihoni......hsinhsinhsinhsin......honihonihonihoni......hsinhsinhsinhsin... that is inifinite in all directions. In the created crossword, we randomly choose a field and one of eight directions, then write down a word of length K obtained by reading the crossword starting from the initial field, in the chosen direction. If we executed this query twice (independently), we would obtain two words of length K. Calculate the probability that the two words are equal.

입력

The first line of input contains integers M, N, K from the task (1 ≤ M, N ≤ 500, 2 ≤ K ≤ 10910^{9}). Each of the following M lines contains N lowercase letters of the English alphabet, and describes a block of the crossword. At least two distinct letters will exist in the block.

출력

You must output the required probability in the form of a reduced fraction p/q, without spaces.

채점

In test cases worth 100 total points, it will hold M = N.

예제 입력 1

1 2 2
ab

예제 출력 1

5/16

예제 입력 2

2 4 3
honi
hsin

예제 출력 2

19/512

예제 입력 3

3 3 10
ban
ana
nab

예제 출력 3

2/27
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.