Find sum of inverse of the divisors when sum of divisors and the number is given | Java implementation of above approach ; Function to return the sum of inverse of divisors ; Calculating the answer ; Return the answer ; Driver code ; Function call
import java . math . * ; import java . io . * ; class GFG { static double SumofInverseDivisors ( int N , int Sum ) { double ans = ( double ) ( Sum ) * 1.0 / ( double ) ( N ) ; return ans ; } public static void main ( String [ ] args ) { int N = 9 ; int Sum = 13 ; System . out . println ( SumofInverseDivisors ( N , Sum ) ) ; } }