Skip to content

Commit b3edb5f

Browse files
authoredJun 27, 2024
Add files via upload
1 parent 919536c commit b3edb5f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

‎92A - Chips.cpp

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
/*
3+
yildiz
4+
*/
5+
#include <iostream>
6+
#include <vector>
7+
#include <cstdlib>
8+
#include <iostream>
9+
#include <vector>
10+
using namespace std;
11+
12+
13+
int main() {
14+
int x, y;
15+
cin >> x >> y;
16+
y %= (x * (x + 1) / 2);
17+
18+
for (int i = 1; i <= x; ++i) {
19+
if (y < i) {
20+
break;
21+
}
22+
y -= i;
23+
}
24+
cout << y << endl;
25+
return 0;
26+
}

0 commit comments

Comments
 (0)
Please sign in to comment.