/* -*- coding: utf-8 -*- * * 455.cc: No.455 冬の大三角 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_H = 100; const int MAX_W = 100; /* typedef */ template struct Pt { T x, y; Pt() {} Pt(T _x, T _y) : x(_x), y(_y) {} Pt(const Pt& pt) : x(pt.x), y(pt.y) {} bool operator==(const Pt pt) const { return x == pt.x && y == pt.y; } Pt operator+(const Pt pt) const { return Pt(x + pt.x, y + pt.y); } Pt operator-() const { return Pt(-x, -y); } Pt operator-(const Pt pt) const { return Pt(x - pt.x, y - pt.y); } T dot(Pt v) const { return x * v.x + y * v.y; } T cross(Pt v) const { return x * v.y - y * v.x; } }; typedef Pt pt; /* global variables */ string bds[MAX_H]; pt ps[3]; /* subroutines */ /* main */ int main() { int h, w; cin >> h >> w; for (int y = 0, k = 0; y < h; y++) { cin >> bds[y]; for (int x = 0; x < w; x++) if (bds[y][x] == '*') ps[k++] = pt(x, y); } bool ok = false; for (int y = 0; ! ok && y < h; y++) for (int x = 0; ! ok && x < w; x++) { pt p(x, y), v0(p - ps[0]), v1(p - ps[1]); if (v0.cross(v1) != 0) { bds[y][x] = '*'; ok = true; } } for (int y = 0; y < h; y++) cout << bds[y] << endl; return 0; }