Skip to content

Instantly share code, notes, and snippets.

@modos
Created April 29, 2023 05:43
Show Gist options
  • Save modos/d9cef19ed5f30b5febda8c06fd8fd4a1 to your computer and use it in GitHub Desktop.
Save modos/d9cef19ed5f30b5febda8c06fd8fd4a1 to your computer and use it in GitHub Desktop.
شارژر تباه
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, y, s = 0;
cin >> n >> x >> y;
int w[n];
for (int i = 0; i < n; i++){
cin >> w[i];
}
sort(w, w + n);
for (int i = 1; i < n; i++){
s += 100 - w[i];
}
int a = *min_element(w, w + n) / x;
if (a * y >= s)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment