poj1674. discover the principle/law