def with_last_multiplicity(template_layers_config, multiplicity):
    """
    Change the multiplicity of the last layer in a layered micro-service
    application, while keeping the average service time for a user request
    constant.
    """
    layers_config = [
        layer_config for
        layer_config in template_layers_config]
    layers_config[-1] = \
        layers_config[-1]._replace(
            average_work=layers_config[-1].average_work/multiplicity,
            multiplicity=multiplicity)
    return layers_config