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,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.284870649186961x):
#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>



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.274678670710022x):
#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"



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.368450036998603x):
#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);

}
// 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.293835331613968x):
#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);

}
// 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.2946079921072675x):
#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);

}
// 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.293653677056469x):
#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);

}
// 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.293325769768113x):
#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);

}
// 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.283117485422459x):
#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);

}
// 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.36737384541383x):
#include <cstdint>

#include <cstdio>

using namespace std;

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(),i;a-=b;

  double a_=1.0/a;

  for(i=0;i<n;++i)h[i]=read()+a-1;

  uint_fast32_t left=0,right=1000000000;

  int_fast64_t temp,cnt=0,mid;

  while (right>left+1) {

    mid=(right+left)>>1;

    cnt=0;

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

      temp=h[i]-b*mid;

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

    }

    if(cnt<=mid)right=mid;

    else left=mid;

  }

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

}