ãã¤ãã®ã—ãˆã‚‹ã¯æ•°å—ã«ã¤ã„ã¦è€ƒãˆã‚‹ã®ãŒå¥½ãã§ã‚る.ã‚る日,ã—ãˆã‚‹ã¯ã“ã®ä¸–ã«ãã“ã®æ•°å—ã¨ã„ã†ã‚‚ã®ãŒã‚ã‚‹ã“ã¨ã‚’知り,自分もãã®ã‚ˆã†ãªæ•°å—ãŒæ¬²ã—ããªã£ã¦ã—ã¾ã£ãŸï¼Žãã“ã§ï¼Œæ¬¡ã®æ€§è³ªã‚’満ãŸã™æ•°å—ã‚’ã¨ã‚Šã‚ãˆãš Fox Number ã¨å‘¼ã¶ã“ã¨ã«ã—ãŸï¼Ž
[性質]: æ•´æ•° N 㯠k (≥ 1) 個ã®ç´ æ•° p1, ..., pk ã¨æ£æ•´æ•° e1, ..., ek ã§ï¼Œp1 < ... < pk,e1 ≥ ... ≥ ek を満ãŸã™ã‚‚ã®ã«ã‚ˆã£ã¦ N = p1e1 × ... × pkek ã¨æ›¸ã‘ã‚‹ã¨ã,Fox Number ã§ã‚ã‚‹ã¨å‘¼ã¶ã“ã¨ã«ã™ã‚‹ï¼Ž
ã¨ã“ã‚ã§ã—ãˆã‚‹ã¯ã“ã®æ€§è³ªã‚’ãã®å ´ã®æ€ã„ã¤ãã§æ±ºã‚ã¦ã—ã¾ã£ãŸã®ã§ã“ã‚ŒãŒã©ã†ã„ã†æ€§è³ªã‚’æŒã£ã¦ã„ã‚‹ã®ã‹å…¨ãã‚ã‹ã£ã¦ã„ãªã„.ãã“ã§ï¼Œã“ã®æ•°å—ã®æ€§è³ªã‚’調ã¹ã‚‹ãŸã‚ã«åŒºé–“ [A-B, A+B] ã«å«ã¾ã‚Œã‚‹ Fox Number ã®å€‹æ•°ã‚’出力ã—ã¦æ¬²ã—ã„.
1 行目ã«ä»¥ä¸‹ã® 2 ã¤ã®æ•´æ•°ãŒä¸Žãˆã‚‰ã‚Œã‚‹ï¼Ž
A B
1 行目ã«ï¼ŒA-B 以上 A+B 以下㮠Fox Number ã®å€‹æ•°ã‚’出力ã›ã‚ˆï¼Ž
18 2
4
16 = 24, 17 = 171, 19 = 191, 20 = 22 × 51 㯠Fox Number ã§ã‚る.一方㧠18 = 2 × 32 㯠Fox Number ã§ã¯ãªã„.åˆè¨ˆã—㦠4 ã¤ã® Fox Number ãŒã‚る.
100 10
18
123456 789
1464