Implemented the task which checks the locations of the sprayers and the targets and decides whether to spray the target