#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
stack<pair<int,int> > st;
st.push({0, 0});
for(int i = 0; i < a / 2; i ++)
{
int x = st.top().first, y = st.top().second;
x++;
st.push({x, y});
}
for(int i = 0; i < c / 2; i ++)
{
int x = st.top().first, y = st.top().second;
x++, y--;
st.push({x, y});
}
for(int i = 0; i < b / 2; i ++)
{
int x = st.top().first, y = st.top().second;
y--;
st.push({x, y});
}
for(int i = 0; i < d / 2; i ++)
{
int x = st.top().first, y = st.top().second;
x--, y--;
st.push({x, y});
}
for(int i = 0; i < a / 2; i ++)
{
int x = st.top().first, y = st.top().second;
x--;
st.push({x, y});
}
for(int i = 0; i < c / 2; i ++)
{
int x = st.top().first, y = st.top().second;
x--, y++;
st.push({x, y});
}
for(int i = 0; i < b / 2; i ++)
{
int x = st.top().first, y = st.top().second;
y++;
st.push({x, y});
}
for(int i = 0; i < d / 2; i ++)
{
int x = st.top().first, y = st.top().second;
x++, y++;
st.push({x, y});
}
while(st.size() > 1)
{
cout << st.top().first << ' ' << st.top().second << endl;
st.pop();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
436 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
436 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
436 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
436 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Incorrect |
0 ms |
348 KB |
number of sticks is not consistent with the given input |
7 |
Halted |
0 ms |
0 KB |
- |