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

30570번 - Mini-Tetris 3023 다국어

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

문제

A guy named Gry found a new game called "Mini-Tetris 3023". This small version of Tetris is played on a very long grid only 2ドル$ cells high and has just three types of tile:

  • A square made out of 4ドル$ tiles in a 2ドル \times 2$ grid.
  • An S-tile made out of 4ドル$ tiles, 2ドル$ on one row and 2ドル$ slightly offset on the other
  • A corner made out of 3ドル$ tiles, 1ドル$ on one row and 2ドル$ on the other

Tiles may be rotated 0ドル,ドル 90ドル,ドル 180ドル,ドル or 270ドル$ degrees to fit amongst each other, however, they cannot overlap or go outside the vertical boundary of the grid.

This game provides $a$ squares, $b$ S-tiles, and $c$ corners. Gry would like to beat the high score by creating the largest-possible contiguous 2ドル \times n$ rectangle out of some or all of the provided tiles, without any tiles overlapping or sticking out of the rectangle.

입력

  • The sole line of input contains three integers $a,ドル $b,ドル and $c$ (0ドル \leq a, b, c \leq 50$) --- the number of squares, S-tiles, and corners, respectively.

출력

Output the maximum possible width of the grid, $n,ドル that can be perfectly filled by some or all of the given tiles without overlapping or overstepping the boundaries.

제한

예제 입력 1

2 2 2

예제 출력 1

11

예제 입력 2

1 1 1

예제 출력 2

2

예제 입력 3

0 0 0

예제 출력 3

0

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2023 M번

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

출처

대학교 대회

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

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