Create 1871.cpp

pull/45/head
Kirigaya Kazuto 2016-10-24 17:19:04 +08:00 committed by GitHub
parent 5bdf456d2f
commit 4da9cf8ad5
1 changed files with 18 additions and 0 deletions

18
QUSTOJ/1871.cpp Normal file
View File

@ -0,0 +1,18 @@
#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;
}