-
Notifications
You must be signed in to change notification settings - Fork 1
/
C.cpp
48 lines (37 loc) · 965 Bytes
/
C.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <bits/stdc++.h>
using namespace std;
#define ll long long
char grid[55][55];
int main()
{
ll a, b, c, d;
cin >> a >> b >> c >> d;
a--;
b--;
for(ll i = 1; i <= 50; i++) {
for(ll j = 1; j <= 25; j++) {
grid[i][j] = 'A';
}
for(ll j = 26; j <= 50; j++) {
grid[i][j] = 'B';
}
}
for(ll i = 1; i <= 50; i += 2) {
for(ll j = 1; j < 25; j += 2) {
if(b > 0) grid[i][j] = 'B', b--;
else if(c > 0) grid[i][j] = 'C', c--;
else if(d > 0) grid[i][j] = 'D', d--;
}
}
for(ll i = 1; i <= 50; i += 2) {
for(ll j = 27; j <= 50; j += 2) {
if(a > 0) grid[i][j] = 'A', a--;
else if(c > 0) grid[i][j] = 'C', c--;
else if(d > 0) grid[i][j] = 'D', d--;
}
}
cout << "50 50" << endl;
for(ll i = 1; i <= 50; i++)
cout << grid[i] + 1 << endl;
return 0;
}