Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <string>
- #include <math.h>
- #include <vector>
- #include <cmath>
- using namespace std;
- int main()
- {
- long long n, A, P, p=1, a;
- bool what = false;
- cin >> n;
- while (2 * n - p*p + p>0)
- {
- if ((2 * n - p*p + p) % (2 * p) == 0)
- {
- P = p;
- A = (2 * n - p*p + p) / (2 * p);
- }
- p++;
- }
- cout << A << " " << P;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment