public static int findFirstBadVersion(int n) {
		// write your code here
		int l=1, r=n;
		while (l<=r) {
			int m=l+(r-l)/2;
			if (VersionControl.isBadVersion(m)) {
				if (m==1||!VersionControl.isBadVersion(m-1))
					return m;
				else r=m-1;
			} else {
				l=m+1;
			}
		}
		return 0;
	}