Untitled

 avatar
user_5668965
c_cpp
17 days ago
701 B
1
Indexable
Never
#include<bits/stdc++.h>
#define endl "\n"
#define int long long
#define vi vector<int>
#define pb push_back
using namespace std;

void solve()
{
	int n; double a; double b;
	cin >> n >> a >> b;
	int s; cin >> s;
	int arr[n - 1];
	int sum = s;
	for (int i = 0; i < n - 1; i++)
	{
		cin >> arr[i];
		sum += arr[i];
	}
	sort(arr, arr + n - 1);
	int c = 0; int i = n - 2;
	while (i >= 0)
	{
		if (((s * a) / sum) >= b)
		{
			break;
		}
		else
		{
			sum -= arr[i]; i--; c++;
		}
	}
	cout << c << endl;

}

signed main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int T; T = 1;
	//cin>>T;
	while (T--)
	{
		solve();
	}

	return 0;
}
Leave a Comment