icpc world final 2013 problem number F :: algo-> binary search