Efficient work-from-home allocation for pandemic mitigation