int nwd(int a, int b){ while (a!=b){ if (a