Function to find out the number of that vertices
static int vertices ( int N , int A , int B ) { int position = 0 ; int minisum = Integer . MAX_VALUE ; int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) {