Finding all pair in an array which equals to given value.