A simple brute force problem.

HDU - 4971