#P4891. Dreamoon and Strings
Dreamoon and Strings
Dreamoon and Strings
题面翻译
题目描述:
Dreamoon 有一个字符串 和一个模式串 ,他会先从 中删除恰好 个字符来产生一个新的字符串 。然后他会计算 ,即从 中能找到的等于 的不相交的子串数量的最大值。他想让 的值尽可能大。
更形式地说,让我们用 表示所有可以从 中删去恰好 个字符得到的 中 的最大值。Dreamoon 想要知道对于所有的 , 的值。
输入格式:
第一、二行分别输入一个字符串:,。,两串只包含小写英文字母。
输出格式:
一行, 个数,分别代表 。
题目描述
Dreamoon has a string and a pattern string . He first removes exactly characters from obtaining string as a result. Then he calculates that is defined as the maximal number of non-overlapping substrings equal to that can be found in . He wants to make this number as big as possible.
More formally, let's define as maximum value of over all that can be obtained by removing exactly characters from . Dreamoon wants to know for all from to where denotes the length of string .
输入格式
The first line of the input contains the string ( ).
The second line of the input contains the string ( ).
Both strings will only consist of lower case English letters.
输出格式
Print space-separated integers in a single line representing the for all from to .
样例 #1
样例输入 #1
aaaaa
aa
样例输出 #1
2 2 1 1 0 0
样例 #2
样例输入 #2
axbaxxb
ab
样例输出 #2
0 1 1 2 1 1 0 0
提示
For the first sample, the corresponding optimal values of after removal through characters from are {"aaaaa", "aaaa", "aaa", "aa", "a", ""}.
For the second sample, possible corresponding optimal values of are {"axbaxxb", "abaxxb", "axbab", "abab", "aba", "ab", "a", ""}.