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.

makeitdonesolo | 64 |

ShubhamJain18 | 64 |

Bishnu Dev Panda | 54 |

DanishBansal | 50 |

abhithakur588 | 50 |

Bishnu Dev Panda | 777 |

yk12 | 512 |

okayboss | 490 |

DevMittal | 472 |

VijethaShastri | 431 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4925 |

Quandray | 4547 |

Login to report an issue on this page.