solved some questions of SRM 580.

linear solution for shoutter code is cool. check it out.