{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv align\u003d\"left\"\u003eOn the planet Eisiem passenger tickets for the new mean of transportation are planned to have the form of tores. \u003cbr\u003e \u003cbr\u003eEach tore is made of a single rectangular black rubber sheet containing N × M squares. Several squares are marked with white, thus encoding the ticket\u0027s source and destination. \u003cbr\u003e \u003cbr\u003eWhen the passenger buys the ticket, the ticket booking machine takes the rubber sheet, marks some squares to identify the route of the passenger, and then provides it to the passenger. The passenger next must glue the ticket. \u003cbr\u003e \u003cbr\u003eThe ticket must be clued the following way. First two its sides of greater length are glued together, forming a cylinder. Next cylinder base circles, each of which has the length equal to the length of the short side of the original rubber sheet, are glued together. They must be glued in such a way, that the cells, sides of which are glued, first belonged to the same row of the sheet. Note that the inner and the outer part of the sheet can be distinguished. \u003cbr\u003e \u003cbr\u003eThe resulting tore is the valid ticket. \u003cbr\u003e \u003cbr\u003eNote that if the original sheet is square, there are two topologically different ways to make a tore out of a rubber sheet. \u003cbr\u003e \u003cbr\u003eTicket material is so perfect and gluing quality is so fine, that no one is able to find the seam, and this leads to some problems. First, the same tore can be obtained using different sheets. More of that, the same sheet can lead to tores that look a bit different. \u003cbr\u003e \u003cbr\u003eNow the transport companies of Eisiem wonder, how many different routes they can organize, so that the following conditions are satisfied: \u003cbr\u003e \u003cbr\u003e\u003cul\u003e \u003cbr\u003e \u003cli\u003e tickets for different routes are represented by different tores; \u003cbr\u003e \u003c/li\u003e\u003cli\u003e if some rubber sheet was marked to make the tore for some route, it cannot be used to make the tore for another route. \u003cbr\u003e\u003c/li\u003e\u003c/ul\u003e \u003cbr\u003e \u003cbr\u003eHelp them to calculate the number of routes they can organize. \u003cbr\u003e \u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cbr\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003eThe first line of the input file contains N and M (1 ≤ N, M ≤ 20). \u003cbr\u003e \u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cbr\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003eOutput the number of routes Eisiem transport companies can organize. \u003cbr\u003e \u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cbr\u003e\u003cb\u003eSample test(s)\u003c/b\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cbr\u003eInput\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cfont face\u003d\"Courier New\"\u003e\u003c/font\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cpre\u003e\u003c/pre\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003eTest #1 \u003cbr\u003e \u003cbr\u003e2 2 \u003cbr\u003e \u003cbr\u003eTest #2 \u003cbr\u003e \u003cbr\u003e2 3 \u003cbr\u003e \u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cdiv align\u003d\"left\"\u003e\u003cdiv align\u003d\"left\"\u003e\u003cbr\u003eOutput\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cfont face\u003d\"Courier New\"\u003e\u003c/font\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cpre\u003e\u003c/pre\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003eTest #1 \u003cbr\u003e \u003cbr\u003e6 \u003cbr\u003e \u003cbr\u003eTest #2 \u003cbr\u003e \u003cbr\u003e13 \u003cbr\u003e \u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cdiv align\u003d\"left\"\u003e\u003cdiv align\u003d\"left\"\u003e\u003cdiv align\u003d\"right\"\u003e \u003c/div\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003cdiv align\u003d\"right\"\u003e \u003c/div\u003e\u003c/div\u003e\u003cdiv align\u003d\"left\"\u003e\u003chr\u003e\u003c/div\u003e\u003ctable align\u003d\"left\" cellspacing\u003d\"7\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003eAuthor:\u003c/td\u003e\u003ctd\u003eAndrew Stankevich \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eResource:\u003c/td\u003e\u003ctd\u003ePetrozavodsk Summer Trainings 2003 \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003eDate:\u003c/td\u003e\u003ctd\u003e2003-08-23 \u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e \u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\r\n\u003c/div\u003e"}}]}