Files
OI-source/history_source/ccf 入门篇/U4/4.5.6.cpp
2023-08-03 09:22:52 +08:00

16 lines
186 B
C++

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,m,k,x;
long long a;
while(true)
{
cin>>n>>m>>k>>x;
a=pow(10,k);
k=a%n;
cout<<(m*k+x)%n<<endl;
}
}