diff --git a/25xxx/25592.cpp b/25xxx/25592.cpp new file mode 100644 index 00000000..8da863c2 --- /dev/null +++ b/25xxx/25592.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; + +void solve(void) { + int n; cin >> n; + + for (int i=1; ; i++) { + if (n >= i*(i+1)/2) continue; + cout << (i & 1 ? i*(i+1)/2-n : 0); + return; + } +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file