#include <bits/stdc++.h>   using namespace std;   int arr[3000];   int main() {     int n, m;     cin >> n >> m;     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     int minn = 99999;     int maxx = -999;     for (int i = 0; i < n - 1; i++) {       minn = min(minn, arr[i]);       if (arr[i] <= arr[i + 1])         maxx = max(maxx, (m / minn) * arr[i + 1] + m % minn);     }     cout << max(maxx, m);     return 0;   }   