Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <cstdio>
- #include <vector>
- #include <cmath>
- #include <string>
- #include <algorithm>
- #include <string>
- #include <deque>
- #include <iomanip>
- #include <cstddef>
- #define F first
- #define S second
- using namespace std;
- const long double eps = 0.000000005;
- const long double pi = 3.1415926535897932;
- const long inf = 1e9;
- vector<pair<int, int> > ans;
- int main()
- {
- ios_base::sync_with_stdio(0);
- //freopen("bigwall.in", "r", stdin); freopen("bigwall.out", "w", stdout);
- //freopen("input.txt", "r", stdin);
- int n;
- cin >> n;
- if (n == 1)
- {
- cout << 0 << " " << 0 << endl;
- cout << 0 << endl;
- return 0;
- }
- if (n == 2)
- {
- cout << -inf << " " << -inf << endl;
- cout << inf << " " << inf << endl;
- cout << 0 << endl;
- return 0;
- }
- int k = (n - 3) / 2 + 1;
- cout << -1 << " " << 0 << endl;
- cout << k << " " << 0 << endl;
- cout << 0 << " " << k << endl;
- ans.push_back(make_pair(1, 2));
- ans.push_back(make_pair(2, 3));
- ans.push_back(make_pair(1, 3));
- pair<int, int> cur = make_pair(0, k);
- pair<int, int> nnew = make_pair(0, 0);
- for (int i = 4; i <= n; i++)
- {
- if (cur.S == 0)
- {
- nnew = make_pair(cur.F + 1, k - cur.F - 1);
- ans.push_back(make_pair(i - 1, i));
- cur = nnew;
- }
- else
- {
- nnew = make_pair(cur.F, 0);
- ans.push_back(make_pair(i - 1, i));
- cur = nnew;
- }
- cout << cur.F << " " << cur.S << endl;
- }
- cout << ans.size() << endl;
- for (int i = 0; i < ans.size(); i++)
- cout << ans[i].first << " " << ans[i].second << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement