bzoj#P2065. Ural1807 Cartridges for Maxim

Ural1807 Cartridges for Maxim

题目描述

During a short break in a hot battle against Kappel's corps, Petka and Chapaev brought boxes with cartridges for the Anka's Maxim gun. The Red Army men were exhausted because they had carried more than one box with cartridges to the machine gun, and each box contained at least one hundred cartridges. Anka noticed that there was the same number of cartridges in all boxes. She wanted to put all the cartridges in several pockets so that the greatest common divisor of the numbers of cartridges in her pockets would be as large as possible. Among all the variants of such an arrangement, she wanted to choose the variant in which the least common multiple of the numbers of cartridges in her pockets would be as large as possible too. How could she do it? 读入一个数字N,将它分成K个部分92<=K<N),要求分出来的数字均大于等于100,且GCD要最大,在这个基础上LCM也要最大.....

输入格式

The only input line contains the total number n of cartridges Petka and Chapaev brought (200 ≤ n ≤ 109).

输出格式

先输出最大的GCD,再输出最大的LCM

200

100 100

提示

将200分成二部分,分别为100和100. 这两个数GCD为100,LCM也为100

题目来源

没有写明来源