template <typename int_type>
int_type gcd(int_type x, int_type y)	// 最大公约数 
{
	int_type r;
	
	if (x < y)
	{
		r = x;
		x = y;
		y = r;
	}
	
	r = x % y;
	
	while (r)
	{
		x = y;
		y = r;
		r = x % y;
	}
	
	return y;
}