by@n4o847
AC
675ms
read "s" = s p s "T" find "t" = 1 while read "K" find "k" = k if " " k 1 - rep w "K" t k - 1 + rep p exit end s p 1 end
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 T T T T T T T T T T KKKKKKKKKKKKKKKKKKKK