This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
void print(int i, int j) {
cout << i << " " << j << "\n";
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
ll k; cin >> k;
if (abs(k)>500) assert(0);
if (k>=0) {
cout << k+3 << "\n";
for (int i=2; i<=k+2; ++i) {
print(1, i);
print(i, k+3);
}
}
else {
k=-k;
cout << k+5 << "\n";
for (int i=2; i<=k+2; ++i) {
print(1, i);
print(i, k+3);
print(i, k+4);
}
print(k+3, k+5);
print(k+4, k+5);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |