Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int t = 0;
- int sz = 1;
- if(n == 1) {
- cout << "1 1" << endl;
- return 0;
- }
- while(t <= n) {
- t += sz;
- if(t == n - 1) {
- cout << "1 0" << endl;
- return 0;
- }
- if(t == n) {
- cout << "0 1" << endl;
- return 0;
- }
- sz++;
- }
- cout << "0 0" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement