Problem in understanding question

i am not understanding the question plz help me

@shivabansfore123,

N is the no. of cards in A(0)th stack.
Q is the no. of iterations you have to perform.
Third input are N numbers, repeating the number on cards present in A(0)th stack.

You have to run a loop Q times to check for every i prime number.

for(int i=1;i<=q;i++)
{

For each value of i, process A(i-1)th stack.
While processing, check if the elements of A(i-1)th stack are divisible by i prime number or not.
if it is divisible add that number to B(i)th stack(B is set of stacks).
If not then push that element to A(i)th stack.

}

Print all the stacks of B i.e. from B(0) to B(Q) and then A(Q) stack at last.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.