form c to ruby : lcs