http://oj.tsinsen.com/A1134
#include "bits/stdc++.h"
using namespace std;
int main () {
int q; scanf("%d", &q);
int n = 1, s = 0;
while (s + n < q) s += (n++);
for (int m = 1; m <= n; ++m)
if (s + m == q) {
printf("%d/%d\n", n + 1 - m, m);
break;
}
return 0;
}