Problem E
Mult!

Nora Mainder has a game she plays with her students to help them learn multiplication. She calls out a sequence of numbers and the students have to determine when she names a whole number multiple of the first number. When a student recognizes such a multiple, he or she must call out “Mult!”, ending this round of the game. Then a new round begins with a new initial number. Fortunately her students are very bright and never fail to recognize a multiple, so they all cry out at once—a “multitude” of shouts.
For instance, if she calls out “
Given a sequence of numbers called out by Nora during several rounds of the game, identify which numbers ought to produce a shout of “Mult!”
Input
The first line of input contains an integer
Output
Print all of the sequence elements that will cause the class to shout “Mult!” Each value should be printed on a separate line.
Sample Input 1 | Sample Output 1 |
---|---|
10 8 3 12 6 24 14 12 9 70 5 |
24 70 |
Sample Input 2 | Sample Output 2 |
---|---|
5 3 3 2 5 7 |
3 |