Count of a , b & c after n seconds for given reproduction rate | Function to prvar the count of a , b and c after n seconds ; Number of multiples of 60 below n ; Multiple of 60 nearest to n ; Change all a to b ; Change all b to c ; Change each c to two a ; Print the updated values of a , b and c ; Driver code
function findCount ( n ) { var a = 1 , b = 0 , c = 0 ; var x = parseInt ( n / 60 ) ; a = Math . pow ( 32 , x ) ; x = 60 * x ; for ( i = x + 1 ; i <= n ; i ++ ) { if ( i % 2 == 0 ) { b += a ; a = 0 ; } if ( i % 5 == 0 ) { c += b ; b = 0 ; } if ( i % 12 == 0 ) { a += ( 2 * c ) ; c = 0 ; } } document . write ( " " + a + " " + b + " " + c ) ; } var n = 72 ; findCount ( n ) ;