#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

// Forward declaration of isBadVersion API. 
bool isBadVersion(int version);

class Solution {
public:
  int firstBadVersion(int n) {
    int low = 1, high = n;
    while (low < high) {
      int mid = low + (high - low) / 2;
      if (isBadVersion(mid)) {
        high = mid;
      } else {
        low = mid + 1;
      }
    }
    return low;  
  }
};


int main() {
  return 0;
}
