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
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#include <bits/stdc++.h>
using namespace std;

const int maxP = 25, maxC = 1550000, miliard = 1000000001;

int ctr, T[maxC], primes[maxP];
long long x, S, p[maxP], f1[1 << 15], f2[1 << 10];

void f()
{
    x *= p[0]; while (x <= S){
      x *= p[1]; while (x <= S){
        x *= p[2]; while (x <= S){
          x *= p[3]; while (x <= S){
            x *= p[4]; while (x <= S){
              x *= p[5]; while (x <= S){
                x *= p[6]; while (x <= S){
                  x *= p[7]; while (x <= S){
                    x *= p[8]; while (x <= S){
                      x *= p[9]; while (x <= S){
                        x *= p[10]; while (x <= S){
                          x *= p[11]; while (x <= S){
                            x *= p[12]; while (x <= S){
                              x *= p[13]; while (x <= S){
                                x *= p[14]; while (x <= S){
                                  x *= p[15]; while (x <= S){
                                    x *= p[16]; while (x <= S){
                                      x *= p[17]; while (x <= S){
                                        x *= p[18]; while (x <= S){
                                          x *= p[19]; while (x <= S){
                                            x *= p[20]; while (x <= S){
                                              x *= p[21]; while (x <= S){
                                                x *= p[22]; while (x <= S){
                                                  x *= p[23]; while (x <= S){
                                                    x *= p[24]; while (x <= S){
                                                    
                                                    	T[ctr++] = x;
		                                                if (ctr == maxC)	return;
                                                    
                                                      x *= primes[24], p[24] *= primes[24];
                                                    }
                                                    x /= p[24]; p[24] = 1;
                                                    x *= primes[23], p[23] *= primes[23];
                                                  }
                                                  x /= p[23]; p[23] = 1;
                                                  x *= primes[22], p[22] *= primes[22];
                                                }
                                                x /= p[22]; p[22] = 1;
                                                x *= primes[21], p[21] *= primes[21];
                                              }
                                              x /= p[21]; p[21] = 1;
                                              x *= primes[20], p[20] *= primes[20];
                                            }
                                            x /= p[20]; p[20] = 1;
                                            x *= primes[19], p[19] *= primes[19];
                                          }
                                          x /= p[19]; p[19] = 1;
                                          x *= primes[18], p[18] *= primes[18];
                                        }
                                        x /= p[18]; p[18] = 1;
                                        x *= primes[17], p[17] *= primes[17];
                                      }
                                      x /= p[17]; p[17] = 1;
                                      x *= primes[16], p[16] *= primes[16];
                                    }
                                    x /= p[16]; p[16] = 1;
                                    x *= primes[15], p[15] *= primes[15];
                                  }
                                  x /= p[15]; p[15] = 1;
                                  x *= primes[14], p[14] *= primes[14];
                                }
                                x /= p[14]; p[14] = 1;
                                x *= primes[13], p[13] *= primes[13];
                              }
                              x /= p[13]; p[13] = 1;
                              x *= primes[12], p[12] *= primes[12];
                            }
                            x /= p[12]; p[12] = 1;
                            x *= primes[11], p[11] *= primes[11];
                          }
                          x /= p[11]; p[11] = 1;
                          x *= primes[10], p[10] *= primes[10];
                        }
                        x /= p[10]; p[10] = 1;
                        x *= primes[9], p[9] *= primes[9];
                      }
                      x /= p[9]; p[9] = 1;
                      x *= primes[8], p[8] *= primes[8];
                    }
                    x /= p[8]; p[8] = 1;
                    x *= primes[7], p[7] *= primes[7];
                  }
                  x /= p[7]; p[7] = 1;
                  x *= primes[6], p[6] *= primes[6];
                }
                x /= p[6]; p[6] = 1;
                x *= primes[5], p[5] *= primes[5];
              }
              x /= p[5]; p[5] = 1;
              x *= primes[4], p[4] *= primes[4];
            }
            x /= p[4]; p[4] = 1;
            x *= primes[3], p[3] *= primes[3];
          }
          x /= p[3]; p[3] = 1;
          x *= primes[2], p[2] *= primes[2];
        }
        x /= p[2]; p[2] = 1;
        x *= primes[1], p[1] *= primes[1];
      }
      x /= p[1]; p[1] = 1;
      x *= primes[0], p[0] *= primes[0];
    }
    x /= p[0]; p[0] = 1;
}

int Begin, End, Middle;
inline long long bins(long long target)
{
	Begin = 0, End = ctr;
	while (End - Begin > 1)
	{
		Middle = (Begin + End) / 2;
		1LL * T[Middle] * T[Middle] <= target ? Begin = Middle : End = Middle;
	}	
	return 1LL * T[Begin] * T[Begin];
}

inline void remax(long long& a, long long b)
{	a = max(a, b);	}

int main()
{
	int k;
	long long n;
	scanf ("%d%lld", &k, &n);
	
	for (int i=0; i<k; i++)
		scanf ("%d", primes + i);
		
	sort(primes, primes + k);
	fill(primes + k, primes + maxP, miliard);
	fill(p, p + maxP, 1);
	S = sqrt(n) + 1;
	long long res = 1;

	int s1 = upper_bound(primes, primes + k, 47) - primes;
	int s2 = k - s1;
	f1[0] = f2[0] = 1;
	
	for (int m=1; m<1<<s1; m++)
	{
		int i = __builtin_ctz(m);
		int m2 = m ^ (1 << i);
		f1[m] = f1[m2] * primes[i];
	}

	for (int m=1; m<1<<s2; m++)
	{
		int i = __builtin_ctz(m);
		int m2 = m ^ (1 << i);
		f2[m] = f2[m2] * primes[s1 + i];
	}

	sort(f1, f1 + (1 << s1));

	for (int step=0; step<2; step++)
	{
		x = 1;
		f();
		sort(T, T + ctr);

		for (int m2=0; m2<1<<s2; m2++)
		{
			for (int m1=0; m1<1<<s1; m1++)
			{
				if (f2[m2] > n / f1[m1])
					break;

				long long prod = f1[m1] * f2[m2];
				if (prod <= n)
					remax(res, prod * bins(n / prod));
			}
		}
		
		if (ctr != maxC)	break;
		ctr = 1;
	}
		
	printf("%lld\n", res);
	return 0;
}