Result

AC

Duration

2529ms

Code [DL]

puts `dd`.gsub(/[^T]{50}\K./,"T").sub /K */{|y|"K"*y.size}

stdin

                                              T   
                                                  
                                                  
                                                  
                                                  
  K                                               

stdout

                                              T   
                                              T   
                                              T   
                                              T   
                                              T   
  KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKT   

stderr

0+1 records in
0+1 records out
306 bytes copied, 0.0002199 s, 1.4 MB/s

strace