AC

1688 2-base
8 matrix DP