void divide (int x, int y, int*q, int*r)
{
*q = x / y;
*r = x % y;
}