An optimal distribution of searching effort for a moving target