We put the details of component in final output array
a . push_back ( j ) ; b . push_back ( w ) ; c . push_back ( ans ) ; } cout << a . size ( ) << endl ; for ( int j = 0 ; j < a . size ( ) ; ++ j ) cout << a [ j ] << " ▁ " << b [ j ] << " ▁ " << c [ j ] << endl ; }