Zadatak24-15

#include <iostream>

using namespace std;

int main()
{
int n,i, k;
cin >> k; // broj kobasica
cin >> n; // broj clanova zirija
int br = 0;
for(i=1; i<n; i++)
{ if(i*k%n==0)
br++ ; }
cout << n – 1 – br << endl;
return 0;
}

Advertisements