-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAda King .cpp
50 lines (40 loc) · 954 Bytes
/
Ada King .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
48
49
50
/**
* author : Saurav Paul
* created : July 15, 2020 11:46 PM
* Problem Name : Ada King
* Problem Limit : 1000 ms , 256 MB
* Problem Url : https://www.codechef.com/JULY20B/problems/ADAKING
**/
#include<bits/stdc++.h>
using namespace std;
void solve(){
int n ;
cin >> n;
vector < vector <char> > v(8, vector<char>(8,'X')) ;
int cnt = 0 ;
for(int i = 0 ; i < n and cnt < n ; i++) {
for(int j = 0 ; j < 8 and cnt < n ; j ++ ){
v[i][j] = '.' ;
++ cnt ;
}
}
v[0][0] = 'O' ;
for(int i = 0 ; i < 8 ; i ++){
for(int j = 0 ; j < 8 ; j ++){
cout << v[i][j] ;
}
cout << endl;
}
}
int main(){
ios_base::sync_with_stdio(false);
int testcase ;
cin >> testcase ;
for(int i = 0 ; i < testcase ; i ++){
if(i){
cout << endl ;
}
solve();
}
return 0 ;
}