Optimal foraging of sticklebacks on swarming prey