by@kcz146
WA
802ms
$_,*b,c=*$<;c[?K]*=9;puts$_*-~b.size,c[0..~/T/]
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 T T T T KKKKKKKKK