Function to find ways to arrange K green balls among N balls such that we need exactly i moves to collect all K green balls
void arrange_balls ( int n , int k ) { factorialfun ( ) ; modinversefun ( ) ; for ( int i = 1 ; i <= k ; i ++ ) cout << ( 1LL * binomial ( n - k + 1 , i ) * binomial ( k - 1 , i - 1 ) ) % mod << " ▁ " ; }