Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: meme_boi2
Problemset: ห่วงโซ่ (Chain)
Language: cpp
Time: 0.038 second
Submitted On: 2025-09-02 21:24:49
//Chain
#include <bits/stdc++.h>
using namespace std;
int main(){
string txt = "Luffy";
int n = 6, t = 0;
cin >> txt >> n;
for(int r = 0; r < 1; r++){
for(int i = 0; i < 2*n + 1; i++){
for(int c = 0; c < txt.length(); c++){
t = 0;
for(int j = 0 ; j < 2*n - 1; j++){
if(j == 0 && (i == n -1 || i == n + 1) && c != 0){
cout << txt[c - 1];
}else if(j == 1 && i == n && c!= 0){
cout << txt[c-1];
}else if(abs(i-n) + abs(j-n) == n){
cout << txt[c];
}else{
cout << ".";
}
}
for(int w = 0; w < 2; w++){
if(w == 0 && (i == n - 1 || i == n + 1) && c == txt.length()-1){
cout << txt[txt.length()-1];
}else if(w == 1 && i == n && c == txt.length()-1){
cout << txt[txt.length() - 1];
}else if(c == txt.length()-1){
cout << ".";
}
}
}
cout << "\n";
}
}
}