A Simple Multiplication

View as PDF

Submit solution

Points: 12
Time limit: 0.05s
Memory limit: 2M

Author:
Problem type
Allowed languages
Assembly

Your computer engineering instructor decided to give you another task (you are the best in the class, after all):

Write a program that prints the result of NPmodM.

Unimpressed by the supposed challenge, you open up your favourite text editor (Vim, of course) and begin typing away… in assembly.

Input Specification

The first line will contain 3 space-separated integers, N (1N100), P (1P109), and M (P<M109+7).

Output Specification

The result of NPmodM.

Sample Input 1

Copy
2 5 11

Sample Output 1

Copy
10

Sample Input 2

Copy
9 100 1000000007

Sample Output 2

Copy
136318165

Note

To use libc in NASM, the first line of your program should be ; libc. For all others, it should be ; features: libc.


Comments

There are no comments at the moment.