mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-09 17:18:49 +00:00
3971. 最小的商
https://www.acwing.com/problem/content/submission/code_detail/7798108/
This commit is contained in:
parent
cf82beddae
commit
7129c8ffa6
22
AcWing/3971/3971.cpp
Normal file
22
AcWing/3971/3971.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int t, n, k, a, ans;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::ios::sync_with_stdio(false);
|
||||||
|
cin >> t;
|
||||||
|
while (t--) {
|
||||||
|
ans = 0x3f3f3f3f;
|
||||||
|
cin >> n >> k;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
cin >> a;
|
||||||
|
if (k % a == 0) {
|
||||||
|
ans = min(ans, k / a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout << ans << endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user