погуглите можно найти ответы на эти задачиhttp://www.google.ru/webhp?hl=ru&tab=ii#hl=ru&newwindow=1&site=webhp&q=2-%D0%BF%D1%80%D0%BE%D0%BF%D0%B0%D0%BD%D0%BE%D0%BB+%D0%BF%D0%BE%D0%B4%D0%B5%D0%B9%D1%81%D1%82%D0%B2%D1%83%D0%B9%D1%82%D0%B5+%D0%BF%D1%80%D0%BE%D0%BF%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%BE%D0%B9+%D0%BA%D0%B8%D1%81%D0%BB%D0%BE%D1%82%D0%BE%D0%B9+%D0%B2+%D0%BF%D1%80%D0%B8%D1%81%D1%83%D1%82%D1%81%D1%82%D0%B2%D0%B8%D0%B8+%D0%BA%D0%BE%D0%BD%D1%86.+%D1%81%D0%B5%D1%80%D0%BD%D0%BE%D0%B9+%D0%BA%D0%B8%D1%81%D0%BB%D0%BE%D1%82%D1%8B&spell=1&sa=X&ei=vK1iUZD5Dony4QSEkoGIBg&ved=0CCoQBSgA&bav=on.2,or.&bvm=bv.44770516,d.bGE&fp=49b4635b9e69257e&biw=1280&bih=832http://otvet.mail.ru/question/75509359