https://www.acmicpc.net/problem/1193
#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
int a=0;
for(int i=1;;i++){
if(n>i){
a=n-i;
n=a;
}
else{
if(i%2==1) printf("%d/%d",i+1-n,n);
else printf("%d/%d",n,i+1-n);
break;
}
}
}