#include <iostream>
using namespace std;
void print(int n){
for(int i=0;i<n;i++){
cout<<'-';
}
cout << endl<<"-"<<endl;
}
void half(int p){
int x=2;
while(x<=p-2){//cout<<"\nx = "<<x<<endl;
print(p-(p-x));
x++;
}
x--;
while(x>1){
x--;
if(p-(p-x)!=1)
print(p-(p-x));
}
}
int main() {
int l,p;
cin>>l>>p;
if(p==1){
for(int out=0; out<=l;out++ ){
for(int i = 0 ; i < p ; i++){
cout<<'-';
}
cout<<out<<endl;
}
return 0 ;
}
if(p==2){
for(int out=0; out<=l;out++ ){
for(int i = 0 ; i < p ; i++){
cout<<'-';
}
cout<<out<<endl;
if(out!=l){
cout<<"-\n-\n";
}
}
return 0 ;
}
for(int out=0; out<=l;out++ ){
for(int i = 0 ; i < p ; i++){
cout<<'-';
}
cout << out<<endl;
if(out!=l){
cout<<"-\n";
half(p);
//you reached p-1
for(int i=0;i<p-1;i++)
{
cout<<'-';
}
cout<<"\n-"<<endl;
half(p);
}
}
return 0;
}
Copy