fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  5. #define cout_precision cout.setf(ios::fixed); cout.precision(32);
  6. #define clr(a) memset(a,0,sizeof(a))
  7. #define umap unordered_map
  8. #define uset unordered_set
  9. #define fr first
  10. #define sc second
  11. #define pb push_back
  12. #define pf push_front
  13. #define M int(1e9+7)
  14. #define endl '\n'
  15. #define largest(a,b,c) (a>b?(a>c? a:c):(b>c? b:c))
  16. #define smallest(a,b,c) (a<b?(a<c? a:c):(b<c? b:c))
  17.  
  18. using ll = int64_t; using vll = vector<ll>; using vvll = vector<vll>;
  19. using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;
  20.  
  21. ll power(ll a, ll n){
  22. if(n == 0) return 1;
  23. if(n == 1) return a;
  24. if(n&1) return a*power(a,n-1);
  25. ll res = power(a,n/2);
  26. return res*res;
  27. }
  28.  
  29. int main() {
  30. fast_io; cout_precision;
  31.  
  32. int t; cin >> t;
  33. while(t--){
  34. ll n,m,k; cin >> n >> k >> m;
  35. vector <ll> p(n);
  36. for(int i=0; i<n; i++){
  37. cin >> p[i];
  38. }
  39.  
  40.  
  41. ll res = INT_MIN;
  42. for(int i=0; i<n; i++){
  43. if(p[i]*k <= m){
  44. res = max(res , p[i]);
  45. }
  46. }
  47. cout << res <<endl;
  48.  
  49. }
  50.  
  51.  
  52. return 0;
  53. }
  54.  
Runtime error #stdin #stdout #stderr 0s 4472KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc