Result

AC

Duration

1626ms

Code [DL]

$_=`dd`;/T/;s/(?<=\n.{@{[length$`]}}) /#/g;s/(?<=K) */"#"x length$&/ge;print

stdin

                                     T            
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                     K                            

stdout

                                     T            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                                     #            
                     K################            

stderr

1+1 records in
1+1 records out

strace