Utility function for matrix multiplication
void multiply ( int [ , ] A , int [ , ] B , int [ , ] C ) { for ( int i = 0 ; i < V ; i ++ ) { for ( int j = 0 ; j < V ; j ++ ) { C [ i , j ] = 0 ; for ( int k = 0 ; k < V ; k ++ ) { C [ i , j ] += A [ i , k ] * B [ k , j ] ; } } } }