1) Divide the deck evenly into two piles.
2) As long as both of the two piles contain cards, randomly choose one of the piles and place the top card of that pile into the shuffled deck.
3) When one of the two piles runs out, take the $K$ remaining cards of the single pile and throw them away.