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.

mantan_g | 267 |

tushki | 198 |

aksht7 | 182 |

ayush1101 | 128 |

namansharmacse17 | 110 |

ARUN_PUNDIR | 730 |

manishgupta8497 | 627 |

AMAN__JAIN | 625 |

Abhimanyu_kumar | 562 |

AJ786 | 541 |

blackshadows | 5335 |

Ibrahim Nash | 5223 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4584 |

Login to report an issue on this page.