From 7129c8ffa6d55b58bccd0cb1e6e67f78cf4b896b Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 18 Sep 2021 19:05:17 +0800 Subject: [PATCH] =?UTF-8?q?3971.=20=E6=9C=80=E5=B0=8F=E7=9A=84=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/7798108/ --- AcWing/3971/3971.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 AcWing/3971/3971.cpp diff --git a/AcWing/3971/3971.cpp b/AcWing/3971/3971.cpp new file mode 100644 index 00000000..09bae063 --- /dev/null +++ b/AcWing/3971/3971.cpp @@ -0,0 +1,22 @@ +#include + +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; +}