Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream f("bile.in");
- ofstream g("bile.out");
- long int n;
- int main()
- {
- f>>n;
- long int n1,n2,n3,n4;
- if(n%2==0)
- {
- n1=n/2,n2=n/2+2,n3=(3*n+2)/2,n4=(3*n+2)/2+1;
- while (n1>=1&&n3>=n+1)
- g<<n3<<' '<<n4<<'\n',--n3,++n4,g<<n1<<' '<<n2<<'\n',--n1,++n2;
- g<<n/2+1;
- }
- else
- {
- n1=n/2+1,n2=n/2+2,n3=(3*n+2)/2,n4=(3*n+2)/2+2;
- while (n1>=1&&n4<=2*n+1)
- g<<n1<<' '<<n2<<'\n',--n1,++n2,g<<n3<<' '<<n4<<'\n',--n3,++n4;
- g<<1<<' '<<n+1<<'\n';
- g<<(3*n+2)/2+1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement