C version of ProblemOne