create undirected edges
adj . get ( 1 ) . add ( 2 ) ; adj . get ( 2 ) . add ( 1 ) ; adj . get ( 1 ) . add ( 3 ) ; adj . get ( 3 ) . add ( 1 ) ; adj . get ( 2 ) . add ( 4 ) ; adj . get ( 4 ) . add ( 2 ) ; adj . get ( 2 ) . add ( 5 ) ; adj . get ( 5 ) . add ( 2 ) ; int [ ] dp1 = new int [ n + 1 ] ; int [ ] dp2 = new int [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) { dp1 [ i ] = 0 ; dp2 [ i ] = 0 ; }