?
?
?
Clever Y| Time Limit: 5000MS | ? | Memory Limit: 65536K |
| Total Submissions: 6861 | ? | Accepted: 1676 |
?
Description
Little Y finds there is a very interesting formula in mathematics:
XY mod Z = K
Given X, Y, Z, we all know how to figure out K fast. However, given X, Z, K, could you figure out Y fast?
Input
Input file ends with 3 zeros separated by spaces.
Output
For each test case output one line. Write "No Solution" (without quotes) if you cannot find a feasible Y (0 ≤ Y < Z). Otherwise output the minimum Y you find.Sample Input
5 58 33 2 4 3 0 0 0
Sample Output
9 No Solution
Source
POJ Monthly--2007.07.08, Guo, Huayang?
?
/* *********************************************** Author :CKboss Created Time :2015年03月31日 星期二 20时02分38秒 File Name :POJ3243.cpp ************************************************ */ #include#include #include #include #include #include #include #include #include #include #include
?
?