#pragma region include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #pragma endregion //#include ///////// #define REP(i, x, n) for(int i = x; i < n; ++i) #define rep(i,n) REP(i,0,n) #define ALL(X) X.begin(), X.end() ///////// #pragma region typedef typedef long long LL; typedef long double LD; typedef unsigned long long ULL; typedef std::pair PLL;// typedef std::pair PII;// #pragma endregion //typedef ////定数 const int INF = (int)1e9; const LL MOD = (LL)1e9+7; const LL LINF = (LL)4e18+20; const LD PI = acos(-1.0); const double EPS = 1e-9; ///////// using namespace::std; LL cal(LL sec){ LL A,B; A = sec; B = sec+1; if( A&1 ){ B /= 2; }else{ A /= 2; } return A*B; } void solve(){ LL N; cin >> N; LL L = 0; LL R = 2000000000; while(R-L>1){ LL mid = (L+R)/2; LL val = cal(mid); if( N < val ){ R = mid; }else{ L = mid; } } if( cal(L) == N ){ cout << "YES" << endl; cout << L << endl; }else{ cout << "NO" << endl; } } #pragma region main signed main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;//小数を10進数表示 cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別 solve(); } #pragma endregion //main()