Masala #0347

Xotira 16 MB Vaqt 1000 ms
14

Nisbat 2

Quyidagi formulani hisoblang:

\(\cfrac{a + a^2+a^3+\dots+a^n}{a^{-1}+a^{-2}+\dots+a^{-n}}\)


Kiruvchi ma'lumotlar:

INPUT.TXT kirish faylining birinchi satrida ikkita natural son \(a \le 10^9, n \le 1000\) beriladi


Chiquvchi ma'lumotlar:

Masala javobini \(10^9+7\)  ga bo'lgandagi qoldiqni chop eting


Misollar
# input.txt output.txt
1
2 2
8