How to solve HDU 1496 Equations problem using hash technique?