#include #include using namespace std; int ecuatie(int a, int b, int c) { double x1, x2, delta; delta=b*b-4*a*c; if(delta<0) return -32000; delta=sqrt(delta); x1=(-b-delta)/2*a; x2=(-b+delta)/2*a; if(x1!=x2) { if(x1>x2) return x1; else return x2; } if(x1==x2) return x1; } int main() { int n, g, t; cin>>n; g=ecuatie(1,1,-2*n); if(g*(g+1)/2==n) t=g; else t=n-g*(g+1)/2; cout<