stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.293571900792142x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.294344522836458x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.293390255274102x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.293062364303006x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.282854587940047x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.359874919129236x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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;

}

uint_fast32_t 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.285379397100887x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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;

}

uint_fast32_t 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.28615082341025x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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;

}

uint_fast32_t 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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.285198032703347x):
#include <cstdint>

#include <cstdio>

using namespace std;

typedef long long ll;

#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 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;

}

uint_fast32_t 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);

}