Result

AC

Duration

1388ms

Code [DL]

read s
set t (string split \  (string match -nr T $s))[1]
while read p;
echo $s
set k (string match -r " *K" $p)
[ $k ]&&echo $k(string repeat -n (math $t-(string length $k)) @)&&exit
end

stdin

                               T                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
       K                                          

stdout

                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
                               T                  
       K@@@@@@@@@@@@@@@@@@@@@@@@

stderr

strace