Logo
(追記) (追記ここまで)

33598번 - Urban Planning 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 2048 MB1711969.231%

문제

You are responsible for planning a new city! The city will be represented by a rectangular grid, where each cell is either a park or a built-up area.

The residents will naturally want to go for walks in the city parks. In particular, a rectangular walk is a rectangle consisting of the grid cells, which is at least 2 cells long both horizontally and vertically, such that all cells on the boundary of the rectangle are parks. Note that the cells inside the rectangle can be arbitrary.

An example rectangular walk (cells with dark background).

Your favourite number is $k$. To leave a long-lasting signature, you want to design the city in such a way that it has exactly $k$ rectangular walks.

입력

The input contains a single integer $k$ (0ドル ≤ k ≤ 4 \cdot 10^{12}$).

출력

On the first line, print two integers $h$ and $w$ (1ドル ≤ h, w ≤ 2025$), the height and width of the grid. On the next $h$ lines, print a string with $w$ characters each, with each character being #, denoting a park, or ., denoting a built-up area.

It is guaranteed that for any value of $k$ within the given limits, there exists a solution with height and width within the given limits. Any city within the given limits and with exactly $k$ rectangular walks will be accepted.

제한

예제 입력 1

5

예제 출력 1

3 4
####
#.##
####

Here are the five possible rectangular walks:

힌트

출처

ICPC > Regionals > Europe > European Championship > The 2025 ICPC European Championship B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /