Driver Code
public static void main ( String [ ] args ) { int a [ ] = { 8 , 25 , 10 , 19 , 19 , 18 , 20 , 11 , 18 } ; int n = a . length ; int x = 13 ; System . out . println ( countSegments ( a , n , x ) ) ; } }