Decomposition rate as an emergent property of optimal microbial foraging