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;
#define ll long long
#define pii pair <int, int>
#define fi first
#define se second
int a, b, c, d;
void ispisi(int x, int y) {
cout << x << " " << y << "\n";
}
void solve1() {
int x = 0, y = 0;
for (int i = 0; i < b / 2; i++) {
ispisi(x, y); y++;
}
ispisi(x, y); x++;
for (int i = 0; i < (b - 1) / 2; i++) {
ispisi(x, y); y--;
}
for (int i = 0; i < (a - 1) / 2; i++) {
ispisi(x, y); x++;
}
ispisi(x, y); y--;
for (int i = 0; i < a / 2; i++) {
ispisi(x, y); x--;
}
}
void solve2() {
int x = 0, y = 0;
for (int i = 0; i < d / 2; i++) {
ispisi(x, y); x--; y++;
}
ispisi(x, y); x++; y++;
for (int i = 0; i < (d - 1) / 2; i++) {
ispisi(x, y); y--; x++;
}
for (int i = 0; i < (c - 1) / 2; i++) {
ispisi(x, y); x++; y++;
}
ispisi(x, y); y--; x++;
for (int i = 0; i < c / 2; i++) {
ispisi(x, y); x--; y--;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> a >> b >> c >> d;
if (c == 0 && d == 0) solve1();
if (a == 0 && b == 0) solve2();
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... |