Codeforces 1085G(1086E) Beautiful Matrix $dp$+树状数组

NoSuchKey