Program time limit: 1 seconds
Program memory limit: 256 MB
Zitian the space explorer has embarked on a journey to find a habitable planet for the next generation of humanity. As he travelled past the Milky Way, he entered a zone called the Cosmic Pond Mallards (CPM). Nearby, a group of ducks were trying to communicate with him.
The ducks made many different quacks, and Zitian noticed that one quack seemed to appear more often than the others. In his hurry to record the ducks' sounds, he forgot to put spaces between the quacks. Now he needs your help to determine how many times the word $S_2$ appears in the recorded string $S_1$.
You should read from standard input.
Overlapping occurrences should be counted.
You should write to standard output.
quaackquackquuackqquack
quack
2
"quack"."quack".aabaabaaaaaaabababaaab
aab
4
"aab"."aab"."aab"."aab".Your program will be tested on the sample cases and several hidden cases. If it produces the correct output for all test cases, it will be considered correct. Recall that your final score for this problem is the score of your highest-scoring submission.
The contest ended at 8:16 p.m. AEST on Thursday 2nd July. All submissions will be unofficial .