algorithm explanation

join shbcf.ru