В условных предложениях третьего типа (Third Conditional) используется следующая структура:
В данном случае, правильный вариант: If they hadn't had any money, their cousin wouldn't have lent them some.
Заполняем пропуск:
They wouldn't have had any money if their cousin hadn't lent them some.
Ответ: wouldn't have had