Input the response from the judge
int response = sc1 . nextInt ( ) ; if ( response == - 1 ) { lower_bound = mid + 1 ; } else if ( response == 1 ) { upper_bound = mid - 1 ; } else if ( response == 0 ) { System . out . println ( " Number ▁ guessed ▁ is ▁ : " + mid ) ; break ; } } } }