Optimal configuration of a two-dimensional bristled wing