Problem 7

[Back]

You make your way out of the building you got stuck in. Apparently some of the wiser elves suspected this building would be hard to get out of and didn't even go in with you. They've apparently found two other places you can investigate: some computer clusters, and some tunnels under the campus. You're not sure how this is going to lead to you getting enough stars, because that's only two places and so far you've been getting one star per place you've gone, but it seems helpful anyway.

You first go to the computer clusters. Apparently, you'll need a password to access them. Fortunately, you find a password hint written nearby; it's a list of numbers, though, and you're not sure what it means. Fortunately, some of the elves who found the clusters tell you that from their investigation, the password has at least three digits (i.e., it's at least 100) and each of the password hint numbers, once a digit is removed from it, is a multiple of the password. Also, they say that given this information, there should only be one possible password. You decide to try to find the password.

For example, if your input were 873891 261258 560977 826414, then you could remove a digit from each of these numbers to get 87391 (removing the second 8), 61258 (removing the first 2), 60977 (removing the 5), and either 26414 (removing the 8) or 82614 (removing the first 4), all of which are multiples of 281. You could also get multiples of 3 from all these numbers, but 3 is too small to be the password. So, your output would be that the password is 281.

To begin, get your problem input. You feel that this problem will take 9 lines of code.

Answer: [Submit]