by@kurgm
AC
818ms
{sub(/ +$/,z);if($0){for(;length($0)<length(t);)$0=$0"K";t=$0}}$0=t
T K
T T T T T T T T T T T T T KKKKKKKKKKKKKKKKKKKKKKKKKK