input: Write a function to calculate the objective function of a linear equation given by ax + by = c. The function should take three parameters: a, b, and c, and return the result of ax + by - c. If the given equation is ax + y = c, then return a*x + y - c. If the given equation is x = c, then return x - c. If the given equation is y = c, then return y - c.
  def linear_eq(a, b, c):
      return a*x + b*y - c
  
  # Test cases
  assert linear_eq(3, 5, 7) == -7
  assert linear_eq(1, 0, 4) == -4
  assert linear_eq(0, 1, 2) == -2
  assert linear_eq(2, 3, 5) == -5
output: def linear_eq(a, b, c):
      if a != 0 and b != 0:
          return a*x + b*y - c
      elif a != 0 and b == 0:
          return a*x - c
      elif a == 0 and b != 0:
          return b*y - c
      else:
          return 0