#include #include #include using namespace std; int main(void) { int n; cin >> n; vector z(n); for (int i = 0; i < n; i++) { cin >> z[i]; } vector r(n); r[0] = z[0]; for (int i = 1; i < n; i++) { r[i] = r[i - 1] + z[i]; } int m; cin >> m; for (int i = 0; i < m; i++) { double x, y; cin >> x >> y; double d = sqrt(x * x + y * y); auto it = lower_bound(r.begin(), r.end(), d); if (it == r.end()) { cout << "izvan" << endl; } else { cout << it - r.begin() << endl; } } return 0; }