# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
243229 |
2020-06-30T15:15:36 Z |
VEGAnn |
Pick (COI18_pick) |
C++14 |
|
6 ms |
512 KB |
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
using namespace std;
typedef long double ld;
const int N = 400100;
const ld E = 1e-10;
int a, b, c, d, x, y;
void prit(){
cout << x << " " << y << '\n';
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> a >> b >> c >> d;
cout << "0 0\n";
if (a == 0 && b == 0){ // 0
for (int it = 0; it < c / 2; it++){
x++; y++;
prit();
}
x--; y++;
prit();
for (int it = 1; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 1; it < d / 2; it++){
x--; y++;
prit();
}
x--; y--;
prit();
for (int it = 0; it < d / 2; it++){
x++; y--;
if (x != 0 || y != 0)
prit();
}
return 0;
}
if (a % 2 == 0 && b % 2 == 0 && a > 0 && b > 0 && c % 2 == 0 && d % 2 == 0){
for (int it = 0; it < a / 2; it++){
x++;
prit();
}
for (int it = 0; it < b / 2; it++){
y++;
prit();
}
for (int it = 0; it < c / 2; it++){
x++; y++;
prit();
}
for (int it = 0; it < d / 2; it++){
x--; y++;
prit();
}
x--;
prit();
for (int it = 0; it < d / 2; it++){
x++; y--;
prit();
}
for (int it = 0; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 1; it < b / 2; it++){
y--;
prit();
}
for (int it = 1; it < a / 2; it++){
x--;
prit();
}
return 0;
}
if (c % 2 == 0 && c > 0 && a % 2 == 0 && a > 0){
for (int i = 0; i < a / 2; i++){
x++;
prit();
}
x++; y++;
prit();
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
for (int i = 1; i < c / 2; i++){
x++; y++;
prit();
}
for (int i = 0; i < d / 2; i++){
x--; y++;
prit();
}
x--;
prit();
for (int i = 0; i < d / 2; i++){
x++; y--;
prit();
}
for (int i = 1; i < c / 2; i++){
x--; y--;
prit();
}
for (int i = 0; i < b / 2; i++){
y--;
prit();
}
for (int i = 1; i < a / 2; i++){
x--;
prit();
}
return 0;
}
if (d % 2 == 0 && d > 0 && a % 2 == 0 && a > 0){
for (int i = 0; i < a / 2; i++){
x++;
prit();
}
x--; y++;
prit();
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
for (int i = 0; i < c / 2; i++){
x++; y++;
prit();
}
for (int i = 1; i < d / 2; i++){
x--; y++;
prit();
}
x--;
prit();
for (int i = 1; i < d / 2; i++){
x++; y--;
prit();
}
for (int i = 0; i < c / 2; i++){
x--; y--;
prit();
}
for (int i = 0; i < b / 2; i++){
y--;
prit();
}
for (int i = 1; i < a / 2; i++){
x--;
prit();
}
return 0;
}
if (a % 2 == 0 && a > 0 && c % 2 == 1 && d % 2 == 1){
for (int i = 1; i < a / 2; i++){
x++;
prit();
}
x++; y++;
prit();
for (int it = 0; it < b / 2; it++){
y++;
prit();
}
for (int it = 0; it < c / 2; it++){
x++; y++;
prit();
}
for (int it = 0; it < d / 2; it++){
x--; y++;
prit();
}
x--;
prit();
for (int it = 0; it < d / 2; it++){
x++; y--;
prit();
}
for (int it = 0; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 0; it < b / 2; it++){
y--;
prit();
}
for (int i = 0; i < a / 2; i++){
x--;
prit();
}
return 0;
}
if (b % 2 == 0 && b > 0 && c % 2 == 1 && d % 2 == 1){
for (int i = 1; i < b / 2; i++){
y++;
prit();
}
x--; y++;
prit();
for (int it = 0; it < a / 2; it++){
x--;
prit();
}
for (int it = 0; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 0; it < d / 2; it++){
x--; y++;
prit();
}
y--;
prit();
for (int it = 0; it < d / 2; it++){
x++; y--;
prit();
}
for (int it = 0; it < c / 2; it++){
x++; y++;
prit();
}
for (int it = 0; it < a / 2; it++){
x++;
prit();
}
for (int i = 0; i < b / 2; i++){
y--;
prit();
}
return 0;
}
if (b % 2 == 0 && b > 0 && c % 2 == 0 && c > 0){
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
x--; y--;
prit();
for (int it = 0; it < a / 2; it++){
x--;
prit();
}
for (int it = 1; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 0; it < d / 2; it++){
x--; y++;
prit();
}
y--;
prit();
for (int it = 0; it < d / 2; it++){
x++; y--;
prit();
}
for (int it = 1; it < c / 2; it++){
x++; y++;
prit();
}
for (int it = 0; it < a / 2; it++){
x++;
prit();
}
for (int i = 1; i < b / 2; i++){
y--;
prit();
}
return 0;
}
if (b % 2 == 0 && b > 0 && d % 2 == 0 && d > 0){
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
x--; y++;
prit();
for (int it = 0; it < a / 2; it++){
x--;
prit();
}
for (int it = 0; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 1; it < d / 2; it++){
x--; y++;
prit();
}
y--;
prit();
for (int it = 1; it < d / 2; it++){
x++; y--;
prit();
}
for (int it = 0; it < c / 2; it++){
x++; y++;
prit();
}
for (int it = 0; it < a / 2; it++){
x++;
prit();
}
for (int i = 1; i < b / 2; i++){
y--;
prit();
}
return 0;
}
if (a % 2 == 1 && b % 2 == 1 && c % 2 == 1){
for (int i = 0; i < a / 2; i++){
x++;
prit();
}
x++; y++;
prit();
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
for (int i = 0; i < c / 2; i++){
x++; y++;
prit();
}
for (int i = 0; i < d / 2; i++){
x--; y++;
prit();
}
x--;
prit();
for (int i = 0; i < d / 2; i++){
x++; y--;
prit();
}
for (int i = 0; i < c / 2; i++){
x--; y--;
prit();
}
for (int i = 0; i < b / 2; i++){
y--;
prit();
}
for (int i = 0; i < a / 2; i++){
x--;
prit();
}
return 0;
}
if (b % 2 == 0 && b > 0 && d % 2 == 0 && d > 0){
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
x--; y++;
prit();
for (int it = 0; it < a / 2; it++){
x--;
prit();
}
for (int it = 0; it < c / 2; it++){
x--; y--;
prit();
}
for (int it = 1; it < d / 2; it++){
x--; y++;
prit();
}
y--;
prit();
for (int it = 1; it < d / 2; it++){
x++; y--;
prit();
}
for (int it = 0; it < c / 2; it++){
x++; y++;
prit();
}
for (int it = 0; it < a / 2; it++){
x++;
prit();
}
for (int i = 1; i < b / 2; i++){
y--;
prit();
}
return 0;
}
if (a % 2 == 1 && b % 2 == 1 && d % 2 == 1){
for (int i = 0; i < a / 2; i++){
x++;
prit();
}
y++;
prit();
for (int i = 0; i < b / 2; i++){
y++;
prit();
}
for (int i = 0; i < c / 2; i++){
x++; y++;
prit();
}
for (int i = 0; i < d / 2; i++){
x--; y++;
prit();
}
x--;
prit();
for (int i = 0; i < d / 2; i++){
x++; y--;
prit();
}
for (int i = 0; i < c / 2; i++){
x--; y--;
prit();
}
for (int i = 0; i < b / 2; i++){
y--;
prit();
}
for (int i = 0; i < a / 2; i++){
x--;
prit();
}
return 0;
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
5 ms |
384 KB |
Output is correct |
14 |
Correct |
4 ms |
256 KB |
Output is correct |
15 |
Correct |
5 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
5 ms |
384 KB |
Output is correct |
14 |
Correct |
4 ms |
256 KB |
Output is correct |
15 |
Correct |
5 ms |
512 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
5 ms |
384 KB |
Output is correct |
18 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
5 ms |
384 KB |
Output is correct |
14 |
Correct |
4 ms |
256 KB |
Output is correct |
15 |
Correct |
5 ms |
512 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
5 ms |
384 KB |
Output is correct |
18 |
Correct |
5 ms |
384 KB |
Output is correct |
19 |
Correct |
5 ms |
384 KB |
Output is correct |
20 |
Correct |
5 ms |
384 KB |
Output is correct |
21 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
5 ms |
384 KB |
Output is correct |
14 |
Correct |
4 ms |
256 KB |
Output is correct |
15 |
Correct |
5 ms |
512 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
5 ms |
384 KB |
Output is correct |
18 |
Correct |
5 ms |
384 KB |
Output is correct |
19 |
Correct |
5 ms |
384 KB |
Output is correct |
20 |
Correct |
5 ms |
384 KB |
Output is correct |
21 |
Correct |
5 ms |
384 KB |
Output is correct |
22 |
Correct |
5 ms |
384 KB |
Output is correct |
23 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
4 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
4 ms |
384 KB |
Output is correct |
14 |
Correct |
5 ms |
384 KB |
Output is correct |
15 |
Correct |
5 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
5 ms |
384 KB |
Output is correct |
18 |
Correct |
5 ms |
384 KB |
Output is correct |
19 |
Correct |
5 ms |
384 KB |
Output is correct |
20 |
Correct |
4 ms |
384 KB |
Output is correct |
21 |
Correct |
5 ms |
384 KB |
Output is correct |
22 |
Correct |
4 ms |
256 KB |
Output is correct |
23 |
Correct |
5 ms |
512 KB |
Output is correct |
24 |
Correct |
4 ms |
384 KB |
Output is correct |
25 |
Correct |
5 ms |
384 KB |
Output is correct |
26 |
Correct |
5 ms |
384 KB |
Output is correct |
27 |
Correct |
5 ms |
384 KB |
Output is correct |
28 |
Correct |
5 ms |
384 KB |
Output is correct |
29 |
Correct |
5 ms |
384 KB |
Output is correct |
30 |
Correct |
5 ms |
384 KB |
Output is correct |
31 |
Correct |
5 ms |
384 KB |
Output is correct |
32 |
Correct |
5 ms |
384 KB |
Output is correct |
33 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
4 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
4 ms |
384 KB |
Output is correct |
14 |
Correct |
5 ms |
384 KB |
Output is correct |
15 |
Correct |
5 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
5 ms |
384 KB |
Output is correct |
18 |
Correct |
5 ms |
384 KB |
Output is correct |
19 |
Correct |
5 ms |
384 KB |
Output is correct |
20 |
Correct |
4 ms |
384 KB |
Output is correct |
21 |
Correct |
5 ms |
384 KB |
Output is correct |
22 |
Correct |
4 ms |
256 KB |
Output is correct |
23 |
Correct |
5 ms |
512 KB |
Output is correct |
24 |
Correct |
4 ms |
384 KB |
Output is correct |
25 |
Correct |
5 ms |
384 KB |
Output is correct |
26 |
Correct |
5 ms |
384 KB |
Output is correct |
27 |
Correct |
5 ms |
384 KB |
Output is correct |
28 |
Correct |
5 ms |
384 KB |
Output is correct |
29 |
Correct |
5 ms |
384 KB |
Output is correct |
30 |
Correct |
5 ms |
384 KB |
Output is correct |
31 |
Correct |
5 ms |
384 KB |
Output is correct |
32 |
Correct |
5 ms |
384 KB |
Output is correct |
33 |
Correct |
5 ms |
384 KB |
Output is correct |
34 |
Correct |
4 ms |
384 KB |
Output is correct |
35 |
Correct |
5 ms |
384 KB |
Output is correct |
36 |
Correct |
4 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
4 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
384 KB |
Output is correct |
9 |
Correct |
4 ms |
384 KB |
Output is correct |
10 |
Correct |
5 ms |
384 KB |
Output is correct |
11 |
Correct |
5 ms |
384 KB |
Output is correct |
12 |
Correct |
4 ms |
384 KB |
Output is correct |
13 |
Correct |
4 ms |
384 KB |
Output is correct |
14 |
Correct |
5 ms |
384 KB |
Output is correct |
15 |
Correct |
5 ms |
384 KB |
Output is correct |
16 |
Correct |
4 ms |
384 KB |
Output is correct |
17 |
Correct |
5 ms |
384 KB |
Output is correct |
18 |
Correct |
5 ms |
384 KB |
Output is correct |
19 |
Correct |
5 ms |
384 KB |
Output is correct |
20 |
Correct |
4 ms |
384 KB |
Output is correct |
21 |
Correct |
5 ms |
384 KB |
Output is correct |
22 |
Correct |
4 ms |
256 KB |
Output is correct |
23 |
Correct |
5 ms |
512 KB |
Output is correct |
24 |
Correct |
4 ms |
384 KB |
Output is correct |
25 |
Correct |
5 ms |
384 KB |
Output is correct |
26 |
Correct |
5 ms |
384 KB |
Output is correct |
27 |
Correct |
5 ms |
384 KB |
Output is correct |
28 |
Correct |
5 ms |
384 KB |
Output is correct |
29 |
Correct |
5 ms |
384 KB |
Output is correct |
30 |
Correct |
5 ms |
384 KB |
Output is correct |
31 |
Correct |
5 ms |
384 KB |
Output is correct |
32 |
Correct |
5 ms |
384 KB |
Output is correct |
33 |
Correct |
5 ms |
384 KB |
Output is correct |
34 |
Correct |
4 ms |
384 KB |
Output is correct |
35 |
Correct |
5 ms |
384 KB |
Output is correct |
36 |
Correct |
4 ms |
384 KB |
Output is correct |
37 |
Correct |
5 ms |
384 KB |
Output is correct |
38 |
Correct |
5 ms |
384 KB |
Output is correct |
39 |
Correct |
5 ms |
384 KB |
Output is correct |
40 |
Correct |
5 ms |
384 KB |
Output is correct |
41 |
Correct |
4 ms |
384 KB |
Output is correct |
42 |
Correct |
6 ms |
384 KB |
Output is correct |
43 |
Correct |
5 ms |
384 KB |
Output is correct |