#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
long long count_tastiness(long long x, std::vector<long long> a) {
  int n = (int)a.size();
  vector<ll>S;
  vector<ll>s(60, 0);
  for(int i=0; i<60; ++i) {
    if(i < n) s[i] = (1LL<<i) * a[i];
    if(i) s[i] += s[i-1];
  }
  S.push_back(0);
  for(int i=0; i<60; ++i) {
    int pos = upper_bound(S.begin(), S.end(), s[i]/x - (1LL<<i)) - S.begin();
    for(int j=0; j<pos; ++j) {
      S.push_back(S[j] + (1LL<<i));
    }
  }
  
	return (ll)S.size();
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |