問題一覧 > 通常問題

No.1122 Plane Tickets

レベル : / AI推定難易度 : 1750 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 36
作問者 : e869120 / テスター : square1001
お気に入りにしたユーザー ProblemId : 4632 / 自分の提出
問題文最終更新日: 2020-07-17 23:24:52
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 258 (順位表) の他の問題:

Problem Statement

E869120 has the following 5 types of vouchers, which can be used only with Yuki Airlines.

  • $a$ vouchers of type A.
  • $b$ vouchers of type B.
  • $c$ vouchers of type C.
  • $d$ vouchers of type D.
  • $e$ vouchers of type E.
Yuki Airlines offers a service that lets passengers board a plane for free by using vouchers. Specifically, performing any one of the following operations allows one free plane ride, 1 time.
  • Use $1$ voucher each of types A, B, C.
  • Use $1$ voucher each of types B, C, D.
  • Use $1$ voucher each of types C, D, E.
  • Use $1$ voucher each of types D, E, A.
  • Use $1$ voucher each of types E, A, B.
What is the maximum number of times he can ride a plane for free?

Input

$a$ $b$ $c$ $d$ $e$

The integers $a$, $b$, $c$, $d$, $e$ are given on line $1$, separated by spaces.

Output

Print, on 1 line, the maximum number of times he can ride a plane for free.

Constraints

  • $0 \leq a, b, c, d, e \leq 10^{15}$
  • All inputs are integers.

Sample

Sample 1
Input
1 1 2 1 1
Output
2

For example, the following operations allow him to ride a plane for free 2 times.

  • Use 1 voucher each of A, B, C.
  • Use 1 voucher each of C, D, E.
Note that there is no way of performing operations that allows him to ride a plane for free 3 or more times.

Sample 2
Input
4208 0 0 3076 2935
Output
2935

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。