If it 's size greater than k  it needed to be decreased
while ( ( val [ cur ] . Count ) > k ) { int elem = val [ cur ] [ val [ cur ] . Count - 1 ] ; val [ cur ] . RemoveAt ( val [ cur ] . Count - 1 ) ; extra . Add ( new pair ( elem , i ) ) ; }