#include <iostream>

using namespace std;

int main() {
    int n,p;
    cin >> n >> p;
    int cnt = 0;
    int arr[n];
    
    for (int i = 0;i < n;i++) {
        cin >> arr[i];
        
    }


    for (int i = n - 1;i >= 0;i--) {
        
        cnt += p/arr[i];
        p = p % arr[i];
    }
    
    cout << cnt;
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: