Skip to content

Instantly share code, notes, and snippets.

@ravikiran0606
Created July 27, 2016 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravikiran0606/0c62a4f96622497e0a715554c8f6fdc5 to your computer and use it in GitHub Desktop.
Save ravikiran0606/0c62a4f96622497e0a715554c8f6fdc5 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--)
{
long long int n,ans;
cin>>n;
ans=n*(n-1)/2;
long long int t;
while(n--)
cin>>t;
cout<<ans<<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment