A generalization of the "probléme des rencontres"