#P4057. [Code+#1] 晨跑
[Code+#1] 晨跑
Description
"Without sports, there is no Tsinghua." "Exercise one hour a day, work healthily for fifty years, live a happy life for a lifetime."
At Tsinghua, sports are an indispensable part of students' lives. To respond to the school's call, model student Captain Wang decides to stick to morning runs. However, for various reasons, getting up early to run every day is not realistic, so Captain Wang decides to run once every days. In other words, if Captain Wang gets up early to run on a certain day, he will rest for days afterward, then run again on the -th day, and so on.
Inspired by Captain Wang's persistence, his good friends Xiao Qin and Xiao Zhen also decide to keep up with morning runs. To suit their own situations, Xiao Qin decides to run once every days, and Xiao Zhen decides to run once every days.
One morning, Captain Wang, Xiao Qin, and Xiao Zhen meet during their early run. They are very excited, encourage each other, and complete a perfect morning run together. For convenience, we label this meeting day as day . Assuming the time window and route of each morning run are the same, they want to know on which day they will meet again while running. Since none of them can do the math, they ask you to tell them the answer.
Input Format
The input consists of one line containing three positive integers , , , meaning Captain Wang runs every days, Xiao Qin runs every days, and Xiao Zhen runs every days.
Output Format
Output one line containing a positive integer , indicating that the next time the three students meet will be on day .
2 3 5
30
3 4 6
12
10 100 1000
1000
Hint

From the CodePlus 2017 November Contest, presented with honor by the Student Algorithm and Programming Contest Association of the Department of Computer Science and Technology, Tsinghua University.
Credit: idea/He Haotian, problem setting/He Haotian, verification/Lu Zhengrong.
Git Repo: https://git.thusaac.org/publish/CodePlus201711
Thanks to Tencent for supporting this contest.
Translated by ChatGPT 5
京公网安备 11011102002149号