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;
long long a, b, c, d, curx, cury, a1, b1, c1, d1;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> a >> b >> c >> d;
curx=0; cury=0;
if (c==0 and d==0){
for (int i=0; i<a/2; i++){cout << curx << " " << cury << endl; curx++;}
for (int i=0; i<b/2; i++){cout << curx << " " << cury << endl; cury++;}
cout << curx << " " << cury << endl; curx--;
for (int i=1; i<b/2; i++){cout << curx << " " << cury << endl; cury--;}
for (int i=1; i<a/2; i++){cout << curx << " " << cury << endl; curx--;}
cout << curx << " " << cury << endl; cury--;
}
else if (a==0 and b==0){
for (int i=0; i<c/2; i++){cout << curx << " " << cury << endl; curx++; cury++;}
for (int i=0; i<d/2; i++){cout << curx << " " << cury << endl; curx--; cury++;}
cout << curx << " " << cury << endl; curx--; cury--;
for (int i=1; i<d/2; i++){cout << curx << " " << cury << endl; curx++; cury--;}
for (int i=1; i<c/2; i++){cout << curx << " " << cury << endl; curx--; cury--;}
cout << curx << " " << cury << endl; curx++; cury--;
}
else{
for (int i=0; i<a; i++){cout << curx << " " << cury << endl; curx++;}
for (int i=0; i<b; i++){cout << curx << " " << cury << endl; cury++;}
for (int i=0; i<c; i++){cout << curx << " " << cury << endl; curx++; cury++;}
for (int i=0; i<d; i++){cout << curx << " " << cury << endl; curx--; cury++;}
}
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... |