it is the codes and the link for the problem i solved and i solving i will update this frequently with my new solutions . Note that : it is not my coding style . the style may be not good that because of the contest and my trying to solve this fast . note also you will find the link of the question in the comments in the code . feel free to conatact me mohandsakr69@gmail.com if you see an error please notify me at mohandsakr69@gmail.com and folow mym blog :https://mohandsakr.wordpress.com . for more solutions and expalinings. happy coding and good luck. mohand sakr.