-
Notifications
You must be signed in to change notification settings - Fork 67
/
AE1B.cpp
64 lines (57 loc) · 1.12 KB
/
AE1B.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
//#include <unordered_map>
#include <utility>
#include <cassert>
#include <iomanip>
#include <ctime>
#include <fstream>
using namespace std;
const int me = 10025;
static int uget()
{
int c;
while(c = getchar(), isspace(c)) {}
int n = c - '0';
while(c = getchar(), isdigit(c)) { n = n * 10 + (c - '0'); }
return n;
}
template<class T> static void uput(T n)
{
char s[30];
int x = 0;
do { s[x ++]=(n % 10) + '0'; n /= 10; } while(n);
for(int i = x - 1; i >= 0; i --) putchar(s[i]);
putchar('\n');
}
int n, k, s;
int a[me];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k >> s;
s *= k;
for(int i = 0; i < n; i ++)
cin >> a[i];
sort(a, a + n);
int l = 0;
for(int j = n - 1; j >= 0; j --){
s -= a[j];
l ++;
if(s < 1)
break;
}
cout << l << endl;
return 0;
}