by@shell_mug
AC
666ms
NR==1{gsub("T(.+)","T");t=$0}NR>1{print t}END{gsub("K(.+)","K");while(length($0)<length(t)){sub("K","KK")}print $0}
T K
T T T T T T T T T T T T T T T T T T T T T T T T KKKKKKKKKKKKKKKKKKK