timus 1005 problem solved