SP21085 TPCPALIN - Palindrome Merge

Description

[English](/problems/TPCPALIN/en/) [Vietnamese](/problems/TPCPALIN/vn/)Given two strings s1 and s2. We can merge characters of two strings (with order in original strings) to get a new string. For example : s1 = 'ab' and s2 = 'ba'. We can merge to get st = 'a**b**b**a**' but not st = 'a**ab**b'. **The Problem :** Given two string contain only lowercase letters, count the number of palindrome by merging in different ways. Ex : 'aba', 'abba' are palindrome, 'abc' and 'abca' aren't.

Input Format

\- Two lines, each line contains a string, string's length isn't over 500.

Output Format

\- A single integer is the number of palindrome after **modul 3210121**.