How To Find Minimal Average Cost