input: Write a python function to optimize a matrix to reach a target sum.
  assert optimize_matrix([[1, 2], [3, 4]], 10) == [[3, 2], [3, 4]]
  assert optimize_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 30) == "Can't optimize"
  assert optimize_matrix([[2, 2], [2, 2]], 8) == [[2, 2], [2, 2]]
output: def optimize_matrix(matrix, target_sum):
      current_sum = sum(map(sum, matrix))
      if current_sum == target_sum:
          return matrix
      elif current_sum > target_sum:
          difference = current_sum - target_sum
          for i in range(len(matrix)):
              for j in range(len(matrix[0])):
                  if difference == 0:
                      break
                  if matrix[i][j] > 1:
                      reduction = min(matrix[i][j] - 1, difference)
                      matrix[i][j] -= reduction
                      difference -= reduction
              if difference == 0:
                  break
      if sum(map(sum, matrix)) == target_sum:
          return matrix
      else:
          return "Can't optimize"