Result

AC

Duration

2679ms

Code [DL]

puts `dd`.gsub(/([^T]{50})./,"\\1T").gsub(/ (?= *T *\Z)/,"0")

stdin

                                       T          
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
 K                                                

stdout

                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
                                       T          
 K0000000000000000000000000000000000000T          

stderr

1+1 records in
1+1 records out
1020 bytes (1.0 kB) copied, 0.0001 s, 10 MB/s

strace