Well, to solve this question, I came up with a clever way
To make a number divisible by, for example, all numbers from 1 to 10, we can multiply all
numbers from 1 to 10 together.
But this way we do not get to the smallest common multiple, because any number that is divisible
by 8 is also divisible by 4, so we multiplied to 4 additional !
And in the definition of the smallest common multiple, we have two numbers that are the product
of multiplying prime numbers with the most power. I did exactly the same thing.
In order to have the most power of a prime number, I stored them in a dictionary that is
suitable for this kind of work, and in the end, I multiplied each prime number by its value and
multiplied these numbers.
خب برای حل این سوال من روش هوشمندانه ای را در نظر گرفتم
برای اینکه یک عدد بر مثلا تمام اعداد ۱ تا ۱۰ بخش پذیر باشه میتونیم همه اعداد ۱ تا ۱۰ را در هم
ضرب کنیم
اما اینجوری ما به کوچیک ترین مضرب مشترک نمیرسیم زیرا هر عددی که بر ۸ بخشپذیر باشه بر ۴ هم
بخشپذیره پس ۴ را اضافه ضرب کرده ایم
و در تعریف کوچک ترین مضرب مشترک دو عدد هم داریم که حاصل ضرب اعداد اول با بیشترین توان من هم
دقیقا همین کار را کردم تمام اعداد ۲ تا ۲۰ را به اوامل اول تجزیه کردم و حاصل ضرب اعداد اول با
بیشترین توان را به دست اوردم
برای این که بیشترین توان یک عدد اول راهم داشته باشم اون هارو در داخل یک دیکشنری ذخیره کردم که
مناسب این جور کار ها هست و در اخره هر عدد اول را به توان value رسوندم و این اعداد را در هم ضرب
کردم.