LCC/Moose '19 Contest 3 J3 - WELCOME TO MY MINE
View as PDFAfter more than 3 years of complete dominance, MineCraft Awesome Parodys has a new competitor:
- Each line must have the word
mineand the wordcraftat least once at some point. - The first occurrence of
minemust come before the first occurrence ofcraftin each line. - The number of non
mineand noncraftwords should not exceed the number of timesmineoccurs.
Input Specification
The first line contains an integer
, the number of lines in the Minecraft parody.
The next lines each contain a line from the minecraft parody. Each line will consist only of lowercase letters and space and will not exceed
characters in length.
Note: For the purposes of this problem a word is defined as a collection of letters separated from other words by a space.
Output Specification
A single line containing either PROFIT if the song is a Minecraft parody, or cri otherwise.
Sample Input 1
2
welcome to my mine
we are mining diamonds
Sample Output 1
cri
Sample Input 2
1
minecraft
Sample Output 2
cri
Sample Input 3
2
my mine craft mine
yes i mine craft
Sample Output 3
PROFIT
Comments