Problem A
Copying DNA
Evolution is a seemingly random process which works in a way which resembles certain approaches we use to get approximate solutions to hard combinatorial problems. You are now to do something completely different.
Given a DNA string
-
Get GT......... by copying and reversing “TG” from
. -
Get GTAC....... by copying “AC” from
. -
Get GTAC...TA.. by copying “TA” from the partial
. -
Get GTAC...TAAT by copying and reversing “TA” from the partial
. -
Get GTACAATTAAT by copying “AAT” from the partial
.
Input
The first line of input gives a single integer,
Output
Output for each test case the number of copy operations
needed to create
Sample Input 1 | Sample Output 1 |
---|---|
5 ACGT GTAC A C ACGT TGCA ACGT TCGATCGA A AAAAAAAAAAAAAAAAAA |
2 impossible 1 4 6 |