Average Distance Formula