#include using namespace std; int main(){ int s; cin >> s; int n; cin >> n; set st; map mp; for (int i = 0; i < n; i++){ int x; cin >> x; if (s % x == 0){ st.insert(x); mp[x] = i; } } for (auto to: st){ if (st.count(s / to) != 0){ cout << min(mp[to] + 1, mp[s/to] + 1) << ' ' << max(mp[to] + 1, mp[s/to] + 1); break; } } }