#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int int64_t
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
tree_order_statistics_node_update>
#define F first
#define S second
#define I insert
#define PB push_back
#define POB pop_back
#define sqr(a) ((a) * (a))
#define P pop
#define max3(a, b, c) (max(a, max(b, c)))
#define max4(a, b, c, d) (max(max(a, b), max(c, d)))
#define min3(a, b, c) (min(a, min(b, c)))
#define min4(a, b, c, d) (min(min(a, b), min(c, d)))
#define MOD 1000000007
#define mod 998244353
int binpow(int a, int p, int m = MOD) {
int ans = 1;
while (p) {
if (p & 1) ans = ((ans % m) * (a % m)) % m;
a = sqr(a) % m;
p >>= 1;
}
return ans;
}
void solve() {
int k;
cin >> k;
if (k < 0) {
k = abs(k);
cout << k + 2 << ' ' << 2 * k << endl;
for (int i = 2; i <= k + 1; i++) {
cout << 1 << ' ' << i << endl << i << ' ' << k + 2 << endl;
}
} else if (k == 0) {
cout << 6 << ' ' << 6 << endl;
cout << "1 4\n"
<< "1 5\n"
<< "4 3\n"
<< "5 3\n"
<< "3 2\n"
<< "2 6" << endl;
} else if (k == 1) {
cout << "1 0" << endl;
} else if (k == 2) {
cout << "6 8\n1 2\n1 3\n1 4\n1 5\n5 4\n2 6\n3 6\n4 6" << endl;
} else {
k = abs(k);
cout << k + 3 << ' ' << 2 * k + 1 << endl;
for (int i = 2; i <= k + 1; i++) {
cout << 1 << ' ' << i << endl << i << ' ' << k + 2 << endl;
}
cout << k + 2 << ' ' << k + 3 << endl;
}
}
int32_t main() {
int t = 1;
// cin >> t;
while (t--) {
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |