Add the code and solution for POJ 1830.