input: Write a function to print out the first n prime numbers using the Sieve of Eratosthenes algorithm. The function should take an integer n as input and return a list of the first n prime numbers. If n is less than or equal to 0, the function should return an empty list.
  
  def sieve_of_eratosthenes(n):
      if n <= 0:
          return []
      max_num = 2 * n * int(n**0.5)  # Approximate upper limit for first n primes
      primes = [True] * (max_num + 1)
      primes[0] = primes[1] = False
      for i in range(2, int(max_num**0.5) + 1):
          if primes[i]:
              for j in range(i*i, max_num + 1, i):
                  primes[j] = False
  
      prime_numbers = []
      count = 0
      for i in range(max_num + 1):
          if primes[i]:
              prime_numbers.append(i)
              count += 1
              if count == n:
                  break
      return prime_numbers
  
  assert sieve_of_eratosthenes(5) == [2, 3, 5, 7, 11]
  assert sieve_of_eratosthenes(1) == [2]
  assert sieve_of_eratosthenes(0) == []
  assert sieve_of_eratosthenes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
  assert sieve_of_eratosthenes(-1) == []
output: def sieve_of_eratosthenes(n):
      if n <= 0:
          return []
      max_num = 2 * n * int(n**0.5)  # Approximate upper limit for first n primes
      primes = [True] * (max_num + 1)
      primes[0] = primes[1] = False
      for i in range(2, int(max_num**0.5) + 1):
          if primes[i]:
              for j in range(i*i, max_num + 1, i):
                  primes[j] = False
  
      prime_numbers = []
      count = 0
      for i in range(max_num + 1):
          if primes[i]:
              prime_numbers.append(i)
              count += 1
              if count == n:
                  break
      return prime_numbers