From 9c2c365a9721237f83fd064db9b40490d2388e8b Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Mon, 18 Mar 2024 23:47:53 +0900 Subject: [PATCH] Add 30878.cpp --- 30xxx/30878.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 30xxx/30878.cpp diff --git a/30xxx/30878.cpp b/30xxx/30878.cpp new file mode 100644 index 00000000..7166121c --- /dev/null +++ b/30xxx/30878.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; + +int gcd(int a, int b) { + return b ? gcd(b, a % b) : a; +} + +void solve(void) { + int m; cin >> m; + + int a = m * m * (90 - m); + int b = 108000; + int g = gcd(a, b); + cout << a / g << "/" << b / g; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file