C # implementation of the approach
using System ; using System . Collections . Generic ; class CP { public static void Main ( String [ ] args ) { int [ ] A = { 11 , 15 , 7 , 19 } ; int N = A . Length ;