{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"There are many fleas living in the city of Z. On the Saturday Lifestyle Channel in Z City, there is an entertainment program. A flea will be invited to stand in the center of a high wire. The wire is very long and can be considered infinitely long. The host will give the flea a card with N+1 natural numbers written on it. The last number is M, and the first N numbers are all less than or equal to M. The card is allowed to have duplicate numbers. The flea can choose a natural number S from the card at any time, and then jump to the left or right by S units. His final task is to jump to a position one unit to the left of his current position and pick up the gift there. \n\nFor example, when N\u003d2 and M\u003d18, a flea holding the card (10, 15, 18) can complete the task: he can first jump 10 units to the left, then jump to the left three more times, each time by 15 units, and finally jump to the right three times, each time by 18 units. However, a flea holding the card (12, 15, 18) will never be able to jump to a position one unit to the left of his current position.\n\nWhen N and M are determined, there are obviously M^N different cards in total. The question now is, out of all these cards, how many can complete the task."}},{"title":"Input","value":{"format":"HTML","content":"Two integers N and M (N \u0026lt;\u003d 15, M \u0026lt;\u003d 100000000)."}},{"title":"Output","value":{"format":"HTML","content":"The number of cards that can complete the task."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e12\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"The 12 cards are: \n(1, 1, 4), (1, 2, 4), (1, 3, 4), (1, 4, 4), (2, 1, 4), (2, 3, 4), \n(3, 1, 4), (3, 2, 4), (3, 3, 4), (3, 4, 4), (4, 1, 4), (4, 3, 4)"}}]}