stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstring>

#include <cstdio>

#define M 100010



using namespace std;



long long num[M];

long long n,a,b;



bool cheak(long long x)

{

    long long cn=a-b;

    long long gl=0;

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

    {

        long long re=num[i]-b*x;

        if(re<=0)

            continue;

        else

        {

            gl+=re/cn;

            gl+=(re%cn!=0);

            if(gl>x)

                return false;

        }

    }

    if(gl>x)

        return false;

    return true;

}

int main()

{

    long long l=0,r=1e9;

    long long ans=r;

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

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

    {

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

    }

    while(l<=r)

    {

        long long mid=(l+r)/2;

        if(cheak(mid))

        {

            r=mid-1;

            ans=min(mid,ans);

        }

        else

            l=mid+1;

    }

    printf("%lld\n",ans);

    return 0;

}


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<map>

#include<queue>

#define inf1 1000000009

#define inf -1

using namespace std;

long long A,B,N;

long long s[100006];

bool cool(int a){

long long t=a;long long s1[100006];

 for(int i=1;i<=N;i++)

    s1[i]=s[i];

 for(int i=1;i<=N;i++)

   { s1[i]-=a*B;

    if(s1[i]<=0)continue;

      int y;

      if(s1[i]%(A-B)==0)y=s1[i]/(A-B);

      else y=s1[i]/(A-B)+1;

       t-=y;

   }//cout<<endl;

 if(t>=0)return true;

 return false;

}

int main(){



 cin>>N>>A>>B;

  for(int i=1;i<=N;i++)

  cin>>s[i];

  long long l=0,L=inf1,s1;s1=inf1;

  while(l<L){

   long long man=(l+L)/2;

    if(cool(man)) L=man,s1=min(s1,man);

    else l=man+1;

    //cout<<L<<" "<<l<<endl;

  }

  cout<<s1<<endl;

}

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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<cstring>

#include<stdio.h>

#include<algorithm>

#include<algorithm>

#define L long long

#include<string.h>

#include <math.h>

long long  array1[100002];

using namespace std;

int n;

long long a,b;

int judge(int x)

{

    long long sum=0;

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

      {

          long long num=array1[i]-x*b;

          if(num>0)

          {

              sum+= ceil((num*1.0)/(a-b));



          }

          if(sum>x||sum<0)

                return 0;



      }

      return 1;

}



int main()

{   int i;

   cin>>n>>a>>b;

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

        {

        cin>>array1[i];

        }

            sort(array1,array1+n);

        long long l=0,r=array1[n-1];

         while(l<r)

         {

             long long mind=(l+r)>>1;

             if(judge(mind)==1)  r=mind;

             else

                 l=mind+1;

         }

         cout<<r<<endl;





       return 0;

}












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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <algorithm>



using namespace std;

typedef long long ll;

const int maxN=1e5+5;



ll a[maxN],n,A,B;



bool check(ll x)

{

    ll k,sum=0;

    for(k=1;k<=n;k++)

    {

        if(a[k]-x*B<=0)continue;

        sum+=(a[k]-x*B)/(A-B);

        if((a[k]-x*B)%(A-B)!=0)sum++;

    }

    return sum<=x;

}



int main()

{

    ll k,l,r,mid;

    scanf("%lld%lld%lld",&n,&A,&B);

    for(k=1;k<=n;k++)

        scanf("%lld",&a[k]);

    l=1;r=1e9;

    while(r-l>5)

    {

        mid=(l+r)>>1;

        if(check(mid))r=mid;

        else l=mid;

    }

    for(;l<=r;l++)

        if(check(l))break;

    printf("%lld",l);

    return 0;

}


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int n;

long long a,b;



long long h[100005];

long long r[100006];



bool check(long long x)

{

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

        r[i]=max(h[i]-b*x,0ll);

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

    {

        x-=(r[i]+a-b-1)/(a-b);

    }

    if(x<0)return false;

    return true;

}



long long erfen(long long l,long long r)

{

    if(l==r)

        return l;

    int mid=(l+r)/2;

    if(check(mid))return erfen(l,mid);

    else return erfen(mid+1,r);

}



int main()

{

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

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

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

    printf("%lld",erfen(0,1e9));

    return 0;

}


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

typedef long long ll;

ll A,B;

ll D;

int N;

ll h[100005];

int solve(ll n)

{

    ll sum=B*n;

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

    {

        if(h[i]>sum)

        {

            n-=(h[i]-sum)/D;

            if((h[i]-sum)%D)

                n--;

        }

    }

    if(n<0)

        return 0;

    else

        return 1;

}

int main()

{



    scanf("%d",&N);

    scanf("%lld%lld",&A,&B);

    D=A-B;

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

    {

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



    }

    ll l=1;

    ll r=1e9;

    ll mid=(l+r)/2;

    while(l<r)

    {

        int flag=solve(mid);

        if(flag)

            r=mid;

        else

            l=mid+1;

        mid=(l+r)/2;

    }



    printf("%lld",l);

}


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define mod 1000000007

#define MOD(x) ((x)%mod)

long long n,a,b;

long long h[100005];

bool check(long long x)

{

	long long num=0;

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

	{

		if(h[i]<=x*b) continue;

		long long tmp;

		tmp=(h[i]-x*b)/a;

		if(tmp*a!=h[i]-x*b) tmp++;

		num+=tmp;

	}

	if(num>x) return 0;

	return 1;

}

int main()

{

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

	a-=b;

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

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

	long long l=1,r=1e9;

	long long m;

	while(l<r)

	{

		m=(l+r)/2;

		if(check(m)) r=m;

		else l=m+1;

	}

	printf("%lld",l);

	return 0;

}

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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

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

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

typedef long long ll;

inline int read() {

	int x=0,s=1; char ch=getchar();

	while (ch<'0'||ch>'9') { if (ch=='-') s=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return s*x;

}



const int MAXN=400005,Mo=1000000007;

int n,m,q;

ll A,B,a[MAXN],b[MAXN];

bool check(ll x){

	ll num=0;

	FOR(i,1,n)

	if (a[i]>x*B) {

		ll y=a[i]-x*B;

		num+=(y+A-1)/A;

		if (num>x) return false;

	}

	return true;

}

int main(){

	n=read();

	A=read(),B=read();

	A-=B;

	FOR(i,1,n) a[i]=read();

	int l=0,r=1e9+1,mid;

	while (l+1<r) {

		mid=(l+r)/2;

		if (check(mid)) r=mid; else l=mid;

	}

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

	

	return 0;

}



/*

*/


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



const int MAXN = 1e5 + 10;



long long n, a, b, val;

long long v[MAXN];



long long check (int md) {

	long long ret = 0;

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

		if (v[i] - md * b > 0) {

			ret += (v[i] - md * b + a - 1) / a;

		}

	}

	return ret;

}



int main (void) {

	scanf("%lld%ld%lld", &n, &a, &b);

	a = a - b;

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

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

	}

	int st = 1, en = 1e9, md;

	while (st != en) {

		md = (st + en) >> 1;

		if (check(md) <= md) en = md;

		else st = md + 1;

	}

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

}

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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define N (int)1e6+5

using namespace std;

int n, a, b;

int h[N];

bool check(int x) {

	int dis = a - b;

	int mns = b * x;

	int cnt = 0;

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

		int tmp = h[i] - mns;

		if (tmp <= 0) continue;

		cnt += (tmp + dis - 1) / dis;

		if (cnt > x) return false;

//		cout << i << " " << tmp << " " << cnt << endl;

	}

	return cnt <= x;

}

int main() {

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

	int mx = 0;

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

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

		mx = max(mx, h[i]);

	}

	int l = 1, r = (mx+b-1) / b, ans;

	while (l <= r) {

		int mid = ((l - r) >> 1) + r;

		if (check(mid)) {

			r = mid - 1;

			ans = mid;

		} else {

			l = mid + 1;

		}

//		cout << mid << " " << ans << " " << check(mid) << endl;

	}

	printf("%d", ans);

	return 0;

}

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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,a,b;

int h[100005];

inline bool check(long long times)

{

	long long tmp=times;

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

    {

        long long blood=h[i]-b*times;

        if(blood>0)

        {

            long long cnt=blood/(a-b)+(blood%(a-b)==0?0:1);

            tmp-=cnt;

            if(tmp<0)

            {

            	return false;

			}

        }

    }

    return true;

}

int main()

{

	cin>>n>>a>>b;

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

	{

		cin>>h[i];

	}

	int lb=0,rb=1e9,mid;

	int ans=0;

	while(lb<=rb)

	{

		mid=(lb+rb)/2;

		if(check(mid))

		{

			ans=mid;

			rb=mid-1;

		}

		else

		{

			lb=mid+1;

		}

	}

	cout<<ans;

	return 0;

}

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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

#include <algorithm>



using namespace std;



typedef long long ll;

int num[200000];

int n,a,b;



bool judge(ll m)

{

    ll ty=m*b;

    ll sub=a-b;

    ll sum=0;

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

    {

        if(ty<num[i])

        {

            ll temp=num[i]-ty;

            sum+=temp/sub;

            if(temp%sub)

                sum++;

        }

    }

    if(sum<=m)

        return true;

    return false;

}



int main()

{

    ll Max=0;

    cin>>n>>a>>b;

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

    {

        cin>>num[i];

        Max+=num[i]/b+1;

    }

    sort(num,num+n);

    ll Min=1;

    while(Min<Max)

    {

        ll mid=(Max+Min)>>1;

        if(judge(mid))

            Max=mid;

        else

            Min=mid+1;

    }

    cout<<Min;

    return 0;

}


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cstdio>

#define ll long long

#define maxn 100005

#define inf 0x3f3f3f3f

using namespace std;

ll a[maxn];

ll r=0, l = 1;

ll n, b, s,sum=0;

int run(ll x)

{

	ll tmp = b - s;

	ll num = x*s;

	sum = 0;

	for (int i = n-1;i >= 0;i--)

	{

		

		if (a[i] - num > 0)

		{

			if ((a[i] - num) % tmp)

				sum += (a[i] - num) / tmp + 1;

			else

				sum += (a[i] - num) / tmp;

		}

	}

	if (sum > x)

		return 1;

	else

		return 0;

}

int main()

{

	cin >> n >> b >> s;

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

	{

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

		r += a[i] / s + 1;

	}

	sort(a, a + n);

	while (l < r)

	{

		ll mid = (r + l) / 2;

		if (run(mid))

			l = mid + 1;

		else

			r = mid;

	}

	printf("%lld\n",r);

	return 0;

}

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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include<stdio.h>

#include<math.h>

#include<algorithm>

#include <cstdlib>

using namespace std;

long long  a[200000];

long long  n,a1,b1;

long  check(long long  zhi)

{

    long long  t=b1*zhi;

    long long  add=0;

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

    {

        if(a[i]-t>0)

        {

            if((a[i]-t)%(a1-b1)==0)

                add+=(a[i]-t)/(a1-b1);

            else

                add+=(a[i]-t)/(a1-b1)+1;

        }

    }

    return add<=zhi;

}

int  main()

{

    cin>>n>>a1>>b1;

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

        scanf("%d",&a[i]);

    long long  st=0,en=1e9;

    long long  mid;

    int t;

    while(st<en-1)

    {

        mid=(en+st)>>1;

        if(check(mid))

        {

            en=mid;

            t=mid;

        }

        else

            st=mid;

    }

    cout<<en<<endl;

    //system("pause");

    return 0;

}


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

#include<algorithm>

using namespace std;

#define LL long long

LL n,A,B;

LL a[1000005];

bool judge(LL x){

    LL temp=x*B;

    LL sub=A-B;

    LL sum=0;

    for(LL i=n;i>=1;i--){

        if(a[i]>temp){

            if((a[i]-temp)%sub)

                sum+=(a[i]-temp)/sub+1;

            else

                sum+=(a[i]-temp)/sub;

        }

    }

    if(sum<=x)

        return true;

    return false;

}

int main() {

    scanf("%lld%lld%lld",&n,&A,&B);

    LL right=0;

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

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

        right+=a[i]/B+1;

    }

    sort(a+1,a+1+n);

    LL left=1;

    while(left<right){

        LL mid=(left+right)>>1;

        if(judge(mid))

            right=mid;

        else

            left=mid+1;

    }

    printf("%lld\n",left);

    return 0;

}