Company: goldman sachs
Difficulty: medium
Closest Gapful Customer ID A customer ID is gapful if it has at least three digits and is divisible by the two-digit number formed by its first and last digits. For example, 121 is gapful because it is divisible by 11 . Given N , print the closest gapful ID. If two IDs are equally close, print the smaller one. Input Format One integer N ( 100 <= N <= 100000 ). Output Format Print the required gapful ID. Example Input: 460 Output: 462 462 is divisible by 42 , the two-digit number formed by its first and last digits, and no gapful ID is closer to 460 .