stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

 

/* attention

    long longのシフト演算には気をつけよう

    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも

    sizeは(int)とキャストしよう

    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？

*/



ll N, A, B;

vector<ll> h(100005, 0);



bool check(int n){

    if(n == 0) return false;

    ll res = 0;



    for(int i=0; i<N; i++){

        ll tmp = h[i]-B*n;

        if(tmp <= 0) continue;



        res += (tmp-1)/(A-B) + 1;

    }



    if(res <= n) return true;

    else return false;

}



ll solve(){

    ll left = 0, right = 1e9;

    ll mid;



    while(left+1 < right){

        mid = (left + right)/2;

        if(check(mid)) right = mid;

        else left = mid;

    }



    return right;

}



int main(){

    cin >> N >> A >> B;

    for(int i=0; i<N; ++i) cin >> h[i];



    cout << solve() << endl;

    

    return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define repr(i,a,b) for(int i=a;i<b;i++)

#define rep(i,n) for(int i=0;i<n;i++)

#define reprrev(i,a,b) for(int i=b-1;i>=a;i--)

#define reprev(i,n) reprrev(i,0,n)

typedef long long ll;

typedef unsigned long long ull;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }



/* attention

    long longのシフト演算には気をつけよう

    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも

    sizeは(int)とキャストしよう

    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？

    詰まった時に、別の分野の問題として考え直す（これdpでは？、グラフとしてみればいいのでは？）

    多くの問題はパターンマッチだが、パターンに落とし込むまでが難しく、そのための訓練としてわからない問題をあれこれ色々な角度から考察してみるのではないか

    cin.tie(0);

    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう



*/



const ll mod = 1e9+7;



void chmod(ll &M){

    if(M >= mod) M %= mod;

    else if(M < 0){

        M += (abs(M)/mod + 1)*mod;

        M %= mod;

    }

}



int getl(int i, int N) { return i==0? N-1:i-1; };

int getr(int i, int N) { return i==N-1? 0:i+1; };



/* <--------------------------------------------> */



int n;

ll A, B;

vector<ll> h;



bool check(ll k){

    ll cnt=0;

    rep(i, n){

        if(h[i]-k*B <= 0) continue;

        

        cnt += (h[i]-k*B + (A-B-1)) / (A-B);

    }

    if(cnt<=k) return true;

    else return false;

}



int main(void){

    cin.tie(0);

    ios::sync_with_stdio(false);



    cin >> n;

    cin >> A >> B;

    h.assign(n, 0);

    rep(i, n) cin >> h[i];



    int left=0, right=1e9;

    int mid;

    while(right-left > 1){

        mid = (left+right)/2;

        if(check(mid)) right=mid;

        else left=mid;

    }



    cout << right << '\n';





    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

#define rep(i,n) for(int i=0;i<(n);++i)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



int main(){

  ll n=in(),a=in(),b=in(),ans=1e9;

  vector<ll> h(n);

  rep(i,n){

    scanf("%lld",&h[i]);

  }

  sort(all(h));

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=ceil(1.0*temp/(a-b));

      }

    }

    bool flg=cnt<mid;

    if(flg){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=ceil(1.0*temp/(a-b));

    }

  }

  ans=min(ans,max(cnt,left));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp>0){

      cnt+=ceil(1.0*temp/(a-b));

    }

  }

  ans=min(ans,max(cnt,right));

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdint>

#include <cstdio>

using namespace std;

#define rep(i,n) for(uint_fast32_t i=0;i<(n);++i)

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline uint_fast32_t read(){

  uint_fast32_t a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int h[100001];

int main(){

  uint_fast32_t n=read(),a=read(),b=read();a-=b;

  double a_=1.0/a;

  rep(i,n)h[i]=read();

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

    rep(i,n){

      temp=h[i]-b*mid+a-1;

      if(temp>0)cnt+=temp*a_;

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

  printf("%u\n",right);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

#define rep(i,n) for(int i=0;i<(n);++i)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}



int main(){

  ll n=read(),a=read(),b=read(),ans=1e9;

  vector<ll> h(n);

  rep(i,n){

    h[i]=read();

  }

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=ceil(1.0*temp/(a-b));

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp>0){

      cnt+=ceil(1.0*temp/(a-b));

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=ceil(1.0*temp/(a-b));

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdint>

#include <cstdio>

using namespace std;

#define rep(i,n) for(uint_fast32_t i=0;i<(n);++i)

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline uint_fast32_t read(){

  uint_fast32_t a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int h[100001];

int main(){

  uint_fast32_t n=read(),a=read(),b=read();a-=b;

  double a_=1.0/a;

  rep(i,n)h[i]=read();

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

    rep(i,n){

      temp=h[i]-b*mid+a-1;

      if(temp>0)cnt+=temp*a_;

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

  printf("%u\n",right);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

#define rep(i,n) for(int i=0;i<(n);++i)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}



int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  vector<ll> h(n);

  rep(i,n){

    h[i]=read();

  }

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid+c-1;

      if(temp>0){

        cnt+=temp/c;

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right+c-1;

    if(temp>0){

      cnt+=temp/c;

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left+c-1;

    if(temp>0){

      cnt+=temp/c;

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdint>

#include <cstdio>

using namespace std;

#define rep(i,n) for(uint_fast32_t i=0;i<(n);++i)

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline uint_fast32_t read(){

  uint_fast32_t a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int h[100001];

int main(){

  uint_fast32_t n=read(),a=read(),b=read();a-=b;

  double a_=1.0/a;

  rep(i,n)h[i]=read();

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

    rep(i,n){

      temp=h[i]-b*mid+a-1;

      if(temp>0)cnt+=temp*a_;

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

  printf("%u\n",right);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

#define rep(i,n) for(int i=0;i<(n);++i)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}



int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  vector<ll> h(n);

  rep(i,n){

    h[i]=read();

  }

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=ceil(1.0*temp/c);

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp>0){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdint>

#include <cstdio>

using namespace std;

#define rep(i,n) for(uint_fast32_t i=0;i<(n);++i)

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline uint_fast32_t read(){

  uint_fast32_t a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int h[100001];

int main(){

  uint_fast32_t n=read(),a=read(),b=read();a-=b;

  double a_=1.0/a;

  rep(i,n)h[i]=read();

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

    rep(i,n){

      temp=h[i]-b*mid+a-1;

      if(temp>0)cnt+=temp*a_;

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

  printf("%u\n",right);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

#define rep(i,n) for(int i=0;i<(n);++i)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}



int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  vector<ll> h(n);

  rep(i,n){

    h[i]=read();

  }

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=temp/c+((temp%c)?1:0);

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp>0){

      cnt+=temp/c+((temp%c)?1:0);

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=temp/c+((temp%c)?1:0);

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdint>

#include <cstdio>

using namespace std;

#define rep(i,n) for(uint_fast32_t i=0;i<(n);++i)

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline uint_fast32_t read(){

  uint_fast32_t a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int h[100001];

int main(){

  uint_fast32_t n=read(),a=read(),b=read();a-=b;

  double a_=1.0/a;

  rep(i,n)h[i]=read();

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

    rep(i,n){

      temp=h[i]-b*mid+a-1;

      if(temp>0)cnt+=temp*a_;

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

  printf("%u\n",right);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>



using namespace std;

typedef long long ll;

#define rep(i,n) for(int i=0;i<(n);++i)



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

ll h[100010];

int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  rep(i,n)h[i]=read();

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=ceil(1.0*temp/c);

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdint>

#include <cstdio>

using namespace std;

#define rep(i,n) for(uint_fast32_t i=0;i<(n);++i)

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline uint_fast32_t read(){

  uint_fast32_t a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int h[100001];

int main(){

  uint_fast32_t n=read(),a=read(),b=read();a-=b;

  double a_=1.0/a;

  rep(i,n)h[i]=read();

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

    rep(i,n){

      temp=h[i]-b*mid+a-1;

      if(temp>0)cnt+=temp*a_;

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

  printf("%u\n",right);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

#include <algorithm>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;



#define MOD 1000000007

#define REP(i, N) for (int i = 0; i < N; ++i)

#define REP1(i, N) for (int i = 1; i <= N; ++i)

#define RREP(i, N) for (int i = N - 1; i >= 0; --i)

#define ALL(a) a.begin(), a.end()



int N;

ll A, B;

vector<ll> h(100001);



bool enough(ll t)

{

  ll add = 0;

  REP(i, N)

  {

    if (B * t < h[i])

      add += ((h[i] - B * t) + (A - B) - 1) / (A - B);

  }

  return (add <= t);

}



ll meguru()

{

  ll ng = 0, ok = 1e9;

  while (1 < abs(ok - ng))

  {

    ll mid = (ok + ng) / 2;

    if (enough(mid))

      ok = mid;

    else

      ng = mid;

  }

  return ok;

}



int main()

{

  cin >> N >> A >> B;

  REP(i, N)

  cin >> h[i];

  cout << meguru() << endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <algorithm>

#include <iostream>

#include <vector>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;



#define MOD 1000000007

#define REP(i, N) for (int i = 0; i < N; ++i)

#define REP1(i, N) for (int i = 1; i <= N; ++i)

#define RREP(i, N) for (int i = N - 1; i >= 0; --i)

#define ALL(a) a.begin(), a.end()



int n;

ll a, b;

vector<ll> vc;



bool check(ll t) {

  ll cnt = 0;

  REP(i, n) {

    if (vc[i] > b * t) {

      cnt += (vc[i] - b * t + a - b - 1) / (a - b);

    }

  }

  return cnt <= t;

}



int main() {

  cin >> n >> a >> b;

  REP(i, n) {

    ll h;

    cin >> h;

    vc.push_back(h);

  }

  ll ok = 1e9, ng = 0;

  while (1 < abs(ok - ng)) {

    ll mid = (ok + ng) / 2;

    if (check(mid))

      ok = mid;

    else

      ng = mid;

  }

  cout << ok << endl;

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <math.h>

#include <string>

#include <cstdio>

#include <vector>

#include <set>

#include <cassert>

#include <cstdlib>

#include <complex>

#include <cctype>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <sstream>

#include <functional>

#include <iomanip>

//#include <windows.h>  //Should be deleted when using AtCoder&POJ

using namespace std;



#define ll long long

#define pq_small priority_queue<int,vector<int>,greater<int> >

/**==Info==

*Program:1

*Problem:Widespread

*Date:2017-10-6

*Algorithm:Binary Search+Simluate+Brute Force (TLE Possible JP)

*Stats:Unknown*/

ll n,a,b;

ll h[100005],t[100005];



bool check(ll m){

	//How to write this?

	//Evreryone minus b*m then find whether it is overflow!!!!

	ll cost=0;

	

	for(int i=0;i<n;i++){

		if(h[i]-b*m>0){

			cost+=(h[i]-b*m+(a-b-1))/(a-b);

		}

	}

	

	return cost<=m;

}

int main(){

	cin>>n>>a>>b;

	for(ll i=0;i<n;i++) cin>>h[i];

	

	ll l=1,r=1e9;

	while(l<=r){

		ll m=(l+r)/2;

		if(check(m)){

			r=m-1;

		}else{

			l=m+1;

		}

	}

	cout<<l<<endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

int n,a,b,h[100000],i,l,m,r;

long long x;

main(){

  for(scanf("%d%d%d",&n,&a,&b),a-=b;i<n;l=1,r=1e9)scanf("%d",h+i++);

  while(l<r){

    m=(l+r)/2;

    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;

    x<=m?r=m:l=m+1;

  }

  printf("%d\n",l);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <cstdio>

#include <vector>

#include <queue>

#include <list>

#include <cstdlib>

#include <algorithm>

#include <set>

#include <map>

#include <deque>

#include <cstring>

#include <cmath>

//#include<bits/stdc++.h>

using namespace std;



const int SIZE=100005;

const long long INF=1e9;

int n,a,b,h[SIZE];



bool check(long long times){

	long long t=times;

	for(int i=0;i<n;i++){

		if(times*b>=(long long)h[i]);

		else if(times*a>=(long long)h[i]){

			t-=(long long)ceil((double)((double)(h[i]-times*b))/((double)(a-b)));

			if(t<0) return false;

		}

		else return false;

	}

	return true;

}



int main(){

	cin>>n>>a>>b;

	for(int i=0;i<n;i++) cin>>h[i];

	long long lb=-1,rb=INF;

	while(rb-lb>1){

		long long mid=(lb+rb)/(long long)2;

		if(check(mid)){

			rb=mid;

		}

		else{

			lb=mid;

		}

	}

	cout<<rb<<endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

int n,a,b,h[100000],i,l,m,r;

long long x;

main(){

  for(scanf("%d%d%d",&n,&a,&b),a-=b;i<n;l=1,r=1e9)scanf("%d",h+i++);

  while(l<r){

    m=(l+r)/2;

    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;

    x<=m?r=m:l=m+1;

  }

  printf("%d\n",l);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

 

using namespace std;

 

int h[111111];

int n, a, b;

 

bool ok(int t){

	long long q = 0;

	for(int i = 1; i <= n; ++i){

		if (1ll * a * t < h[i]) return false;

		long long x = h[i] - 1ll * b * t;

		if (x > 0) q += (x - 1) / (a - b) + 1;

		if (q > t) return false; 

	}

	return true;

}

 

int main(){

	scanf("%d%d%d",&n,&a,&b);

	for(int i = 1; i <= n; ++i) scanf("%d",&h[i]);

	int l = 1, r = 1e9;

	while (l <= r){

		int md = (l + r) >> 1;

		if (ok(md)) r = md - 1;

		else l = md + 1;

	}

	printf("%d",l);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

int n,a,b,h[100000],i,l,m,r;

long long x;

main(){

  for(scanf("%d%d%d",&n,&a,&b),a-=b;i<n;l=1,r=1e9)scanf("%d",h+i++);

  while(l<r){

    m=(l+r)/2;

    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;

    x<=m?r=m:l=m+1;

  }

  printf("%d\n",l);

}

// Fastest known solution for this problem: