Longest Common Substring

Time Limit: 4000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 1403
64-bit integer IO format: %I64d      Java class name: Main

Description

Given two strings, you have to tell the length of the Longest Common Substring of them.

For example:
str1 = banana
str2 = cianaic

So the Longest Common Substring is "ana", and the length is 3.

Input

The input contains several test cases. Each test case contains two strings, each string will have at most 100000 characters. All the characters are in lower-case.

Process to the end of file.

Output

For each test case, you have to tell the length of the Longest Common Substring of them.

Sample Input

banana
cianaic

Sample Output

3
Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .