As Eagles fan I give you some hints for a solution: rewrite the code to get it testable.
Change all function to give you some bool return code,
static bool eagles(int k, int64_t d){
if (k<N) {
if (k % 2)
return eagles(++k, d);
else eagles(k + 1, d * metallica[k]);
} else if (d != 1269229500) { return false;
}
return true;
}
And rewrite the main with 3 for loops for a, e, y and let the computer do the job to run, til all return true. Make an output at end.
if( anthrax(0, 15916) && eagles(1, 9) && the_beatles(a, e, y) ) {
}
BTW: the eagles and anthrax input are constants. So they arent making much sense. Typo?