Architect's Dilemma..! Binary Search Problem Link #include <iostream> #include <algorithm> using namespace std; typedef long long ll; ll n, w, a[100005], pre[100005], maxx[100005]; bool f(int x) { for(int i = 0, j = x; j <= n; j++, i++) { if((x * maxx[j] - (pre[j] - pre[i])) <= w) return 1; } return 0; } int main() { cin >> n >> w; for(int i = 1; i <= n; i++) ...