1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define dd second
#define mp make_pair
#define pb push_back
#define sz size()
#define lld long long
#define scanf(...) scanf(__VA_ARGS__)?:0
#define For(i,s,a) for(lld i=(lld)s;i<(lld)a;++i)

lld c[101],maxn;
lld a,b;
lld dfs(lld x,lld tmp)
{
	maxn=max(maxn,x);
	For(i,tmp,a)
	{
		if(b/x>=c[i])
		dfs(x*c[i],i);
		else
		break;
	}
}

int main()
{
	scanf("%lld%lld", &a,&b);
	For(i,0,a)
	scanf("%lld", &c[i]);
	sort(c,c+a);
	maxn=0;
	dfs(1,0);
	printf("%lld",maxn);
}