#genocon2021b. [genocon2021_b]Practice 2
[genocon2021_b]Practice 2
Problem Statement
and are strings consisting of A, C, G, T. We denote -th characters of and by s\[i\] and t\[i\], respectively. We define the following score and aim to maximize it by adding blank symbols to and at appropriate positions. Note that lengths of and after adding blank symbols should be the same, and denotes the length. A blank symbol is denoted by -.
= sim(s\[i\], t\[i\])
is a function for calculating the similarity of and , and the following table defines its output.
\
A
C
G
T
-
A
1
-3
-3
-3
-5
C
-3
1
-3
-3
-5
G
-3
-3
1
-3
-5
T
-3
-3
-3
1
-5
-
-5
-5
-5
-5
-5
For example when =CTCGGT and =CATCC, is maximized if - is added right after the first character of , and is added twice right after the last character of .
= C, C-,AT,TC,CG,CG,-T,-
Note that and with balnk symbols are aligned such that same character appears at same position in each string for many positions.
C-TCGGT
CATCC--
We call this task pairwise alignment and described it as strings in two lines.
Given two strings, output its pairwise alignment such that it maximizes .
Constraints
- and are strings consisting of A, C, G, T.
- (length of a string is denoted by .)
Input
Input is given from Standard Input in the following format:
Output
Print a pairwise alignment of input strings such that is maximized. After inserting - in and ,
should be printed in the first line, and should be printed in the second line. If there is more than one alignment that maximizes , you can print any one of them.
The judging system can only accept user's output when: - The first line/second line is equal to the first line/second line of the input if - is removed. - The length of the first line is equal to that of the second line.
Sample Input 1
AGTTGAATTT
GTCGGACTTT
Sample Output 1
AGT-TGAATTT
-GTCGGACTTT