// 第一题 画里
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
void f(int n){
map<int,vector<vector<int>>> m;
m.insert({1,{{0,11,0}}});
m.insert({2,{{0,2,0},{2,7,1},{9,2,0}}});
m.insert({3,{{0,2,0},{2,1,1},{3,2,0},{5,1,1},{6,2,0},{8,1,1},{9,2,0}}});
m.insert({4,{{0,2,0},{2,7,1},{9,2,0}}});
m.insert({5,{{0,2,0},{2,1,1},{3,2,0},{5,1,1},{6,2,0},{8,1,1},{9,2,0}}});
m.insert({6,{{0,2,0},{2,7,1},{9,2,0}}});
m.insert({7,{{0,5,0},{5,1,1},{6,5,0}}});
m.insert({8,{{0,2,0},{2,7,1},{9,2,0}}});
m.insert({9,{{0,5,0},{5,1,1},{6,5,0}}});
m.insert({10,{{0,1,0},{1,9,1},{10,1,0}}});
m.insert({11,{{0,11,0}}});
for(int i=1;i<=11;i++){
vector<vector<int>> records = m[i];
for(int j=0;j<n;j++){
for(vector<int> &v:records){
for(int i=0;i<v[1]*n;i++){
if(v[2]==0){
cout<<".";
}else{
cout<<"*";
}
}
}
cout<<endl;
}
}
}
int main(){
int n = 0;
cin >> n;
f(n);
return 0;
}
// 第二题 点击计算最大得分
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
long dfs(vector<string> &boards,int i,int j,int n,int m,char color,vector<vector<bool>> &visited,vector<vector<int>> &directions){
if(i<0||i>=n||j<0||j>=m){
return 0;
}
if(boards[i][j]!=color){
return 0;
}
if(visited[i][j]){
return 0;
}
visited[i][j] = true;
long long score = 0;
if(color=='r'){
score = 1;
}else if(color=='b'){
score = 2;
}else if(color=='g'){
score =3;
}else if(color=='p'){
score = 5;
}
for(auto direction:directions){
int next_i = i + direction[0];
int next_j = j + direction[1];
score+= dfs(boards,next_i,next_j,n,m,color,visited,directions);
}
return score;
}
int main(){
int n=0,m=0,k=0;
cin>>n>>m>>k;
vector<string> boards(n);
string input;
int index = 0;
while(cin>>input){
boards[index++] = input;
}
vector<vector<bool>> visited(n,vector<bool>(m,false));
vector<vector<int>> directions={
{-1,0},{1,0},{0,-1},{0,1}
};
vector<long long> scores;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(!visited[i][j]){
long long score = dfs(boards,i,j,n,m,boards[i][j],visited,directions);
scores.push_back(score);
}
}
}
sort(scores.begin(),scores.end());
index = scores.size() - 1;
long long ans = 0;
while(k>0&&index>=0){
ans+=scores[index--];
k--;
}
cout<<ans;
return 0;
}