Selfishness and altruism can coexist when help is subject to diminishing returns