-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminshop.cpp
More file actions
40 lines (39 loc) · 724 Bytes
/
adminshop.cpp
File metadata and controls
40 lines (39 loc) · 724 Bytes
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
#include <iostream>
#include <conio.h>
#include <algorithm>
#include <vector>
#define ll long long
using namespace std;
int main()
{
int a;
cin >> a;
while (a--)
{
double n, x;
cin >> n >> x;
double sum = 0;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
if (n == 1)
{
cout << ceil(x / v[0]) << endl;
}
else
{
sort(v.begin(), v.end());
ll k = ceil(x / v[0]);
if (k > n)
{
cout << k << endl;
;
}
else
cout << n << endl;
}
}
return 0;
}