#ifndef Local
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#define int long long
#define pb push_back
#define lim 300000
#define till 40001
// # of primes till 1e6 = 7e4
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
using pii = array<int,2>;
const int mod=1000000007ll;
void solve(){
int k;
cin>>k;
if(!k){
cout<<"6 6\n1 4\n1 5\n4 3\n5 3\n3 2\n2 6";
}else if(0<k){
cout<<k+3<<" "<<(k+1)*2<<"\n";
for(int i=2;i<=k+2;i++){
cout<<"1 "<<i<<"\n"<<i<<" "<<k+3<<"\n";
}
}else{
cout<<-k+4<<" "<<(-k+1)*3<<"\n";
cout<<"1 2\n2 3\n3 "<<-k+4<<"\n";
for(int i=4;i<-k+4;i++){
cout<<"2 "<<i<<"\n"<<i<<" "<<i-1<<"\n"<<i<<" "<<-k+4<<"\n";
}
}
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
#ifdef Local
#ifndef INTERACTIVE
freopen("in","r",stdin);
#endif
freopen("out","w",stdout);
#endif
int t=1;
//cin>>t;
while (t--)
{
solve();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct. |
2 |
Correct |
0 ms |
344 KB |
Correct. |
3 |
Correct |
0 ms |
344 KB |
Correct. |
4 |
Correct |
1 ms |
344 KB |
Correct. |
5 |
Correct |
0 ms |
348 KB |
Correct. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct. |
2 |
Correct |
0 ms |
344 KB |
Correct. |
3 |
Correct |
0 ms |
344 KB |
Correct. |
4 |
Correct |
1 ms |
344 KB |
Correct. |
5 |
Correct |
0 ms |
348 KB |
Correct. |
6 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct. |
2 |
Correct |
0 ms |
344 KB |
Correct. |
3 |
Correct |
0 ms |
344 KB |
Correct. |
4 |
Correct |
1 ms |
344 KB |
Correct. |
5 |
Correct |
0 ms |
348 KB |
Correct. |
6 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
7 |
Halted |
0 ms |
0 KB |
- |