[ruby][alg] euclidean