Created
July 27, 2016 16:09
-
-
Save ravikiran0606/0c62a4f96622497e0a715554c8f6fdc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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