Code jam in c