#include using namespace std; int M, N; char grid[100][100]; void init() { for(int x = 0; x < M; x++) for(int y=0; y= M || y >= M) return; grid[x][y] = c; } void draw(int s, int x, int y) { if(s == 0) { putPixel(x-1,y, '_'); putPixel(x,y, 'o'); putPixel(x+1,y, '_'); } else { // roots putPixel(x-1,y, '_'); putPixel(x,y, '|'); putPixel(x+1,y, '_'); for(int i = 1; i <= s; i++) { putPixel(x-1, y+i, '/'); putPixel(x, y+i, '|'); putPixel(x+1, y+i, '\\'); } // top putPixel(x, y+s + 1, '^'); } } void finalDraw() { for(int x = 0; x < M + 2; x++) printf("*"); printf("\n"); for(int y = M - 1; y >= 0; y--) { printf("*"); for(int x = 0; x < M; x++) printf("%c", grid[x][y]); printf("*"); printf("\n"); } for(int x = 0; x < M + 2; x++) printf("*"); printf("\n"); } int main() { while(cin >> M >> N) { init(); while(N -- > 0) { int s, x, y; cin >> s >> x >> y; draw(s,x,y); } finalDraw(); printf("\n"); } }