Uploaded problem 1006 for LightOJ