pangfengliu / programmingtasks

programming tasks from my courses
67 stars 17 forks source link

Product and Outer Product #323

Open littlehug opened 7 years ago

littlehug commented 7 years ago

Task Description

Given two vector (a, b, c) and (d, e, f), output their inner product in the first line of output, and their cross product at the second line. All the numbers are between -100 and 100.

Input

The input contains only one test case. The first line of input contains six integers a, b, c, d, e, f (-100 < a, b, c, d, e, f < 100).

Output

Print two lines for each test case. The first line contains one integer, representing the inner product of two vector. The second line contains three integers, representing the outer product vector of them.

Sample Input 1

1 2 3 4 5 6

Sample Output 1

32
-3 6 -3

Sample Input 2

1 -3 2 -2 1 3

Sample Output 2

1
-11 -7 -5