-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path028-m.cpp
More file actions
48 lines (44 loc) · 958 Bytes
/
Copy path028-m.cpp
File metadata and controls
48 lines (44 loc) · 958 Bytes
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
48
/*
* M [106251A]
* Problem: Gym/ICPC contest 106251 - problem A
* Verdict: ACCEPTED Solved: 2026-06-20
* Language: C++20 (GCC 13-64)
* Runtime: 31 ms Memory: 0 KB
* Tags: n/a
* Author: team "balls" (HossamIsmail, BidoTeima, a1abay)
* Source: https://codeforces.com/gym/106251/submission/379570835
*/
#include <bits/stdc++.h>
using namespace std;
void fun(){
int n;
cin >> n;
vector<vector<char>> v(n+1, vector<char>(n+1, '.'));
for(int i=0; i<=n; i++){
v[i][1] = '#';
v[i][n] = '#';
}
int cnt = 2;
for(int i=2; i<=n/2; i++){
v[cnt][i] = '#';
cnt++;
}
cnt = 2;
for(int i = n-1; i>n/2; i--){
v[cnt][i] = '#';
cnt++;
}
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
cout << v[i][j];
}
cout << '\n';
}
}
int32_t main(){
int t = 1;
cin >> t;
while(t--){
fun();
}
}