F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Match

Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 274    Accepted Submission(s): 42


Problem 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 (less than 3000). 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
 

Author
hhanger@zju
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-07 17:07:03, Gzip enabled