Emergence of the benefits and costs of grouping for visual search.