3166 - Repeated Number of Prefixes 3166 - Repeated Number of Prefixes 3166 - Repeated Number of Prefixes

Statistics Sub: 162 | AC: 24 | AC%: 14,81 | Score: 3,45
Created by Oreste Nillar Cambara
Added by Keyfu (2015-03-11)
Limits
Total Time: 6000 MS | Test Time: 1500 MS |Memory: 125 MB | Output: 64 MB | Size: 14 KB
Enabled languages
Available in

Description

Given two string (A,B) of lowercase letter, is necesary know how many time are the prefixs of the string A in B. You have to be in count, that a frecuency of the prefix in B, is when this prefix is in string B from begin to end and invert.

Example of this:
A=abcd
B=abccba

How you can see, the prefix abc of A is two time in the string B (abc,cba).
Given two string (A,B) of lowercase letter, is necesary know how many time are the prefixs of the string A in B. You have to be in count, that a frecuency of the prefix in B, is when this prefix is in string B from begin to end and invert.

Example of this:
A=abcd
B=abccba

How you can see, the prefix abc of A is two time in the string B (abc,cba).
Given two string (A,B) of lowercase letter, is necesary know how many time are the prefixs of the string A in B. You have to be in count, that a frecuency of the prefix in B, is when this prefix is in string B from begin to end and invert.

Example of this:
A=abcd
B=abccba

How you can see, the prefix abc of A is two time in the string B (abc,cba).

Input specification

Two line of input contain A and B, which is a non-empty string where(1 < |A|, |B| < 10^6).
Two line of input contain A and B, which is a non-empty string where(1 < |A|, |B| < 10^6).
Two line of input contain A and B, which is a non-empty string where(1 < |A|, |B| < 10^6).

Output specification

Print a single line containing the answer.
Print a single line containing the answer.
Two line of input contain A and B, which is a non-empty string where(1 < |A|, |B| < 10^6).

Sample input

asad
asasatt

Sample output

3 4 2 0

Hint(s)

http://coj.uci.cu/24h/
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/

Recommendation

We have carefully selected several similar problems: 3380 | 1721 | 3375 | 2623 | 3667 | 4001