Masala #GG2A4EIZ4D
Nollashtirish
Sizda \(n\) sehrli soni bor. Uning sehrliligi shundaki unda ishtirok etgan biror raqamni undan ayirsangiz yana sehrli son paydo bo'ladi. Eng kichik musbat sehrli butun son nolga teng. Sizga \(n\) soni berilsa uni nollashtirish uchun nechta amal bajarilishi kerakligini aniqlang.
Kirish faylida yagona qatorda bitta butun son \(n(0 \le n \le 10^6)\) beriladi.
Chiqish faylida \(n\) sonini nolga aylantirish uchun minimal amallar sonini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
24 |
5 |
2 |
0 |
0 |
3 |
3 |
1 |
1-test:
24→20→18→10→9→0