Minimum time required to complete a work by N persons together | C # implementation of above approach ; Function to calculate the time ; Driver Code
using System ; class GFG { static double calTime ( double [ ] arr , int n ) { double work = 0 ; for ( int i = 0 ; i < n ; i ++ ) work += 1 / arr [ i ] ; return Math . Round ( 1 / work , 5 ) ; } public static void Main ( ) { double [ ] arr = { 6.0 , 3.0 , 4.0 } ; int n = arr . Length ; Console . Write ( calTime ( arr , n ) + " ▁ Hours " ) ; } }