ex3 distance computation for matrix
Implemented ex3 silhouette a(o)