use divisible two algorithm to calculate greatest common divisor