Logo Universal Online Judge

UOJ

时间限制:1 s 空间限制:1024 MB
统计

Because chu problem de ren 给了九个 Subtask,我也不知道怎么回事,后面的 Subtask 可能会配错,ごめんなさい!

Sample

Description

Insert string T into S to maximize the number of occurrence of patterns P.

Input

Read the testdata from lgs.in.

The first line contains the string S, the second line the string T, and the third line the string P.

Ouput

Print the answer to lgs.out.

Output one line containing the following four integers, separated by spaces:

  1. The maximum number of occurrences of P we can get after inserting T into S at position k, if we choose the position k wisely.
  2. The number of different k’s (from the range 0,1,,|S|) where this maximum number of occurrences of P is attained.
  3. The minimum value of k where the maximum number of occurrences of P is attained.
  4. The maximum value of k where the maximum number of occurrences of P is attained.

Range

保证 1|S|,|T|,|P|105,所有字符串只包含小写英文字母。

  • 子任务 15 分):|S|,|T|,|P|10
  • 子任务 215 分):|S|,|T|,|P|5000
  • 子任务 320 分):|T||P|
  • 子任务 450 分):|T||P|
  • 子任务 510 分):无特殊限制。