1 / 2
May 2024
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int T, l, c;
    
    cin>>T;
    while(T--){
        cin>>l>>c ;
        for(int i=0; i<l; i++){
            for(int j=1; j<=c; j++){
                if (j!=c || j==1) cout<<"****";
                else if(c%2==0) cout<<"*";
            }
            cout<<endl;
            for(int j=1; j<=c; j++){
                (j==1) ? cout<<"*..*" : cout<<"..*" ; 
            }
            cout<<endl;
            for(int j=1; j<=c; j++){
                (j==1) ? cout<<"*..*" : cout<<"..*" ; 
            }
            cout<<endl;
            if(i==l-1){
                for(int j=1; j<=c; j++){
                    if (j!=c || j==1) cout<<"****";
                    else if(c%2==0) cout<<"*";
                }
                cout<<endl;
            }
        }
        cout<<endl;
    }
    return 0;
}

This isn’t pretty, but it seems to pass all the sample test cases successfully. I’ve been wondering why then i get WA upon submitting.

Thanks in advance for any help :slight_smile:

  • created

    May '24
  • last reply

    May '24
  • 1

    reply

  • 248

    views

  • 2

    users

  • 2

    likes