摘要: DescriptionHengheng is a math nerd. Today he invents a new kind of numbers so called H number. These numbers satisfy that each digit is either the sum or the difference of the adjacent digits. Notice that the first and the last digit are not constrained, except that the first digit is not zero (i.e. 阅读全文
posted @ 2013-02-09 14:42 Joyee 阅读(292) 评论(0) 推荐(0) 编辑
摘要: DescriptionFarmer John has scattered treats for Bessie at special places in the pasture. Since everyone knows that smart cows make tasty milk, FJ has placed the treats at locations that require Bessie to think. He has given her two numbers, P and Q (1 <= P <= 6,000; 1 <= Q <= 6,000), and 阅读全文
posted @ 2013-02-09 14:16 Joyee 阅读(814) 评论(0) 推荐(0) 编辑