adding kth smallest program