sopj 7190. Guess the Number | GUESSTHE

very nice problem, most of the difficulty is in finding the given clues are incorrect and printing -1. first if there a number(x) is a factor of hidden number(n). then all the factors of x should also be factors of n. and then after calculating the lcm, we have to check if clue states that a number(y) is not divisible by n but yet divides the lcm if true print -1 or print the lcm.

https://gist.github.com/d5389eb0ca1df1844ec6

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s