题目链接:https://codeforces.com/contest/13/problem/A
暴力
#include <iostream>
using namespace std;
int gcd(int a,int b)
{
return b?gcd(b,a%b):a;
}
int main()
{
int a;
scanf("%d",&a);
int sum=0;
for(int i=2;i<a;i++)
{
int t=a;
while(t)
{
sum+=t%i;
t/=i;
}
}
int d=gcd(sum,a-2);
printf("%d/%d\n",sum/d,(a-2)/d);
return 0;
}