Given a set of complex values, find their product.

**Input:**

The first line contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains 2 lines, first line represents the array of real part and second line represents the array of imaginary part of the complex numbers that are to be multiplied.Each line has 5 space separated integers.

**Output:**

Print the two integers real part and the imaginary part after the multiplication of the complex numbers.

**Constraints**

1 <= T<=100

**Input**

2

1 2 3 4 5

0 0 0 0 0

1 2 3 4 5

1 2 3 4 5

**Output**

120 0

-480 -480

**Explanation:**

1) We are to multiply the 5 complex numbers and so (1+0i)*(2+0i)*(3+0i)*(4+0i)*(5+0i) we can see that answer is 120 + 0i.

2) Similarly for 2nd Testcase (1+1i)*(2+2i)*(3+3i)*(4+4i)*(5+5i) = -480 -480i

Author: sd5869

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

vamsikrishna55 | 162 |

Vagesh Verma | 154 |

UrGuru | 133 |

chaolinyu | 98 |

Akhil varma | 97 |

abducodes | 650 |

harshtyagi36 | 304 |

highway_to_hell | 252 |

Akhil varma | 250 |

arpit_anshuman | 250 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.