Problems with tag O(n^2 * m^2 * m^(n * m))