#include #include int main(int argc, char *argv[]){ int n; int b = 0; scanf("%d", &n); double x = sqrt( 1 + (8 * n) ); if (ceil(x) == floor(x)) { int y = (int)x; y = y - 1; if (y % 2 == 0) { int i = y / 2; printf("YES\n%d\n", i); b = 1; } } if (b == 0) { printf("NO\n"); } return 0; }