ESTR1 - Concat two strings
Dữ liệu vào: Standard input
Dữ liệu ra: Standard output
Giới hạn thời gian: 1.0 giây
Giới hạn bộ nhớ: 128 megabyte

Given two strings as input. Your task is to find the longer string of the two strings, display the length of the longer string and concatenate the two strings and display the concatenated string.

Input: 
First line of the input file contains an integer T which denotes the number of test cases. For each test case, there will be two lines. First line contains string A, and second line contains string B.

Output:
Corresponding to each test case, In the first line print the length of the longer string and In the second line print the string obtained by concatenating the two strings.

.Constraints:
1 <= T <= 10
1 <= length(A) <= 100
1 <= length(B) <= 100

 

Ví dụ

  • input
    1
    Toan
    MrToan
    output
    6
    ToanMrToan
Back to Top