#include using namespace std; int main(){ int s; cin >> s; int n; cin >> n; map mp; for (int i = 0; i < n; i++){ int x; cin >> x; if (s % x == 0){ if (mp[s / x] != 0){ cout << min(i+1, mp[s / x]) << ' ' << max(i+1, mp[s / x]) << endl; } else{ mp[x] = i + 1; } } } }