#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
#define pb push_back
long long m,n,k,i,j;
double ans;
vector<double>v;
int main()
{
cin>>m;
ans=double(m);
n=sqrt(m);
k=m;
for(i=2;i<=n;i++)
{
if(m%i==0)
{
v.pb(double(i));
while(m%i==0)
m/=i;
n=sqrt(m);
}
}
if(m!=1)
v.pb(double(m));
for(i=0;i<v.size();i++)
ans*=double(1-1/v[i]);
cout<<ans<<endl;
}
#include<cmath>
#include<vector>
using namespace std;
#define pb push_back
long long m,n,k,i,j;
double ans;
vector<double>v;
int main()
{
cin>>m;
ans=double(m);
n=sqrt(m);
k=m;
for(i=2;i<=n;i++)
{
if(m%i==0)
{
v.pb(double(i));
while(m%i==0)
m/=i;
n=sqrt(m);
}
}
if(m!=1)
v.pb(double(m));
for(i=0;i<v.size();i++)
ans*=double(1-1/v[i]);
cout<<ans<<endl;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন