Company: Cloud_sek_12nov
Difficulty: medium
Square Investment Problem Description Bob and John each have N dollars and both want to invest some money in Jack. Bob invests an amount i and John invests an amount j , where 1 <= i <= N and 1 <= j <= N . Jack promises them a return of i * j . Bob and John are happy only when that return is a perfect square. Count the number of investment pairs (i, j) for which i * j is a perfect square. The pair is ordered: Bob investing 1 while John invests 4 is a different pair from Bob investing 4 while John invests 1 , and both are counted. Implement solution , which receives N and returns that count. Input Format A single line containing the integer N , the amount each of them has. Output Format Print a single integer, the number of ordered pairs (i, j) whose product is a perfect square. Constraints 1 <= N <= 100000 Examples Example 1 Input: 3 Output: 3 Explanation: the pairs are (1, 1) since 1 * 1 = 1 , (2, 2) since 2 * 2 = 4 , and (3, 3) since 3 * 3 = 9 . No other product of