solve by brute force, but need to pay attention to integer overflow, BIG NUMBER