-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdivthree_codechef.cpp
More file actions
executable file
·43 lines (42 loc) · 897 Bytes
/
Copy pathdivthree_codechef.cpp
File metadata and controls
executable file
·43 lines (42 loc) · 897 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
41
42
43
#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define pi 3.1415926535
#define endl "\n"
#pragma GCC optimize("Ofast")
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define foi(a, b) for (int i = a; i < b; i++)
#define foll(a, b) for (ll i = a; i < b; i++)
#define max(a, b) a > b ? a : b
#define min(a, b) a < b ? a : b
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 0;
cin >> t;
while (t--)
{
int n;
long long k, d, temp;
cin >> n >> k >> d;
long long sum = 0;
foi(0, n)
{
cin >> temp;
sum = sum + temp;
}
long long ndays = sum / k;
if (ndays > d)
cout << d << endl;
else
{
cout << ndays << endl;
}
}
return 0;
}