Problem3958--CCC14J4 Party Invitation

3958: CCC14J4 Party Invitation

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 11  Solved: 3
[Submit] [Status] [Web Board] [Creator:]

Description

You are hosting a party and do not have room to invite all of your friends. You use the following unemotional mathematical method to determine which friends to invite.

Number your friends 1,2,…,K1,2,…,K and place them in a list in this order. Then perform mm rounds. In each round, use a number to determine which friends to remove from the ordered list.

The rounds will use numbers r1,r2,…,rmr1,r2,…,rm. In round ii remove all the remaining people in positions that are multiples of riri (that is, ri,2ri,3ri,…ri,2ri,3ri,…) The beginning of the list is position 11.

Output the numbers of the friends that remain after this removal process.

Input

The first line of input contains the integer KK (1≤K≤100)(1≤K≤100). The second line of input contains the integer mm (1≤m≤10)(1≤m≤10), which is the number of rounds of removal. The next mmlines each contain one integer. The ithith of these lines (1≤i≤m)(1≤i≤m) contains riri (2≤ri≤100)(2≤ri≤100) indicating that every person at a position which is multiple of riri should be removed.

Output

The output is the integers assigned to friends who were not removed. One integer is printed per line in increasing sorted order.

Sample Input Copy

10
2
2
3

Sample Output Copy

1
3
7
9

Source/Category

CCC 数组