Convert all frequencies to nearest smaller even values .
List < int > arr1 = new List < int > ( ) ; foreach ( KeyValuePair < int , int > entry in freq_2 ) arr1 . Add ( entry . Key * ( freq_2 [ entry . Key ] / 2 ) * 2 ) ; arr1 . Sort ( ) ;