Treasure Hunter#1151

Treasure Hunter (Editoryal)

The number of pies eaten by Roma is equal to .

Algorithm implementation

The function gcd computes the greatest common divisor of the numbers and .

int gcd(int a, int b)
{
  return (!b) ? a : gcd(b, a % b);
}

Read the input data.

scanf("%d %d", &a, &b);

Compute and print the answer.

d = gcd(a, b);
printf("%d\n", d);