⇤ ← 于2006-04-16 20:54:48修订的的版本1
674
备注:
|
747
|
删除的内容标记成这样。 | 加入的内容标记成这样。 |
行号 1: | 行号 1: |
## page was renamed from 程序设计练习64——timus1110——Power |
Power
http://acm.timus.ru/problem.aspx?space=1&num=1110
Time Limit: 0.5 second
Memory Limit: 1 000 KB
You are given the whole numbers N, M and Y. Write a program that will find all whole numbers X in the interval [0, M-1] such that X^N mod M = Y.
1. Input
The input contains a single line with N, M and Y (0<N<999, 1<M<999, 0<Y<99) separated with one space. Output
Output all numbers X separated with space on one line. The numbers must be written in ascending order. If no such numbers exist then output -1.
2. Sample Input
2 6 4
3. Sample Output
2 4
Problem Source: Bulgarian National Olimpiad Day #1