Ruby scr. for some base codeforces tasks