An array A having N elements. I want to check if there is any subset of A whose GCD is G.
For Ex:
G=2
A=[2 4 5 6 7 8]
Output:YES
Because gcd(2,4)=G
G= 3
A=[2 4 5 6 7 8]
Output:YES
Because gcd(2,6)=G
An array A having N elements. I want to check if there is any subset of A whose GCD is G.
For Ex:
G=2
A=[2 4 5 6 7 8]
Output:YES
Because gcd(2,4)=G
G= 3
A=[2 4 5 6 7 8]
Output:YES
Because gcd(2,6)=G