From c028175d4060a5cefb9aad03290fc5d3a856e8d3 Mon Sep 17 00:00:00 2001 From: hanyixuanten <105723997+hanyixuanten@users.noreply.github.com> Date: Mon, 6 Jul 2026 22:01:37 +0800 Subject: [PATCH] new file: P1014.cpp --- P1014.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 P1014.cpp diff --git a/P1014.cpp b/P1014.cpp new file mode 100644 index 0000000..dd091cf --- /dev/null +++ b/P1014.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; +int n; +int main() +{ + scanf("%d", &n); + int a; + for (a = 1; a * (a + 1) / 2 < n; ++a) + ; + int c = a * (a + 1) / 2 - n; + if (a % 2) + printf("%d/%d\n", 1 + c, a - c); + else + printf("%d/%d\n", a - c, 1 + c); + return 0; +} \ No newline at end of file