Condition to check if the cyclic rotation is a valid rotation
if ( ( v . size ( ) - 3 ) % 2 == 0 ) { for ( ll i = 1 ; i < v . size ( ) ; i += 2 ) { ans . push_back ( make_pair ( v [ 0 ] , make_pair ( v [ i ] , v [ i + 1 ] ) ) ) ; } continue ; } p . push_back ( v [ 0 ] ) ; p . push_back ( v [ v . size ( ) - 1 ] ) ;