Company: IDFC_27july
Difficulty: medium
Sum of Perfect Squares Matching Pattern Problem Description Sumit was cleaning his house and found an old book of math problems. On one of the pages was a set of numbers with some digits missing. Every missing digit had been written as an underscore ('_'). At the end of the page was a clue for filling in the missing digits - "All these numbers are perfect squares". Following the clue, Sumit wants the sum of all the perfect squares that match a given pattern P. Help him with a program that computes it. A number matches the pattern P when both of the following hold: the decimal representation of the number, written without leading zeros, has exactly as many digits as P has characters, and at every position where P holds a digit, the number holds that same digit. A position where P holds an underscore may hold any digit. A perfect square is a number of the form k x k for some integer k >= 0. Input Format A single line containing the pattern P. Output Format A single line containing the