constructive algo + binary search