Write a C version of Euler 300.