by@kuromunori
AC
586ms
/o\5&ww]!k]2&wa&[???2&w]]]?-!k?[?*[[?5 v @i/:6k+*?[~w*?[&4~k~-*?]]?]*?[&4?w-*?]&<
95 63 40 34 91 45 09 61 98 98 97 31
14634