-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathH-Alex The Archivist
More file actions
48 lines (47 loc) · 1.53 KB
/
H-Alex The Archivist
File metadata and controls
48 lines (47 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/////////////// PRANTA KUMER PANDIT ///////////////
// Test Case Less Template ||
// ||
// BANGLADESH UNIVERSITY OF BUSINESS AND TECHNOLOGY ||
// INTAKE 52 ||
// DEPARTMENT OF CSE ||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// So, WELCOME TO ISHAN'S PARADISE //
// (-.-) Want to be a Secret tool of next ICPC (-.-) //
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define all(x) (x).begin(), (x).end()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/__gcd(a,b)
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll emni(ll a, ll b) {
while (b) {
a %= b;
swap(a, b);
}
return a;
}
ll di(ll num, ll base) {
ll sumDigits = 0;
while (num > 0) {
sumDigits += num % base;
num /= base;
}
return sumDigits;
}
int main() {
optimize();
ll A;
cin >> A;
ll t = 0;
ll count = A - 2;
for (ll base = 2; base <= A - 1; base++) {
t += di(A, base);
} ll g = emni(t, count);
cout << (t / g) << "/" << (count / g) << "\n";
return 0;
}
// THANKS //