Interview question (constant-time algorithm, ILP)
After glancing at http://www.lume.ufrgs.br/bitstream/handle/10183/66091/000870881.pdf;sequence=1,

I think I figured it out.

Something along the lines of, wlog, let (a,d) have ratio a/d >= b/e >= c/f.

Then y is capped at d/gcf(e,d) and z is capped at d/gcf(f,d). brute force all possible (y,z) possibilities in constant time, fill in the corresponding x=floor[(G-ey-fz)/d] (constant time), and select the maximum ax+by+cz (constant time). QED.

This solution seems a bit inefficient and although there may be a better constant-time solution out there (particularly, for d>100), it scales well for large G which is all that really matters for this question.