Driver Code to test above function
int main ( ) { pair < int , int > P [ ] = { { 0 , 0 } , { 2 , 0 } , { 1 , 1 } , { 2 , 2 } } ; int N = sizeof ( P ) / sizeof ( P [ 0 ] ) ; cout << countTriangles ( P , N ) << endl ; return 0 ; }