Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.