Time limit
2s
Memory limit
128 MB
You are given two nonempty strings X and Y consisting of lowercase English letters. You may insert spaces anywhere between characters or at either end of each string. After inserting spaces, the two strings must have the same length, and no position may contain spaces in both strings.
For each aligned position, you earn points as follows.
When A = 10, B = -1, and C = -5, one possible alignment is shown below.
| Position | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| X | a | (space) | b | c |
| Y | (space) | d | (space) | c |
The scores at the four positions are -1, -1, -1, and 10, so the total score is 7.
Given X and Y, find the maximum total score obtainable by inserting spaces.
The first line contains three integers A, B, and C. They satisfy 0 < A <= 10,000 and -10,000 <= B, C < 0.
The second line contains X, and the third line contains Y. Both strings consist only of lowercase English letters, and each has length between 1 and 3,000 inclusive.
Print the maximum total score.