CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program{
    int n;
    cin >> n;
    int x=1;
    while(x<=n){
        int y=1;
        while(y<=n){
            if(x>=y){
                if(x%2==0){
                    cout << "x";
                }
                else cout << "o";
            }
            if(y>x){
                if(y%2==0){
                    cout << "x";
                }
                else cout << "o";
            }
            y++;
        }
        cout << endl;
        x++;
    }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program{
    int n;
    cin>>n;
    int k=1;
    while(k<=n) {
        if (k%2==1){
            int p=1;
            while(p<=k){
                cout<<"o";
                p++;}
                while(1){
                    if(p>n) break;
                    if (p%2==1) cout<<"o";
                    else cout<<"x";
                    p++;
                }}
        else{
            int p=1;
            while(p<=k){
                cout<<"x";
                p++;}
                while(1){
                    if(p>n) break;
                    if (p%2==1) cout<<"o";
                    else cout<<"x";
                    p++;
                }}        
        k++;
        cout<<endl;        
    }}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program{
int n;
char x,y;
cin>>n;
x='0';
y='x';
int i;
char temp;
i=1;
  repeat(n){
          repeat(i){
                  cout<<x;
          }
          if((int((n-i)/2))%2==0){
                  repeat((n-i)/2){
                          cout<<y<<x;
                          cout<<endl;
                  }}
          else{
                  repeat((n-i/2))
          {cout<<y<<x;}
                  cout<<y;
                  cout<<endl;
          }
          temp=y;
          y=x;
          x=temp;
          i=i+1;}

}

~                                                                                                                                                                                                           
~

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
void x(){cout << "x";}
void p(){cout << "o";}
main_program{
             int n,m,l,k,y;
             cin >> n;
             m=n;
             l=1;
             k=m;
             y=0;
             while(k!=0){int o=l;
                         int z=l%2;
                         n=m;

                                     if(z==0){repeat(l){x();};
                                                n=n-1;}
                                     else{repeat(l){p();};n=n-1;}
                          while(n!=0){if(z==0){if(y%2==0){p();}
                                               else{x();}

                                              }
                                      else{if(y%2==0){x();}
                                           else{p();}
                                          }
                                      y=y+1;
                                      n=n-1;
                                     }
                         cout << endl;
                         l=l+1;
                         k=k-1;
                         y=0;
                        }
            }

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program {
        int n, count=1;
        cin>>n;
        char a='o', b='x', c, d, e;
        for(int i=1; i<=n; i++) {
                for(int j=1; j<=count; j++) {
                        cout<<a;
                }
                d=a;
                e=b;
                for(int k=1; k<=n-count; k++) {
                        cout<<e;
                        c=e;
                        e=d;
                        d=c;
                }
                cout<<endl;
                c=a;
                a=b;
                b=c;
                count=count+1;
        }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include <simplecpp>

main_program{

        int n;
        cin >> n;

        for(int i=1; i<=n; i++) {

                if (i%2!=0) {
                        for(int j=1; j<=i; j++) {
                        cout << "o";

                        }

                        if (n%2==0) {
                                cout << "x";
                                for(int k=1; k<= ((n-i-1)/2); k++) {
                                        cout << "o"<< "x";
                                }
                        }

                        else {
                                for(int l=1; l<= ((n-i)/2); l++) {
                                        cout << "x"<< "o";
                                }
                        }
                }

                if (i%2==0) {
                        for(int m=1; m<=i; m++) {
                                cout << "x";
                        }

                        if (n%2==0) {
                                for(int p=1; p<=((n-i)/2); p++) {
                                        cout << "o"<< "x";
                                }
                        }
                        if (n%2!=0) {
                                cout << "o";
                                for(int q=1; q<=((n-i-1)/2); q++) {
                                    cout << "x" << "o";

                        }
                        }
                }
                cout << endl;

        }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include <simplecpp>

main_program{
    int n;
    cin >> n;
    for(int row = 1; row<=n; row++){
        for(int column = 1; column<=n; column++){
            if(row%2 == 1){
                if(column>row && column%2==0){
                    cout << "x";
                }
                else{
                    cout << "o";
                }
            }
            else{
                if(column<=row || column%2 == 0){
                    cout << "x";
                }
                else{
                    cout << "o";
                }
            }
        }
        cout << endl;
    }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include <simplecpp>

void letter(int x, int y) {
    if (y%2 == 0) {
        if (x <= y || x%2 == 0) {
            cout<<"x";
        } else {
            cout << "o";
        }
    } else {
        if (x > y && x%2 == 0) {
            cout << "x";
        } else {
            cout << "o";
        }
    }
}

main_program {
    int n;
    cin >> n;
    for (int i = 1; i <=n; i++){
        for (int j =1; j <= n; j++) {
            letter(i, j);
        }
        cout <<endl;
    }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program
{
   int n;
   cin>>n;
   for(int i=1;i<=n;i++)
   {
      
        if(i%2==1)
        {  int p=1;
        for(;p<=i;p++)  
        {cout<<'o';}
        for(;p<=n;p++)
           {
            if(p%2==0)
            { cout<<'x';}
            if(p%2==1)
            { cout<<'o';}
        
           }
          
        }
        if(i%2==0)
        { int p=1;
          for(;p<=i;p++)  
          {cout<<'x'; }
        
         for(;p<=n;p++)
           {
            if(p%2==1)
            { cout<<'o';}
            if(p%2==0)
            { cout<<'x';}
        
           }
        }
        
          
      cout<<endl;
      
   
   
   }



}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
int fn(int n,int m){
int k;
if(n>=m)
k=n;
else
k=m;
return k;    
}
main_program{
    int n;
    cin>>n;
    int i=1;
    int j=0;
    while(i<=n&&j<=n){
    if(j==n)
    {j=0;i++;cout<<endl;}
    j++;if(i==n+1)break;
if((fn(i,j)%2)==0)
cout<<"x";
else
cout<<"o";
    }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
main_program{
 int n;
 cin>>n;
 for(int i=1;i<=n;i++) {
   int a=1;
   if(i%2==0) {repeat(i){
        cout<<'x';
    }
   }
   else {repeat(i){
      cout<<'o';
    }
   a=-1;
   };
   repeat(n-i){
    if(a==1) cout<<'o';
    if(a==-1) cout<<'x';
    a=-a;
   };
  cout<<endl;
 }
}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A
Problem: Write a program to accept an integer n and print an n x n square grid filled with alternating concentric L-shaped patterns using the characters 'o' and 'x'.

The pattern always starts with the character 'o'.

The next row and column are filled with 'x', forming an L shape flipped on the vertical axis.

Then again with 'o', alternating until the entire grid is filled.

Examples

Input:
4

Output:
oxox
xxox
ooox
xxxx

Input:
7

Output:
oxoxoxo
xxoxoxo
oooxoxo
xxxxoxo
oooooxo
xxxxxxo
ooooooo


Input Format

An integer n.


Output Format

Print the n x n pattern of concentric L shapes using 'o' and 'x'.


Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the output.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include<simplecpp>
void fun(int n,int row){
    if(n==0){
        return;
    }
    if(row%2!=0){
        for(int i=1;i<=row;i++){
            cout<<'o';
        }
        for(int j=row+1;j<=n;j++){
            if(j%2==0){
                cout<<'x';
            }
            else{
                cout<<'o';
            }
        }
    }
    else{
        for(int i=1;i<=row;i++){
            cout<<'x';
        }
        for(int j=row+1;j<=n;j++){
            if(j%2!=0){
                cout<<'o';
            }
            else{
                cout<<'x';
            }
        }
    }
    cout<<endl;
}
main_program{
    int n;
    cin>>n;
    for(int s=1;s<=n;s++){
        fun(n,s);
    }

}

Grading criterion: Loops through the number of rows
Rating A: Correctly iterates over the loop for the number of rows

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: A