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{
char a,b;
long n,o=0;
cin >> n>>a;
b=a;
if(b=='a'||b=='i'||b=='e'||b=='o'||b=='u')
o=1;
repeat(n-1){
cin >> a;
if((b!='a'&&b!='i'&&b!='e'&&b!='o'&&b!='u') && (a=='a'||a=='i'||a=='e'||a=='o'||a=='u'))
        o=o+1;
b=a;
}
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: C
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 i=1;
        if(n%2==1){repeat(n){
                repeat(i){
                        if(i%2==1)
                                cout<<"o";
                        else
                                cout<<"x";
                }
                        if((n-i)%2==0)
                                repeat((n-i)/2){
                                cout<<"x"<<"o";}
                        else
                        {repeat((n-i)/2){
                                        cout<<"o"<<"x";}
                        cout<<"o";}
                        i=i+1;
                        cout<<endl;

        }
        }
        else
        {repeat(n){
                repeat(i){
                        if(i%2==1)
                                cout<<"o";
                        else
                                cout<<"x";
                }
                        if((n-i)%2==0)
                                repeat((n-i)/2){
                                cout<<"o"<<"x";}
                        else
                        {repeat((n-i)/2){
                                        cout<<"x"<<"o";}
                        cout<<"x";}
                        i=i+1;
                        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;
        int a= 1, b;
        while( a <= n){
                repeat(a){
                        if (a%2 != 0){
                        cout << "o";}
                        else cout << "x";
                }
                b =  a;
                a++;
                while(b<=n){
                        if(a%2 != 0){
                                if (b>=n) break;
                        cout << "o";
                        b++;
                        if (b >= n) break;
                        cout << "x";
                        b++;
                        }
                        else{
                                if (b>= n) break;
                                cout << "x";
                                b++;
                                if( b >= n) break;
                                cout << "o";
                                b++;
                        }
                }
                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;
        char o = 'o';
        char x = 'x';
        for( int i=1; i<=n; i++){
                if(i%2==1){repeat(i){cout<<o;}}
                else{repeat(i){cout<<x;}}
                for(int odev=i-1; odev<n-1; odev++){
                        while((odev<n-1)){
                                if(odev%2==0) cout<<x;
                                else cout<<o;
                                odev=odev+1;

                        }
}
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=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(j %2 ==0 && j>=i){ cout << 'o';}
			else if(j %2 ==1 && j>=i){ cout << 'x';}
			else if(i %2 ==0 && i>j){ cout << 'o';}
			else if(i %2 ==1 && i>j){ 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>
main_program{
    int n;
    cin >> n;
    int i = 1;
    while(i<=n){
        if (i%2 != 0){
            int r = 1;
            while(r<=n){
                if ((r%2 == 0) && (r > i)){
                    cout << "x";
                }
                else 
                    cout << "o";
                r++;
            }
        }
        if (i%2 == 0){
            int q = 1;
            while(q <= n){
                if (q <= i || q%2 == 0){
                    cout << 'x';
                }
                else 
                    cout << "o";
                q++;
            }
        }
        cout << endl;
        i++;
    }
}

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 max(int i,int j){
      if(i>j){
              return i;
              }
      else {
            return j;
            }
}
main_program{
        int n;
        cin>>n;
  int i=1,j=1;
repeat(n){
         repeat(n){
               if( max(i,j)%2==0){
                     cout<<"x";}
               else cout<< "o";
               j++;
         }
         cout<<endl;
         i++;
         j=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+1;i++){
                if(i%2==1){
                        for(int j=1;j<=i;j++) cout<<'o';
                        if(n%2==1){
                                for(int j=1;j<=(n-i)/2;j++) cout<<'x'<<'o';}
                        else{
                                for(int j =1; j<=(n-i-1)/2;j++)cout<<'x'<<'o';
                                cout<<'x';}
                        cout<<endl;}
                else{
                        for(int j=1;j<=i;j++) cout<<'x';
                        if(n%2==0){
                                for(int j=1;j<=(n-i)/2;j++) cout<<'o'<<'x';}
                        else{
                                for(int j =1; j<=(n-i-1)/2;j++)cout<<'o'<<'x';
                                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>
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";
            }
            else
            {
                for(int j=1;j<=i;j++)
                cout << "x";
            }
            for(int k=1;k<=n-i;k++)
            {
                if(i%2==0)
                {
                    if(k%2==0)
                    cout << "x";
                    else
                    cout << "o";
                }
                else
                {
                     if(k%2==0)
                    cout << "o";
                    else
                    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>
main_program {
        int N, i;
        int m=1;
        cin >> N;
        if(N%2==0)
                for(i=1; i<=N; i=i+2){
                        repeat(m){cout << "o";}
                        cout << "x";
                        repeat((N-m-1)/2){cout << "ox";}
                        cout << endl;
                        m++;
                        repeat(m){cout << "x";}
                        repeat((N-m)/2){cout << "ox";}
                        cout << endl;
                        m++;
                }
        else
                for(i=1; i<=N-1; i=i+2){
                        repeat(m){cout << "o";}
                        repeat((N-m)/2){cout << "xo";}
                        cout << endl;
                        m++;
                        repeat(m-1){cout << "x";}
                        repeat((N-m+1)/2){cout << "xo";}
                        cout << endl;
                        m++;
                }
        if(N%2!=0) repeat(N){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 swap(char &a, char &b){
    char c = a;
    a=b;
    b=c;
}
main_program{
    char a='o',b='x';
    int n;
    cin >>n;
    for(int i=1;i<=n;i++){
        repeat(i){
            cout<<a;
        }
        repeat(n-i){
            cout<<b;
            swap(a,b);
        }
        if((n-i)%2==0)swap(a,b);
        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>

//evaluates the number at (i, j)
char print(int i, int j){
    int r = 1, c = 1;
    char direc = 'd', output = 'o';
    while(i != c || j != r){
        if (r == c)
            direc = 'l';
        if (direc == 'd')
            ++r;
        if (direc == 'l')
            --c;
        if(c == 0){
            c = r+1;
            r = 1;
            direc = 'd';
            if (output == 'o') output = 'x';
            else output = 'o';
        }
    }
    return output;
}

main_program{
    int order;
    cin >> order;
    for(int j = 1; j <= order; j++){
        for(int i = 1; i <= order; i++){
            cout << print(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>
void ox(int a){int k=1;while(k!=(a/2)+1){cout>>"o">>"x";};k++cout>>endl;}
void l(int n){
    int k=1;
    int p=1;
    if(n%2==0){ox(n);
    for(;p!=n+1;k++)repeat(2*k){
        cout>>"x";}
    ox(n-2*k);p++;
    repeat(2*k){cout>>"o";}
    ox(n-2*k);p++;}


}

main_program{
int n;
cin>>n;
l(n);

}

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: C