bool contains(double *a, int n, const double key) {