Madrid will convert underused office buildings into flats to meet the city's extensive housing needs.