Guest User

Untitled

a guest
May 17th, 2011
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <set>
  4. #include <map>
  5. #include <string>
  6. #include <string.h>
  7. #include <queue>
  8. #include <algorithm>
  9. #include <math.h>
  10. #include <sstream>
  11. #include <complex>
  12. using namespace std;
  13. typedef pair<int, int> pi;
  14. typedef long long int li;
  15. typedef vector<int> vi;
  16. typedef double ld;
  17. void solve();
  18.  
  19. #define mp make_pair
  20. #define pb push_back
  21.  
  22. int main(){
  23. #ifdef DEBUG
  24.     freopen("input", "r", stdin);
  25.     //freopen("output","w",stdout);
  26. #endif
  27.     solve();
  28.     return 0;
  29. }
  30. #define int li
  31.  
  32. void solve(){
  33.     int n,l,a[111];
  34.     cin>>n>>l;
  35.     for(int i=0;i<n;++i)
  36.         cin>>a[i];
  37.     int best=0;
  38.     for(int i=l;i<=100;++i){
  39.         int ans=0;
  40.         for(int j=0;j<n;++j){
  41.             ans+=a[j]/i;
  42.         }
  43.         best=max(best,ans*i);
  44.     }
  45.     cout<<best;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment