Solved problem 1 for week two in c took fucking ages :)