Result

AC

Duration

730ms

Code [DL]

#!perl -p
/T/?$r=$':s/.$r/T\n/;1while s/K /KK/

stdin

                           T                      
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                 K                                

stdout

                           T                      
                           T
                           T
                           T
                           T
                           T
                           T
                           T
                           T
                           T
                 KKKKKKKKKKT

stderr

strace