ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > C. T. 2011 > задача:


A to the power of B

Задачи сборника

• Best Grass
• Cow PinBall
• Cow Sorting
• Maximum Sum
• Making Change
• Colored hills
• Word Statistics
• Going to the Movies
• A to the power of B
• Connected components
• Binary transformations
• Блохи
• Вавилонская башня.
• Доставка пиццы
• Железнодорожный разъезд
• Замок
• Лабиринт

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Problem description

Given three numbers a, b and n. Calculate ab mod n (ab % n) .

Input

In a single line of input given three numbers a, b and n (0 < a, n < 1001; 0 < b < 231).

Output

Write the value of ab mod n (ab % n).

Example

stdin stdout

2 5 1000

32

 

Для отправки решений необходимо выполнить вход.

www.contester.ru