Result

AC

Duration

1375ms

Code [DL]

sed -E ":a;s/(T.{50}) /\1T/;s/K /KK/;ta;N;ba"

stdin

                                             T    
                                                  
                                                  
                                                  
                                                  
        K                                         

stdout

                                             T    
                                             T    
                                             T    
                                             T    
                                             T    
        KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKT    

stderr

strace