#include <bits/stdc++.h>
using namespace std;
int a,b;
int main(){
cin>>a>>b;
long long i,y;
long long x=1;
for (i = 1; i <b ;) i*=2;
i/=2;
long long t=b;
t-=i;
y=t-1;
long long arr[a];
for (long long j = 0; j <a ; ++j)
{
arr[t]=b;
t+=x;
b++;
if (t==a){
t=y;
x=-1;
}
}
for (long long j = 0; j < a; ++j)
{
cout<<j<<" "<<arr[j]<<endl;
}
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... |