My solution for problems on various online judges