Input: arr[] = {3, 4, 8}
Output: 1 3 4 8
Explanation:
The non-empty subsequences possible are {3}, {4}, {8}, {3, 4}, {4, 8}, {3, 8}, {3, 4, 8} and their corresponding GCDs are 3, 4, 8, 1, 4, 1, 1.
Therefore, print all the GCDs as {1, 3, 4, 8}.
Input: arr[] = {3, 8, 9, 4, 13, 45, 6}
Output: 1 2 3 4 6 8 9 13 45