add apple dividing problem in c