hdu2815

maksyuki 发表于 oj 分类,标签:
0

Mod Tree

Problem Description

The picture indicates a tree, every node has 2 children.
The depth of the nodes whose color is blue is 3; the depth of the node whose color is pink is 0.
Now out problem is so easy, give you a tree that every nodes have K children, you are expected to calculate the minimize depth D so that the number of nodes whose depth is D equals to N after mod P.

Input

The input consists of several test cases.
Every cases have only three integers indicating K, P, N. (1<=K, P, N<=10^9)

Output

The minimize D.
If you can’t find such D, just output “Orz,I can’t find D!”

Sample Input

3 78992 453

4 1314520 65536

5 1234 67

Sample Output

Orz,I can’t find D!

8

20

Author

AekdyCoin

Source

HDU 1st “Old-Vegetable-Birds Cup” Programming Open Contest

 

题目类型:形如 A ^ X = B (mod C)的高次同余方程

算法分析:直接按照A ^ X = B (mod C)的格式求解即可,注意如果B >= C,则直接输出Orz,I can’t find D!