The Coronavirus is evil and loves to store everything into its RNA, which is why it often has genetic mutation. One day the Coronavirus get two RNA sequences, and it decided to add them to its RNA. It will add the first sequence to the end of its current RNA, and next turn it will add the another one. For the following turns, the virus will always add the sequence it got in the previous turn to the beginning of the current sequence. Suppose the virus has nothing in its RNA initially, and two RNA sequences are: {"abc","def"}{"abc","def"}{"abc","def"} (The virus has no sanity, so the RNA sequence can be far more than "agcu" !As an expert in biochemistry, GGG has been devoting himself into analyzing this virus since its outbreak, whose task is to figure out the exact composition of this virus . However, what he can get is only how many turns the virus has changed its RNA and the initial two sequences. can you help him to solve this problem?
The Coronavirus is evil and loves to store everything into its RNA, which is why it often has genetic mutation. One day the Coronavirus get two RNA sequences, and it decided to add them to its RNA. It will add the first sequence to the end of its current RNA, and next turn it will add the another one. For the following turns, the virus will always add the sequence it got in the previous turn to the beginning of the current sequence. Suppose the virus has nothing in its RNA initially, and two RNA sequences are: {"abc","def"}{"abc","def"}{"abc","def"} (The virus has no sanity, so the RNA sequence can be far more than "agcu" ! ) , the final RNA sequence after each turn will be: F[1]=“abc”F[1] = “abc”F[1]=“abc” F[2]=“def”F[2 ] = “def”F[2]=“def” F[3]=“abcdef”F[3 ] = “abcdef”F[3]=“abcdef” F[4]=“defabcdef”F[4 ] = “defabcdef”F[4]=“defabcdef” F[5]=“abcdefdefabcdef”F[5 ] = “abcdefdefabcdef”F[5]=“abcdefdefabcdef” …… As an expert in biochemistry, GGG has been devoting himself into analyzing this virus since its outbreak, whose task is to figure out the exact composition of this virus (That is: how many times does each letter appear in the final sequence). However, what he can get is only how many turns the virus has changed its RNA and the initial two sequences. can you help him to solve this problem?