D. Vector Product

0

0 votes
Binary Search, Medium, String
Problem

You are given two vectors in the form of
vector A=a1i+a2j+a3k and B=b1i+b2j+b3k
where a1,a2,a3,b1,b2,b3 are integers.
and i, jk are dimensions of the given vector.

You have to find the vector product A×B
It is guaranteed that all three dimensions are given.

Input

First line contain number of test cases t

Each test case contain 2 lines denoting vector A and vector Brespectively.

Output

Print a single line for each test case consist of vector product in the form C=c1i+c2j+c3k

Constraints

1<=t<=105

106<=a1,a2,a3,b1,b2,b3<=106

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

(5i6j+9k)×(8i3j+12k)

                =(ijk5698312)

=((6)12(3)9)i(512(8)9)j+(5(3)(8)(6))k

=45i132j63k

Editor Image

?