This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 < d / 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 < c / 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 < d / 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 < c / 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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |