https://www.acmicpc.net/problem/1193
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int N;
cin >> N;
int level = 1;
int nume, denom;
int end = 1;
if (N == 1)
cout << level << '/' << level;
else
{
for (int iter = 2; iter <= N; level++)
iter += (level + 1);
for (int iter = 2; iter <= level; iter++)
end += iter;
nume = 1;
denom = level;
for (int iter = end; end > N; end--)
{
denom--;
nume++;
}
if (level % 2 != 0)
{
swap(denom, nume);
cout << denom << '/' << nume;
}
else
cout << denom << '/' << nume;
}
return 0;
}