Блог пользователя techaddict

Автор techaddict, 14 лет назад, По-английски

problem link [http://www.codeforces.com/contest/248/problem/B]

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
14 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

The least common multiple of this numbers (2,3,5,7) is 210. So you are asked to find smallest n-digit number, which is divisible by 210.

Let's take smallest n-digit number X=(10^(n-1)). We can consider all numbers from X to X+210 and choose the one, which is divisible* by 210. Of course that one will be the answer.

*Since X is very large (maximum 10^5 digits), you've got to use "long integer arithmetics".