This is taken from the entry test of a CS contest I recently entered.
Write a program (Pascal/C/C++) that inputs a number and outputs whether or not this number is an average of three different numbers that are powers of two. (1 counts as a power of two.)
Make it as efficient as possible, both in time complexity and memory usage.
