Driver Code
public static void Main ( ) { int [ ] arr = { 2 , 7 , 5 , 3 , 8 , 4 , 1 , 9 } ; int n = arr . Length ; int a = 8 , b = 16 ; Console . WriteLine ( " " + countTriplets ( arr , n , a , b ) ) ; } }