Generalized Fermat-Weber problem