Number of minimum picks to get 'k' pairs of socks from a drawer

A drawer contains socks of n different colours. The number of socks available of ith colour is given by a[i] where a is an array of n elements. Tony wants to take k pairs of socks out of the drawer. However, he cannot see the colour of the sock that he is picking. You have to tell what is the minimum number of socks Tony has to pick in one attempt from the drawer such that he can be absolutely sure, without seeing their colours, that he will have at least k matching pairs.

Example 1:

Input: N = 4, a[] = {3, 4, 5, 3}, K = 6
Output: 15
Explanation: The worst case scenario, after
14 picks will be 3,3,3,3 or 3,1,5,3 where
each number represents picks of socks of
one colour. Hence, 15th pick will get the
5th pair for sure.
I am not able to understand this question please explain

hello @poojadas408

check this-> link