Feu un programa que, donats n, k i m, calculi nk modm.
Entrada
L’entrada consisteix en diversos casos,
cadascun amb tres naturals n, k i m.
Assumiu 2 ≤ n ≤ 30000 i 2 ≤ m ≤ 30000.
Sortida
Per a cada cas, escriviu nk modm.
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.