A cake is prepared for a dinner party to which only p or q persons will come (p and q are given co-prime integers). Find the minimum number of pieces (not necessarily equal) into which the cake must be cut in advance so that the cake may be equally shared between the persons in either case. (D. Fomin, Leningrad) combinatoricscombinatorial geometry