cf1228e专题

CF1228E. Another Filling the Grid(容斥原理+排列组合)

You have ?×? square grid and an integer ?. Put an integer in each cell while satisfying the conditions below. All numbers in the grid should be between 1 and ? inclusive. Minimum number of the ?-th r