1189 - SCU-I

Time Limit : 5 Second

Memory Limit : 128 MB

Submission: 341

Solved: 54

Description
Given three strings, find the length of the longest string which
is a substring of each of the three input strings.
In this problem "substring" has the usual definition.
A string X is a substring of a string Y if and only if
string X can be created from string Y by deleting zero
or more consecutive characters from the start of string Y,
and deleting zero or more consecutive characters from the
end of string Y.
Input
The first line of the input is the number of test cases.
For each case there is three lines each contains a string.
The string only contains 'a'-'z' and up to 1000 characters long.
There is a blank line before each test case.
Output
For each test case output the answer on a line.
sample input
3

aebcd
ebcaddwerd
fdsalebcser

sdafawerrsdfsdfwe
erfasdfafsd
egreetsdwere

aaaaa
aaaaa
aaaaa
sample output
3
2
5
hint
source
SCUPC
© 2015 HUST ACMICPC TEAM. All Right Reserved.