Advertisement
aryobarzan

Codeforces 40-E

Mar 28th, 2011
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.         int n;
  7.         cin>>n;
  8.         if(n%2==0)
  9.                 cout<<n/2*n/2<<endl;
  10.         else
  11.                 cout<<n/2*(n+1)/2<<endl;
  12.         for(int i=1;i<=n/2;i++)
  13.                 for(int j=n/2+1;j<=n;j++)
  14.                         cout<<i<<" "<<j<<endl;
  15.         return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement