I don't know the failed test case of the following code>>1850F - We Were Both Children
The solution is 234582635
include <bits/stdc++.h>
define ll long long
define pb push_back
define mp make_pair
define fi first
define se second
define endl "\n"
using namespace std; ll no_of_divisors(vector scalar, ll k) { ll ans = 0; for (ll i = 0; i < scalar.size(); i++) { if (k % scalar[i] == 0) { ans++; } } return ans; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t; cin >> t; while (t--) { ll n; cin >> n; vector scalar(n); for (auto &x : scalar) {
cin >> x; } ll res = 0; ll final_res = 0; for (ll i = 0; i < scalar.size(); i++) { if (scalar[i] <= n) res = no_of_divisors(scalar, scalar[i]); final_res = max(res, final_res); res = 0; } cout << final_res << endl; } return 0;
}