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. In one of the pages was given a set of numbers with some digits missing. The places where the digits were missing were indicated with '_' (an underscore). At the end of the page was a clue to fill in the missing digits - "All these numbers are perfect squares". Following the clue, Sumit wants to identify the sum of all the perfect squares that matches the given pattern P. Can you help him with a program to do so? Read the input from STDIN and write the output to STDOUT. You should not write arbitrary strings while reading the input and while printing as these contribute to the standard output. Input Format A single line of input consists of the pattern P. Output Format A single line of output prints the sum of all the perfect squares that match the pattern. Constraints Length of the pattern, P Examples Example 1: Input: 1_0_5 Output: 11025 Explanation: Here,