Count of triples ( A , B , C ) where A * C is greater than B * B | function to return the count of the valid triplets ; Driver Code ; function calling
function countTriplets ( A , B , C ) { let ans = 0 ; for ( let i = 1 ; i <= A ; i ++ ) { for ( let j = 1 ; j <= B ; j ++ ) { for ( let k = 1 ; k <= C ; k ++ ) { if ( i * k > j * j ) ans ++ ; } } } return ans ; } let A , B , C ; A = 3 , B = 2 , C = 2 ; document . write ( countTriplets ( A , B , C ) ) ;