版本2和3间的区别
于2006-04-21 20:36:21修订的的版本2
大小: 747
编辑: czk
备注:
于2008-02-23 15:34:10修订的的版本3
大小: 747
编辑: localhost
备注: converted to 1.6 markup
未发现区别!

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


timus1110 (2008-02-23 15:34:10由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.