Submission #319596

#TimeUsernameProblemLanguageResultExecution timeMemory
319596kaplanbarUzastopni (COCI17_uzastopni)C++14
80 / 80
14 ms492 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin >> n;
    for(int k = 2; k <= 1e7; k++) {
        ll go = 1ll * k * (k - 1);
        go /= 2;
        if(go < n && (n - go) % k == 0) {
            cout << (n - go) / k << " " << (n - go) / k + k - 1 << "\n";
        }
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...