for i=1:1:n for i=1:1:n if(min_dis