Question: You are given an array A of size N . You are also given an integer K . Find the total number of subsets of

You are given an array A of size N. You are also given an integer K.
Find the total number of subsets of A such the the LCM of the elements in each subset is divisible by K.
Note:
LCM of two integers P and Q, is the smallest positive integer that is divisible by both P and Q.
Input Format
The first line contains an integer, N, denoting the number of elements in A.
The next line contains an integer, K, denoting the given integer.
Each line i of the N subsequent lines (where 0i
 You are given an array A of size N. You are

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!