mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
19 lines
262 B
C++
19 lines
262 B
C++
#include <iostream>
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
int x,y,n,m;
|
|
cin>>x>>y>>n>>m;
|
|
while(m--)
|
|
{
|
|
int t;
|
|
cin>>t;
|
|
n+=t;
|
|
while(n<x) n+=y-x+1;
|
|
while(n>y) n-=y-x+1;
|
|
cout<<n<<endl;
|
|
}
|
|
return 0;
|
|
}
|