527 - 競程 CPE 班 (2013/10/24) Scoreboard

Time

2013/10/24 19:00:00 2013/10/24 22:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
9013 Longest Common Substring
9192 Find the Longest Palindrome

9013 - Longest Common Substring   

Description

Given two strings, find the length of the longest common substring.

Input

The first line of input contains a positive integer t (t <= 100), which indicates the number of test cases.  For each case, there are two strings in a line (length of the string < 1000).

Output

Output the length of the longest common substring.

Sample Input  Download

Sample Output  Download

Tags




Discuss




9192 - Find the Longest Palindrome   

Description

Palindrome is a string that is identical to its reverse, like "level" or "aba". Given a string, find the longest palindrome in the string.

Input

The input consists of multiple lines. Each line contains a string.  The length of each string is less than 1000.

Output

In each test case, output the longest palindrome in the string. If there are many palindromes of the same length, output the first one in the string.

Sample Input  Download

Sample Output  Download

Tags




Discuss