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>

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: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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;
        if(n%2==1){
        for(int i=1;i<=n;i++){
                if(i%2==0){
                        repeat(i){
                                cout<<"x";
                        }
                        repeat((n-i-1)/2){
                                cout<<"ox";
                        }
                        cout<<"o";
                }
                if(i%2==1){
                        repeat(i){
                                cout<<"o";
                        }
                        repeat((n-i)/2){
                                cout<<"xo";
                        }
        }
                cout<<endl;
        }
        }
        if(n%2==0){
                for(int j=1;j<=n;j++){
                        if(j%2==1){
                                repeat(j){
                                        cout<<"o";
                                }
                                repeat((n-j-1)/2){
                                        cout<<"xo";
                                }
                                cout<<"x";
                        }
                        if(j%2==0){
                                repeat(j){
                                        cout<<"x";
                                }
                                repeat((n-j)/2){
                                        cout<<"ox";
                                }
                        }
                        cout<<endl;
                }
        }
}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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 ((max(i,j)%2))
				cout << 'x';
			else
				cout << 'o';
		}
		cout << endl;
	}
}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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 intValue(char m) {
        if(m == '1') m = '10';
        if(m == 'J') m = '11';
        if(m == 'Q') m = '12';
        if(m == 'A') m = '14';
        if(m == 'K') m = '13';
return m ;
}

int winner(char s1, char v1, char s2, char v2, char s3, char v3) {
        if (s1 == s2) {
            v1= max(v1,v2) ;
        }
        if (s1 == s3) {
           v1 = max(v1,v3) ;
        }
        return v1 ;
}

main_program
{
    char v1, s1, v2, s2, v3, s3;
    cin >> s1 >> v1 >> s2 >> v2 >> s3 >> v3;
    cout << intValue(v1) << " " << intValue(v2) << " " << intValue(v3) << " ";
    cout << winner(s1, v1, s2, v2, s3, v3) << endl;
    return 0;
}
~

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

Assigned grade: D
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,jC,a[30][30],l=0,b,t=0,r;
        cin>>N;
        char o,x;
        for(int i=0;i<=N*N; i++){
                for(int j=0;j<=i;j++){
                        cout<<'o';
                        a[i][j]++;
                }
        }
        cout<<a[i][j]<<endl;


}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

Assigned grade: D
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 next(int &a,int &b,int &lay)
{
    if(b==1)
        {lay++;
            a=1;
            b=lay;
            return;

        }
if(a<lay){ a++;
    return;}
else if(b>1){
b--;
return;

}
}

void p(int n){

if(n%2==0)
cout<<'x';
else 
cout<<'o';

}








main_program{

int n,a,b,lay;
cin>>n;


for(int i=1;i<=n;i++)
{   a=1;
    b=1;
    lay=1;
    for(int j=1;j<=n;j++)
    { a=1;
    b=1;
    lay=1;
    while(a!=i || b!=j){
        next(a,b,lay);



    }
    p(lay);



    }
    cout<<endl;










}












}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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 i=1,j=1,n,k;
main_program{
        cin >> n;
        repeat(n){
                repeat(n){
                        if(i>=j){
                        k=i;
                        }
                        if(i<=j){
                        k=j;
                        }
                        if(k%2 == 1){
                        cout << "o";
                        }
                        if(k%2 == 0){
                        cout << "x";
                        }
                        j++;
                }
        cout << endl;
        j=1;
        i++;
        }
}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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){repeat(i){
            cout << "o";
        }
     if(n-i!=0){cout << "x";}
     if(n-i!=0){cout << "o";}
    }
        if(i%2==0){
        repeat(i){
            cout << "x";
        }
     if(n-i!=0){cout << "o";}
     if(n-i!=0){cout << "x";}
        }
        cout<<endl;
    }
}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

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,i=1;
        cin>>n;
        char a=o,b=x,c=o,d=x,temp1,temp2,temp3;
        while(i<n+1)
        {temp1=c;
         c=d;
         d=temp1;
         repeat(i){cout<<d;}
         repeat(n-i){cout<<b;
                 temp2=b;
                 b=a;
                 a=temp2;}
         cout<<endl;
         temp3=b;
         b=a;
         a=temp3;
         i++;
        }
}

Grading criterion: Printing the 'o' or 'x' in the pattern
Rating A: Correctly determines whether to print 'o' or 'x' and prints it

Rating B: Some minor issues like computing whether the row is even or odd, determining the next character, etc

Rating C: Some issue. 

Rating D: Major issue. 

Assigned grade: D