Sieve number theory

Sir how can we subtract a no. from a large factorial no. like 1000! using sieve?

Hello @yashme7125 could you please confirm if you are asking this concept of any video or you are asking your logic?
because for calculating large factorials like you mentioned you have to use the concept of array.
and i think for 1000! that also will be not sufficient.

It is the logic I am asking from a question the question is like a no. N! which is a huge no. and a no. X divisible by K distinct primes and we can choose any no. X not more than N! in order to subtract X from so that it become 0

@yashme7125 could you please share the exact question link so that i can help you or if there is any video then please tell me the video content name.

It is codechef contest problem I was looking some hint so I asked you I will share the problem after the contest