#include <bits/stdc++.h>
using namespace std;
#define INT long long int 

INT n;

void f(INT x, INT y, INT num)
{
  if((x/num)%3 == 1 && (y/num)%3 == 1) {
    cout << ' ';
  }
  else{
    if(num/3 == 0)  cout << "*";
    else  f(x,y,num/3);
  }
}

int main()
{
  cin >> n;
  for(INT i=0; i<n; i++) {
    for(INT j=0; j<n; j++) {
      f(i,j,n);
    }
    cout << "\n";
  }
}


-분할정복

'코딩 일지 > baekjoon' 카테고리의 다른 글

1992  (0) 2023.12.30
2630  (0) 2023.12.28
1260 dfs와 bfs  (0) 2023.08.30
1655 가운데를 말해요  (0) 2023.08.22
12865 - 평범한 배낭  (0) 2023.08.17

+ Recent posts