Pabon_SEC

Bubble Sort

Jun 7th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long n,i,test,tc;
  8.  
  9.     scanf("%lld",&test);
  10.  
  11.     for(tc=1;tc<=test;tc++)
  12.     {
  13.         scanf("%lld",&n);
  14.  
  15.         i = n*(n-1);
  16.  
  17.         if(i%4)
  18.         {
  19.             printf("Case %lld: %lld/2\n",tc,i/2);
  20.         }
  21.         else
  22.         {
  23.             printf("Case %lld: %lld\n",tc,i/4);
  24.         }
  25.     }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment