Result

AC

Duration

793ms

Code [DL]

#!ruby -p
$_[I||=$_=~/T/]=?T
$_[/K */]&&=?K*$&.size

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                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
                T                                 
            KKKKT                                 

stderr

strace