-->
当前位置:首页 > 题库

PROGRAMMING:"Xingzhicheng" in Harbin Normal University

Luz5年前 (2021-05-10)题库389
```
There are no duplicate elements in the collection.
"Xingzhi multiplication" of set a and set B is defined as: every element in a is multiplied by every element in B, and all the products obtained form the result set of "Xingzhi multiplication".
For example: a = {1,2,3,0}; B = {4,8,16}, then the result of "Xingzhi multiplication" of a and B is set {4,8,16,32,12,24,48,0}.
```
###Input format
The first line is two integers Na, Nb represents the number of elements of a and B sets (1 < = Na, Nb < = 20),
The second line is an integer representing all the elements of set a,
The third line is NB integers, representing all the elements of set B. all the elements in the test data are integers with absolute values not exceeding 100.
###Output format
Output the result set of "xingzhimultiply". The set elements are sorted from small to large. There are no duplicate elements in the set, and the two elements are separated by a space( Please note that there is no space after the last data)
###Input sample
```in
3 4
2 4 8
1 2 3 4
```
###Output sample
```out
2 4 6 8 12 16 24 32
```
###Input sample
```in
4 3
1 2 3 0
4 8 16
```
###Output sample
```out
0 4 8 12 16 24 32 48
```






answer:If there is no answer, please comment