Math teacher's homework

HDU - 3693