Migrated Timus old solutions (~2010,11) in pascal.