Can't understand question

Do I have to make in total 2Q piles?

@rachitbansal2500,
Yes, you have to, but at the end, only Q+1 piles would have some cards, you simply have to print those cards.

@abhijeet.srivastava6499

please see why isn’t this printing any output

@rachitbansal2500,
iprime(2, p) returns 5, check that out.