Result

AC

Duration

867ms

Code [DL]

{sub(/ +$/,z)}$0{for(;length($0)<length(t);)$0=$0"K";t=$0}$0=t

stdin

                                T                 
                                                  
                                                  
                                                  
                                                  
                  K                               

stdout

                                T
                                T
                                T
                                T
                                T
                  KKKKKKKKKKKKKKK

stderr

strace