Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0019 - HEXES IN VIEWPORT |
A game development company has started prototyping a new game, which is played on a field based on a hexagonal grid. The first task is to display a part of the grid in the player's viewport. To speed up the prototyping phase, it was decided to use text-based representation instead of graphics.
The hexagonal grid is composed of nearly perfect hexagons with the side of N characters. In every hexagon, the top and the bottom sides are composed of N "_" characters (ASCII 95), the right-top and the left-bottom sides are composed of N "\" characters (ASCII 92), the left-top and the right-bottom sides are composed of N "/" characters (ASCII 47). All other characters of the field are "." (ASCII 46).
The grid is assumed to be infinite, with the position (0; 0) corresponding to the leftmost character of the top side of a hexagon. The player's viewport is a rectangle displaying some part of the field.
You program must, given the coordinates x, y of the top left corner of the viewport and w, h — the viewport width and height, output the content of the viewport.
Input
Input file contains integers N, x, y, w, h, (1 ≤ N ≤ 100, 0 ≤ x, y ≤ 109, 1 ≤ w, h ≤ 100).
Output
Output file must contain h lines of w characters each — the viewport content.
Examples
№ |
stdin |
stdout |
1 |
3 0 2 33 10 |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2013-12-09 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Far Eastern QF 2013.H |