A generalization of the Binet-Minc formula for the evaluation of permanents