Movatterモバイル変換


[0]ホーム

URL:


Logo

33179번 -Hezardastan’s Annual Report다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초2048 MB30025524086.022%

문제

Hezardastan, a giant among Iranian IT holding groups, houses several innovative companies such as Cafebazaar, Divar, and Balad. The annual report of the holding consists of $n$ chapters, each dedicated to a company under Hezardastan’s umbrella. The chapters in the report vary in length and occupy a certain number of pages. We want to compile all $n$ chapters into a PDF document that will be printed double-sided on A4 paper sheets. However, for aesthetic reasons, we want to avoid having pages from two different chapters printed on the same paper sheet. To ensure each chapter begins on a fresh, odd-numbered page, we plan to strategically insert an extra blank page after each chapter that has an odd number of pages. Now, we need to know the minimum number of A4 paper sheets needed to print the entire holding company report?

입력

The input consists of two lines. The first line contains a single integer $n$ ($1 \le n \le 100$), the number of chapters in the report. The second line contains $n$ space-separated integers, denoting the number of pages in each chapter. All numbers in the input are positive integers and are at most $100$.

출력

The output should consist of a single line containing the total number of A4 paper sheets needed to print the entire annual report.

제한

예제 입력 1

51 1 2 1 2

예제 출력 1

5

예제 입력 2

81 2 3 2 2 5 4 2

예제 출력 2

12

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > 2023 ICPC Asia Tehran Regional Contest B번

출처

대학교 대회

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


[8]ページ先頭

©2009-2025 Movatter.jp