【Educational Codeforces Round 36 A】 Garden

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

枚举用哪一个桶就好

【代码】

#include <bits/stdc++.h>
using namespace std;

int n,k,x;

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
    cin >> n >> k;
    int ma = -1;
    for (int i = 1;i <= n;i++){
        cin >> x;
        if (x<=k && k%x==0){
            if (ma==-1)
                ma = k/x;
            else
                ma = min(ma,k/x);
        }
    }
    cout <<ma<<endl;
	return 0;
}
posted @ 2018-01-14 07:17  AWCXV  阅读(115)  评论(0编辑  收藏  举报