/**
 * Given two complex numbers a and b, implement a function that returns their product.
 *
 * @param a A pair representing the first complex number in the form (realPart, imaginaryPart)
 * @param b A pair representing the second complex number in the form (realPart, imaginaryPart)
 * @return A pair representing the product of the two complex numbers in the form (realPart, imaginaryPart)
 */
fun multiplyComplexNumbers(a: Pair<Double, Double>, b: Pair<Double, Double>): Pair<Double, Double> {

    // Extracting the real and imaginary parts of the complex numbers
    val (aReal, aImaginary) = a
    val (bReal, bImaginary) = b

    // Calculating the real and imaginary parts of the product
    val realPart = aReal * bReal - aImaginary * bImaginary
    val imaginaryPart = aReal * bImaginary + aImaginary * bReal

    // Returning the product of the complex numbers
    return Pair(realPart, imaginaryPart)
}
/**
 * Given two complex numbers a and b, implement a function that returns their product.
 *
 * @param a A pair representing the first complex number in the form (realPart, imaginaryPart)
 * @param b A pair representing the second complex number in the form (realPart, imaginaryPart)
 * @return A pair representing the product of the two complex numbers in the form (realPart, imaginaryPart)
 */
fun multiplyComplexNumbers(a: Pair<Double, Double>, b: Pair<Double, Double>): Pair<Double, Double> {
/**
 * Given two complex numbers a and b, implement a function that returns their product.
 *
 * @param a A pair representing the first complex number in the form (realPart, imaginaryPart)
 * @param b A pair representing the second complex number in the form (realPart, imaginaryPart)
 * @return A pair representing the product of the two complex numbers in the form (realPart, imaginaryPart)
 */
fun multiplyComplexNumbers(a: Pair<Double, Double>, b: Pair<Double, Double>): Pair<Double, Double> {

    // Extracting the real and imaginary parts of the complex numbers
    val (aReal, aImaginary) = a
    val (bReal, bImaginary) = b

    // Calculating the real and imaginary parts of the product
    val realPart = aReal * bReal - aImaginary * bImaginary
    val imaginaryPart = aReal * bImaginary + aImaginary * bReal

    // Returning the product of the complex numbers
    return Pair(realPart, imaginaryPart)
}