oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

hexagon Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

hexagon.html

Problem Description

Rar the Cat is bored of asking students to print squares, triangles and even diamonds. As such, he is asking you to print a new shape, hexagon.

The hexagon Rar the Cat wants you to print will be N units long on all of its 6 sides. (Refer to Sample Testcases)

Input

A single positive integer, N. N will not exceeed 100

Output

A hexagon with N units long on all of its 6 sides, comprising of 'x'.

You are not to print extra spaces after the last 'x' of the line or you might encounter 'Presentation Error' although the 'x' were printed correctly.

Sample Testcase 1

Input

3

Output

  xxx
 xxxxx
xxxxxxx
 xxxxx
  xxx

Sample Testcase 2

Input

7

Output

      xxxxxxx
     xxxxxxxxx
    xxxxxxxxxxx
   xxxxxxxxxxxxx
  xxxxxxxxxxxxxxx
 xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
 xxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxx
   xxxxxxxxxxxxx
    xxxxxxxxxxx
     xxxxxxxxx
      xxxxxxx

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100201s32MBAverage
2021s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o hexagon -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.