The number of distinct anagrams of the word "ICPC" is .
The fifth character of an ICPC-string is uniquely determined by the first four. Indeed, every consecutive letters must contain two letters , one letter , and one letter . Therefore, the fifth character must coincide with the first one. For the same reason, the sixth character coincides with the second, the seventh with the third, and so on.
Thus, any ICPC-string is completely determined by its first four characters. Consequently, the number of ICPC-strings of length does not depend on and equals the number of anagrams of the word "ICPC", which is .
Example
Consider examples of ICPC-strings:
ICPCICPCICPCICPCICPC...
CCPICCPICCPICCPICCPI...
PCICPCICPCICPCICPCIC...
Algorithm implementation
To solve the problem, it is sufficient to print the number .
printf("12\n");