Masala #TNMIOSNN83
Matematikani yomon ko'raman
Biloliddin matematikani juda yomon ko'radi va matematika darsda har doim uxlaydi. Bugun ham xuddi shu ahvol: o'qituvchi "tagma-tag qo'shish" usulini o'rgatmoqda, Biloliddin esa shirin uyquda. Endi doskadagi misolni ishlashi kerak. Biloliddin ushbu vazifani quyidagicha hal qildi:
ya'ni u ortiqcha sonlarni keyingi xonaga qo'shish o'rniga yonma-yon yozib qo'ydi. Ustozi esa Biloliddinni jazolash maqsadida n sonini berdi va u ishlagan usul yordamida yuqoridagi nomanfiy ikkita sonni necha xil usulda tanlash mumkinligini hisoblashni vazifa qilib berdi.
Biloliddin sizdan yordam so'ramoqda. Unga yordam bering.
Kirish faylida n soni kiritiladi.
1 ≤ n ≤ 10^18
Tanlashlar sonini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
112 |
50 |
2 |
366 |
196 |
1-test uchun sonlarni quyidagicha tanlash mumkin:
(0, 112), (1, 111), (2, 110), (3, 19), (4, 18), (5, 17), (6, 16), (7, 15), (8, 14), (9, 13), (10, 102), (11, 101), (12, 100), (13, 9), (14, 8), (15, 7), (16, 6), (17, 5), (18, 4), (19, 3), (20, 92), (21, 91), (22, 90), (30, 82), (31, 81), (32, 80), (40, 72), (41, 71), (42, 70), (50, 62), (51, 61), (52, 60), (60, 52), (61, 51), (62, 50), (70, 42), (71, 41), (72, 40), (80, 32), (81, 31), (82, 30), (90, 22), (91, 21), (92, 20), (100, 12), (101, 11), (102, 10), (110, 2), (111, 1) va (112, 0).
(3, 19) va (19, 3) alohida kombinatsiya hisoblanadi.