SHARE
TWEET

Codeforces 40-E

aryobarzan Mar 28th, 2011 303 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top