#include #define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i]; #define ft first #define sc second #define pb push_back #define lb lower_bound #define ub upper_bound #define all(v) (v).begin(),(v).end() #define LB(a,x) lb(all(a),x)-a.begin() #define UB(a,x) ub(all(a),x)-a.begin() #define mod 1000000007 #define FS fixed< using V=vector; using Graph = vector>; using P=pair; typedef unsigned long long ull; typedef long double ldouble; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } const ll INF=1e18; int main(){ cin.tie(0);ios::sync_with_stdio(false); ll n; cin>>n; ll x=(ll)sqrtl(2*n); bool ok=0; ll ans; for(ll i=-20;i<=20;i++){ if(x<=-i)continue; if(i*(i+1)/2==n){ ok=1; //cout< a(m)でm==0というものはできない) modはなるべく最後に取れ! doubleを扱うときには(abs)ではなく'fabs'!!! */