solution for spoj PRIME1 problem