↵
Which unexceptedly got TLE...↵
↵
Then I tested the sample which input is small (n=10, m=40) and recorded the time consuming of each step in [my first solutioni](https://codeforces.net/contest/1767/submission/186104872)↵
↵
↵
codeforTLEs
↵
However, in most of test samples the time consuming is not that much beacuse of a smaller set of good mask1. So I thought about if I permute the number of colors randomly......↵
↵
In 1st attempt I still got TLE, but after changed the seed of java.util.Random, I got AC in [the 2nd attempt](https://codeforces.net/contest/1767/submission/186116293)↵
↵
(I know there must be better implementation but I'm lazy QwQ)↵
↵